From: kilian (dks-laptop) Date: Fri, 19 Mar 2021 12:00:45 +0000 (+0100) Subject: v20210319 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=316fc539058a12095494a3ce2129b390d9890d5d;p=pot_lu.git v20210319 --- diff --git a/app/lib/POT/Staff.php b/app/lib/POT/Staff.php index ff678c25..a3fd2d4f 100644 --- a/app/lib/POT/Staff.php +++ b/app/lib/POT/Staff.php @@ -97,7 +97,7 @@ where sc.id_staff='".$id_staff."' } $chsql = "select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from ( select sum(maxdays) as maxdays,sum(maxdays) * (round(cast(((extract(epoch from (current_date + weekhours::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0) /weekdays as numeric) ,2)+0.00) * '01:00:00'::interval as contracthours from ( -select case when count(daydate) >= weekdays then weekdays else weekdays-count(daydate)-count(sundays) end as maxdays, calweek,count(daydate) as cntdays,count(sundays) as sundays,weekdays,weekhours from ( +select case when count(daydate) >= weekdays then weekdays else weekdays-count(daydate)-1 end as maxdays, calweek,count(daydate) as cntdays,count(sundays) as sundays,weekdays,weekhours from ( select id_staff,date(date_trunc('week',daydate)) as calweek,daydate,case when date_part('isodow',daydate)::int4=7 then 1 else null end as sundays from ".$schema.".staffreportperioddays @@ -122,6 +122,7 @@ left join ( // ) wdays ) rnddays;"; //OLD // print STDERR "CONTRACT:".$chsql."\n========\n"; + error_log("set contract:".$chsql); $checkhours = $this->dbh->query($chsql); $usql = "update ".$schema.".staffreportperiod set maxdays=".(($checkhours["maxdays"] != "")?$checkhours["maxdays"]:'null').",contracthours=".(($checkhours["itmcontracthours"] != "")?"'".$checkhours["itmcontracthours"]."'":'null')." where id_staff='".$id_staff."' and id_reportperiod='".$pp["id"]."';" ; diff --git a/app/tmpl/module/periods/reportperiod.js b/app/tmpl/module/periods/reportperiod.js index 9c6c941b..661fe7e9 100644 --- a/app/tmpl/module/periods/reportperiod.js +++ b/app/tmpl/module/periods/reportperiod.js @@ -89,7 +89,7 @@ let reportperiod ={ {title: '{{ lbl.suppsunwork }}',width: 50, field:"suppvacancysunwork",hozAlign:"right",headerSort: false,headerVertical:true}, {title: '{{ lbl.avgweek_short }}',width: 60, field:"avgtotalweekhours",hozAlign:"right",headerSort: false,formatter:periodAVGFormatter}, {title: '{{ lbl.validated }}',width: 40, field:"isvalidated",hozAlign:"center",headerSort: false,formatter:"tickCross", formatterParams:{allowEmpty:true,allowTruthy: false},headerVertical:true}, - // {title: '{{ lbl.maxdays }}',width: 60, field:"maxdays",hozAlign:"center",headerSort: false} + {title: '{{ lbl.maxdays }}',width: 60, field:"maxdays",hozAlign:"center",headerSort: false} ] });