From: Kilian Saffran Date: Fri, 5 Jul 2019 16:23:30 +0000 (+0200) Subject: auto commit on 2019-07-05 18:23 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=dc652892f94e240902140ac5f38f149199f44a7e;p=dks_lu.git auto commit on 2019-07-05 18:23 --- diff --git a/apps/data/db/lechatpotte.sqlite b/apps/data/db/lechatpotte.sqlite index 0c99976..4244aaa 100644 Binary files a/apps/data/db/lechatpotte.sqlite and b/apps/data/db/lechatpotte.sqlite differ diff --git a/apps/data/db/underatert.sqlite b/apps/data/db/underatert.sqlite index ff7c7a9..3c6da64 100644 Binary files a/apps/data/db/underatert.sqlite and b/apps/data/db/underatert.sqlite differ diff --git a/apps/tmpl/creorga/modules/staff/js/coworker.js b/apps/tmpl/creorga/modules/staff/js/coworker.js index 7b01ad2..a210001 100644 --- a/apps/tmpl/creorga/modules/staff/js/coworker.js +++ b/apps/tmpl/creorga/modules/staff/js/coworker.js @@ -247,11 +247,11 @@ function load_table_vacancy() { " from (" + "select vc.uuid,vc.vacyear,vc.datefrom,vc.dateto,vc.type,vc.description,vc.accepted," + "((strftime('%s',vc.dateto) - strftime('%s',vc.datefrom)) /84600) + 1 as days," + - "((((strftime('%s',vc.dateto) - strftime('%s',vc.datefrom)) /84600) + 1) / 7) * (7 - (st.weekhours / st.maxdayhours)) as day_to_much," + + "((((strftime('%s',vc.dateto) - strftime('%s',vc.datefrom)) /84600) + 2) / 7) * (7 - (st.weekhours / st.maxdayhours)) as day_to_much," + "(select count(v.vacancydate) from vacancy v where v.vacancydateto is null and strftime('%s',v.vacancydate) not in ('0','6') and v.vacancydate between vc.datefrom and vc.dateto) as vdays,st.weekhours,st.weekhours / maxdayhours as days_per_week,vc.timefrom,vc.timeto,st.maxdayhours, " + "cast(cast(strftime(\"%s\",vc.timeto) as int)- cast(strftime(\"%s\",vc.timefrom) as int) as real)/3600 as hours " + "from vacancycalendar vc join staff st on (vc.staffuuid=st.uuid) where vc.staffuuid='"+ pconfig.uuid+"' and vc.vacyear=" + pconfig.year+"));"; - + //days_to_much => +2 for sat+sun => +1 for saturday icluded var vacdata = parent.appdb.dbquery(vacdatasql); var sums = { normal:0,except:0,ill:0,normal_ok:0,except_ok:0,ill_ok:0}; @@ -493,7 +493,7 @@ $("#vacancylastyearrest").val(0); function set_selectyears() { - var years = parent.appdb.dbquery("select COALESCE((select cast(min(vacancyyear) as TEXT) as minyear from staffvacancydays where staffuuid='4b86fe07-d175-c74e-aafc-40e2275f3b6d'),strftime('%Y',coalesce(min(entrydate),date('now','-1 year')))) as minyear,strftime('%Y',date('now', '+1 year')) as maxyear from staff where uuid='"+pconfig.uuid+"';"); + var years = parent.appdb.dbquery("select COALESCE((select cast(min(vacancyyear) as TEXT) as minyear from staffvacancydays where staffuuid='" + pconfig.uuid + "'),strftime('%Y',coalesce(min(entrydate),date('now','-1 year')))) as minyear,strftime('%Y',date('now', '+1 year')) as maxyear from staff where uuid='"+pconfig.uuid+"';"); var minyear = parseInt(years.sqldata[0].minyear); var maxyear = parseInt(years.sqldata[0].maxyear); for (var y=minyear;y<=maxyear;y++){