From: kilian@dks-pc1 Date: Sat, 25 Jul 2020 08:32:56 +0000 (+0200) Subject: v20200725 X-Git-Tag: 1.0.15~51 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=16c369026fdb9cb8c7f01f2699d576d1466d43e0;p=pot_lu.git v20200725 --- diff --git a/.gitignore b/.gitignore index b326ff12..54e8c4d4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ desktopapp/node_modules/package-lock.json OLD/ webapp/data/output/* webapp/data/tmp/* -webapp/tools/ -webapp/lib/perl5/* \ No newline at end of file +webapp/tools/* +webapp/lib/perl5/* + diff --git a/.vscode/settings.json b/.vscode/settings.json index f147280d..41b93194 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,6 @@ { "perlSyntax.includePaths": [ - "${workspaceFolder}\\lib\\perl5","${workspaceFolder}\\lib" + "C:/Users/kilian/Workspace/pot_lu/webapp/lib/perl5","C:/Users/kilian/Workspace/pot_lu/webapp/lib" ], "git.ignoreLimitWarning": true diff --git a/dev/db/potlu_db.portanova.pg.schema.sql b/dev/db/potlu_db.portanova.pg.schema.sql index 1256a10c..a2dadaa6 100644 --- a/dev/db/potlu_db.portanova.pg.schema.sql +++ b/dev/db/potlu_db.portanova.pg.schema.sql @@ -29,26 +29,26 @@ CREATE SCHEMA portanova; CREATE FUNCTION portanova.add_reportperiod() RETURNS text LANGUAGE plpgsql - AS $$ -declare - rpstart date; - rpend date; - rplength int4; - rpparentid text; - rpunit text; - r_stgrps record; - rpsql text; - newperiodid text; -begin - select reportperiodunit,reportperiodlength,reportperiodstart into rpunit,rplength,rpstart from public.companies where schemata='portanova'; - select case when max(enddate) is null then rpstart else date(max(enddate) + interval '1 day') end into rpstart from portanova.reportperiod; - execute 'select date(date(''' || rpstart || ''') + interval ''' || rplength || ' ' || rpunit || 's'' - interval ''1 day'' );' into rpend; - select max(id) into rpparentid from portanova.reportperiod; - --raise notice 'ADD NEW PERIOD: %->%',rpstart,rpend; - INSERT INTO portanova.reportperiod (startdate, enddate, id_parentreportperiod) VALUES(rpstart,rpend,rpparentid) returning id into newperiodid; - perform portanova.update_all_staff_in_period(newperiodid); - return newperiodid; -end; + AS $$ +declare + rpstart date; + rpend date; + rplength int4; + rpparentid text; + rpunit text; + r_stgrps record; + rpsql text; + newperiodid text; +begin + select reportperiodunit,reportperiodlength,reportperiodstart into rpunit,rplength,rpstart from public.companies where schemata='portanova'; + select case when max(enddate) is null then rpstart else date(max(enddate) + interval '1 day') end into rpstart from portanova.reportperiod; + execute 'select date(date(''' || rpstart || ''') + interval ''' || rplength || ' ' || rpunit || 's'' - interval ''1 day'' );' into rpend; + select max(id) into rpparentid from portanova.reportperiod; + --raise notice 'ADD NEW PERIOD: %->%',rpstart,rpend; + INSERT INTO portanova.reportperiod (startdate, enddate, id_parentreportperiod) VALUES(rpstart,rpend,rpparentid) returning id into newperiodid; + perform portanova.update_all_staff_in_period(newperiodid); + return newperiodid; +end; $$; @@ -58,20 +58,20 @@ $$; CREATE FUNCTION portanova.getperiod_staffcontract(pid text) RETURNS TABLE(id text, id_staff text, startdate date, enddate date, weekhours interval, weekdays integer, id_workplan text, defaultfreedays json) LANGUAGE plpgsql - AS $$ - declare - pstart date; - pend date; - begin - select prd.startdate as prdstart,prd.enddate as prdend into pstart,pend from portanova.reportperiod prd where prd.id=pid; - return QUERY -select sc.id,sc.id_staff, -case when sc.startdate < pstart then pstart else sc.startdate end as startdate, -case when sc.enddate is null then pend when sc.enddate > pend then pend else sc.enddate end as enddate, -sc.weekhours,sc.weekdays,sc.id_workplan,sc.defaultfreedays -from portanova.staffcontract sc where sc.startdate<= pend and (sc.enddate is null or sc.enddate >= pstart) -order by sc.id_staff,sc.startdate,sc.enddate; -END; + AS $$ + declare + pstart date; + pend date; + begin + select prd.startdate as prdstart,prd.enddate as prdend into pstart,pend from portanova.reportperiod prd where prd.id=pid; + return QUERY +select sc.id,sc.id_staff, +case when sc.startdate < pstart then pstart else sc.startdate end as startdate, +case when sc.enddate is null then pend when sc.enddate > pend then pend else sc.enddate end as enddate, +sc.weekhours,sc.weekdays,sc.id_workplan,sc.defaultfreedays +from portanova.staffcontract sc where sc.startdate<= pend and (sc.enddate is null or sc.enddate >= pstart) +order by sc.id_staff,sc.startdate,sc.enddate; +END; $$; @@ -81,14 +81,14 @@ $$; CREATE FUNCTION portanova.getperiod_staffcontract(pstart date, pend date) RETURNS TABLE(id text, id_staff text, startdate date, enddate date, weekhours interval, weekdays integer, id_workplan text) LANGUAGE plpgsql - AS $$ - BEGIN - return QUERY -select id,id_staff,case when startdate < pstart then pstart else startdate end as startdate,case when enddate is null then pend when enddate > pend then pend else enddate end as enddate, -weekdays, -id_workplan, -weekhours from portanova.staffcontract where startdate<= pend and (enddate is null or enddate >= pstart) order by id_staff,startdate,enddate; -END; + AS $$ + BEGIN + return QUERY +select id,id_staff,case when startdate < pstart then pstart else startdate end as startdate,case when enddate is null then pend when enddate > pend then pend else enddate end as enddate, +weekdays, +id_workplan, +weekhours from portanova.staffcontract where startdate<= pend and (enddate is null or enddate >= pstart) order by id_staff,startdate,enddate; +END; $$; @@ -98,20 +98,20 @@ $$; CREATE FUNCTION portanova.onchange_reportperiod(pid_period text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - prdstart date; - prdend date; - strec record; -begin - select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period; - for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff - loop - --raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate; - perform portanova.update_staffworkplan(pid_period,strec.id_staff); - end loop; - return true; -end; + AS $$ +declare + prdstart date; + prdend date; + strec record; +begin + select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period; + for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff + loop + --raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate; + perform portanova.update_staffworkplan(pid_period,strec.id_staff); + end loop; + return true; +end; $$; @@ -121,16 +121,16 @@ $$; CREATE FUNCTION portanova.refresh_periods() RETURNS boolean LANGUAGE plpgsql - AS $$ - declare - prds record; - begin - for prds in select id from portanova.reportperiod order by startdate,enddate - loop - perform portanova.update_all_staff_in_period(prds.id); - end loop; - RETURN true; - END; + AS $$ + declare + prds record; + begin + for prds in select id from portanova.reportperiod order by startdate,enddate + loop + perform portanova.update_all_staff_in_period(prds.id); + end loop; + RETURN true; + END; $$; @@ -140,52 +140,52 @@ $$; CREATE FUNCTION portanova.set_periodday_sums(pid_periodday text) RETURNS text LANGUAGE plpgsql - AS $$ -declare - stw record; - dt1 interval := '00:00:00'::interval; - dt2 interval := '00:00:00'::interval; - dp interval := '00:00:00'::interval; - cworkhours interval := '00:00:00'::interval; - cvacancyhours interval := '00:00:00'::interval; - crecuperationhours interval := '00:00:00'::interval; - cdayhours interval := '00:00:00'::interval; - cinterruptionhours interval := '00:00:00'::interval; -begin - - select * into stw from portanova.staffreportperioddays where id=pid_periodday; - if stw.timestart1 is not null and stw.timeend1 is not null then - dt1 := stw.timeend1-stw.timestart1; - end if; - if stw.timestart2 is not null and stw.timeend2 is not null then - dt2 := stw.timeend2-stw.timestart2; - end if; - if stw.timepause is not null then - dp := stw.timepause; - end if; - cworkhours := (dt1+dt2)-dp; - if (dt1 > '00:00:00'::interval and dt2 > '00:00:00'::interval) then - cinterruptionhours := stw.timestart2 -stw.timeend1; - end if; - if stw.vacancyhours is not null then - if stw.vacancyhours <= stw.contracthours then - cvacancyhours := stw.vacancyhours; - else - cvacancyhours := stw.contracthours; - end if; - end if; - if stw.recuperationhours is not null then - if stw.recuperationhours <= stw.contracthours then - crecuperationhours := stw.recuperationhours; - else - crecuperationhours := stw.contracthours; - end if; - end if; - cdayhours := cworkhours+cvacancyhours+crecuperationhours; - - update portanova.staffreportperioddays set workhours=cworkhours,interruptionhours=cinterruptionhours,dayhours=cdayhours,vacancyhours=cvacancyhours,recuperationhours=crecuperationhours where id=pid_periodday; - return pid_periodday; -end; + AS $$ +declare + stw record; + dt1 interval := '00:00:00'::interval; + dt2 interval := '00:00:00'::interval; + dp interval := '00:00:00'::interval; + cworkhours interval := '00:00:00'::interval; + cvacancyhours interval := '00:00:00'::interval; + crecuperationhours interval := '00:00:00'::interval; + cdayhours interval := '00:00:00'::interval; + cinterruptionhours interval := '00:00:00'::interval; +begin + + select * into stw from portanova.staffreportperioddays where id=pid_periodday; + if stw.timestart1 is not null and stw.timeend1 is not null then + dt1 := stw.timeend1-stw.timestart1; + end if; + if stw.timestart2 is not null and stw.timeend2 is not null then + dt2 := stw.timeend2-stw.timestart2; + end if; + if stw.timepause is not null then + dp := stw.timepause; + end if; + cworkhours := (dt1+dt2)-dp; + if (dt1 > '00:00:00'::interval and dt2 > '00:00:00'::interval) then + cinterruptionhours := stw.timestart2 -stw.timeend1; + end if; + if stw.vacancyhours is not null then + if stw.vacancyhours <= stw.contracthours then + cvacancyhours := stw.vacancyhours; + else + cvacancyhours := stw.contracthours; + end if; + end if; + if stw.recuperationhours is not null then + if stw.recuperationhours <= stw.contracthours then + crecuperationhours := stw.recuperationhours; + else + crecuperationhours := stw.contracthours; + end if; + end if; + cdayhours := cworkhours+cvacancyhours+crecuperationhours; + + update portanova.staffreportperioddays set workhours=cworkhours,interruptionhours=cinterruptionhours,dayhours=cdayhours,vacancyhours=cvacancyhours,recuperationhours=crecuperationhours where id=pid_periodday; + return pid_periodday; +end; $$; @@ -195,31 +195,31 @@ $$; CREATE FUNCTION portanova.set_staffperiod_sums(pid_period text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ - declare - weekrec record; - BEGIN - for weekrec in select id_staff,id_reportperiod, -sum(contracthours) as contracthours, -sum(workhours) as workhours, -sum(vacancyhours) as vacancyhours, -sum(recuperationhours) as recuperationhours, -sum(diffhours) as hoursdiff, -sum(totalhours) as totalhours -from portanova.staffreportperiodweeks where id_staff=pid_staff and id_reportperiod=pid_period group by id_reportperiod,id_staff - loop - update portanova.staffreportperiod set contracthours=weekrec.contracthours, - workhours=weekrec.workhours, - vacancyhours=weekrec.vacancyhours, - recuperationhours=weekrec.recuperationhours, - hoursdiff=weekrec.hoursdiff, - totalhours=weekrec.totalhours - where id_staff=pid_staff and id_reportperiod=pid_period; - end loop; - --set periodstaffdata (based on periodweeks) - --set nextperiodsdata(based on) - return true; - END; + AS $$ + declare + weekrec record; + BEGIN + for weekrec in select id_staff,id_reportperiod, +sum(contracthours) as contracthours, +sum(workhours) as workhours, +sum(vacancyhours) as vacancyhours, +sum(recuperationhours) as recuperationhours, +sum(diffhours) as hoursdiff, +sum(totalhours) as totalhours +from portanova.staffreportperiodweeks where id_staff=pid_staff and id_reportperiod=pid_period group by id_reportperiod,id_staff + loop + update portanova.staffreportperiod set contracthours=weekrec.contracthours, + workhours=weekrec.workhours, + vacancyhours=weekrec.vacancyhours, + recuperationhours=weekrec.recuperationhours, + hoursdiff=weekrec.hoursdiff, + totalhours=weekrec.totalhours + where id_staff=pid_staff and id_reportperiod=pid_period; + end loop; + --set periodstaffdata (based on periodweeks) + --set nextperiodsdata(based on) + return true; + END; $$; @@ -229,48 +229,48 @@ $$; CREATE FUNCTION portanova.set_staffperiodweek_sums(pid_reportperiod text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - wkcon record; - tmpcontrhours interval; - freedays int4 := 0; -begin - -- INSERT Contract data into Week -for wkcon in select srpw.id,srpw.calweek,srpw.weekstart,srpw.calyear,rp.startdate as periodstart,psc.startdate,rp.enddate as periodend,psc.enddate,psc.weekhours,psc.weekdays,srpw.contractdays,srpw.caldays,srpw.diffhours,srpw.contracthours,srpw.totalhours,psc.defaultfreedays -from portanova.staffreportperiodweeks srpw -left join (select xa.id_staff,xa.startdate,xa.enddate,xa.weekhours,xa.weekdays,xa.defaultfreedays from portanova.getperiod_staffcontract(pid_reportperiod) xa where xa.id_staff=pid_staff) psc -on (srpw.weekstart between date_trunc('week',psc.startdate) and psc.enddate) -left join portanova.reportperiod rp on (srpw.id_reportperiod =rp.id) -where srpw.id_reportperiod=pid_reportperiod and srpw.id_staff=pid_staff -loop - --raise notice 'id=%',wkcon; - if wkcon.defaultfreedays is not null then - freedays = json_array_length(wkcon.defaultfreedays); - end if; - wkcon.contracthours=wkcon.weekhours; - wkcon.contractdays=wkcon.weekdays; - if wkcon.calweek= date_part('week',wkcon.periodstart)::int4 and wkcon.calyear= date_part('isoyear',wkcon.periodstart)::int4 then - wkcon.contracthours = wkcon.contracthours - ((wkcon.weekhours/wkcon.weekdays) * (wkcon.startdate-wkcon.periodstart)::int4); - end if; - --if wkcon.startdate > wkcon.periodstart then - -- wkcon.contractdays = wkcon.contractdays-(wkcon.startdate-wkcon.periodstart)::int4; - -- wkcon.contracthours = (wkcon.weekhours/wkcon.weekdays) * wkcon.contractdays; - --end if; - --if wkcon.enddate < wkcon.periodend then - -- wkcon.contractdays = wkcon.contractdays-(wkcon.periodend-wkcon.enddate)::int4; - -- wkcon.contracthours = (wkcon.weekhours/wkcon.weekdays) * wkcon.contractdays; - --end if; - - - wkcon.diffhours = wkcon.totalhours-wkcon.contracthours; - raise notice 'contractdays: % contracthours: % totalhours: % diffhours: %',wkcon.contractdays,wkcon.contracthours,wkcon.totalhours,wkcon.diffhours; - --raise notice 'id=% cdays=% chours=% diffhours=%',wkcon.id,wkcon.contractdays,wkcon.contracthours,wkcon.diffhours; - update portanova.staffreportperiodweeks set contracthours=wkcon.contracthours,contractdays=wkcon.contractdays,diffhours=wkcon.diffhours where id=wkcon.id; - -end loop; - - return true; -end; + AS $$ +declare + wkcon record; + tmpcontrhours interval; + freedays int4 := 0; +begin + -- INSERT Contract data into Week +for wkcon in select srpw.id,srpw.calweek,srpw.weekstart,srpw.calyear,rp.startdate as periodstart,psc.startdate,rp.enddate as periodend,psc.enddate,psc.weekhours,psc.weekdays,srpw.contractdays,srpw.caldays,srpw.diffhours,srpw.contracthours,srpw.totalhours,psc.defaultfreedays +from portanova.staffreportperiodweeks srpw +left join (select xa.id_staff,xa.startdate,xa.enddate,xa.weekhours,xa.weekdays,xa.defaultfreedays from portanova.getperiod_staffcontract(pid_reportperiod) xa where xa.id_staff=pid_staff) psc +on (srpw.weekstart between date_trunc('week',psc.startdate) and psc.enddate) +left join portanova.reportperiod rp on (srpw.id_reportperiod =rp.id) +where srpw.id_reportperiod=pid_reportperiod and srpw.id_staff=pid_staff +loop + --raise notice 'id=%',wkcon; + if wkcon.defaultfreedays is not null then + freedays = json_array_length(wkcon.defaultfreedays); + end if; + wkcon.contracthours=wkcon.weekhours; + wkcon.contractdays=wkcon.weekdays; + if wkcon.calweek= date_part('week',wkcon.periodstart)::int4 and wkcon.calyear= date_part('isoyear',wkcon.periodstart)::int4 then + wkcon.contracthours = wkcon.contracthours - ((wkcon.weekhours/wkcon.weekdays) * (wkcon.startdate-wkcon.periodstart)::int4); + end if; + --if wkcon.startdate > wkcon.periodstart then + -- wkcon.contractdays = wkcon.contractdays-(wkcon.startdate-wkcon.periodstart)::int4; + -- wkcon.contracthours = (wkcon.weekhours/wkcon.weekdays) * wkcon.contractdays; + --end if; + --if wkcon.enddate < wkcon.periodend then + -- wkcon.contractdays = wkcon.contractdays-(wkcon.periodend-wkcon.enddate)::int4; + -- wkcon.contracthours = (wkcon.weekhours/wkcon.weekdays) * wkcon.contractdays; + --end if; + + + wkcon.diffhours = wkcon.totalhours-wkcon.contracthours; + raise notice 'contractdays: % contracthours: % totalhours: % diffhours: %',wkcon.contractdays,wkcon.contracthours,wkcon.totalhours,wkcon.diffhours; + --raise notice 'id=% cdays=% chours=% diffhours=%',wkcon.id,wkcon.contractdays,wkcon.contracthours,wkcon.diffhours; + update portanova.staffreportperiodweeks set contracthours=wkcon.contracthours,contractdays=wkcon.contractdays,diffhours=wkcon.diffhours where id=wkcon.id; + +end loop; + + return true; +end; $$; @@ -280,54 +280,54 @@ $$; CREATE FUNCTION portanova.set_stafftoperioddays(pid_period text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - cont record; - prd record; - cdl record; - cdate date; - edate date; - wday text; - wdaynum int4; - wdayplan record; - cid_staffworkplan text; - cdaytime interval; -begin - select * into prd from portanova.reportperiod where id= pid_period; - for cont in select * from portanova.getperiod_staffcontract(pid_period) where id_staff=pid_staff - loop - cdate := cont.startdate; - while cdate <= cont.enddate loop - if cdate between prd.startdate and prd.enddate then - wdaynum = date_part('isodow',cdate)::INT4; - cdaytime := null; - - if position('"' || wdaynum || '"' in cont.defaultfreedays::text) = 0 then - cdaytime := cont.weekhours/cont.weekdays; - end if; - raise notice 'wday % => % => %',wdaynum,position('"' || wdaynum || '"' in cont.defaultfreedays::text),cdaytime; - if (cont.id_workplan is not null) then - wday := substr(to_char(cdate,'day'),1,3); - execute 'select ' || wday || '_timestart1 as ts1,' || wday || '_timeend1 as te1,' || wday || '_timestart2 as ts2,' || wday ||'_timeend2 as te2,'|| wday ||'_timepause as tp from portanova.workplans where id=''' || cont.id_workplan || ''';' into wdayplan; - - insert into portanova.staffreportperioddays (id_staff,daydate,id_reportperiod,timestart1,timeend1,timestart2,timeend2,timepause,contracthours,wdcontracthours) - values (pid_staff,cdate,pid_period,wdayplan.ts1,wdayplan.te1,wdayplan.ts2,wdayplan.te2,wdayplan.tp,cont.weekhours/cont.weekdays,cdaytime) - on conflict on constraint uniq_staffworplan_staffday do update set contracthours=cont.weekhours/cont.weekdays,wdcontracthours=cdaytime - returning id into cid_staffworkplan; - else - insert into portanova.staffreportperioddays (id_staff,daydate,id_reportperiod,contracthours,wdcontracthours) values ( pid_staff , cdate , pid_period,cont.weekhours/cont.weekdays,cdaytime) - on conflict on constraint uniq_staffworplan_staffday do update set contracthours=cont.weekhours/cont.weekdays,wdcontracthours=cdaytime - returning id into cid_staffworkplan; - end if; - end if; - perform portanova.set_periodday_sums(cid_staffworkplan); - cdate = cdate + interval '1 day'; - end loop; - - end loop; - perform portanova.verify_perioddays(pid_period,pid_staff); - return true; -end; + AS $$ +declare + cont record; + prd record; + cdl record; + cdate date; + edate date; + wday text; + wdaynum int4; + wdayplan record; + cid_staffworkplan text; + cdaytime interval; +begin + select * into prd from portanova.reportperiod where id= pid_period; + for cont in select * from portanova.getperiod_staffcontract(pid_period) where id_staff=pid_staff + loop + cdate := cont.startdate; + while cdate <= cont.enddate loop + if cdate between prd.startdate and prd.enddate then + wdaynum = date_part('isodow',cdate)::INT4; + cdaytime := null; + + if position('"' || wdaynum || '"' in cont.defaultfreedays::text) = 0 then + cdaytime := cont.weekhours/cont.weekdays; + end if; + raise notice 'wday % => % => %',wdaynum,position('"' || wdaynum || '"' in cont.defaultfreedays::text),cdaytime; + if (cont.id_workplan is not null) then + wday := substr(to_char(cdate,'day'),1,3); + execute 'select ' || wday || '_timestart1 as ts1,' || wday || '_timeend1 as te1,' || wday || '_timestart2 as ts2,' || wday ||'_timeend2 as te2,'|| wday ||'_timepause as tp from portanova.workplans where id=''' || cont.id_workplan || ''';' into wdayplan; + + insert into portanova.staffreportperioddays (id_staff,daydate,id_reportperiod,timestart1,timeend1,timestart2,timeend2,timepause,contracthours,wdcontracthours) + values (pid_staff,cdate,pid_period,wdayplan.ts1,wdayplan.te1,wdayplan.ts2,wdayplan.te2,wdayplan.tp,cont.weekhours/cont.weekdays,cdaytime) + on conflict on constraint uniq_staffworplan_staffday do update set contracthours=cont.weekhours/cont.weekdays,wdcontracthours=cdaytime + returning id into cid_staffworkplan; + else + insert into portanova.staffreportperioddays (id_staff,daydate,id_reportperiod,contracthours,wdcontracthours) values ( pid_staff , cdate , pid_period,cont.weekhours/cont.weekdays,cdaytime) + on conflict on constraint uniq_staffworplan_staffday do update set contracthours=cont.weekhours/cont.weekdays,wdcontracthours=cdaytime + returning id into cid_staffworkplan; + end if; + end if; + perform portanova.set_periodday_sums(cid_staffworkplan); + cdate = cdate + interval '1 day'; + end loop; + + end loop; + perform portanova.verify_perioddays(pid_period,pid_staff); + return true; +end; $$; @@ -337,42 +337,42 @@ $$; CREATE FUNCTION portanova.set_stafftoperiodweeks(pid_reportperiod text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - wkpd record; - wkcon record; -begin ---INSERT DAY DATA into WEEK - for wkpd in select id_staff,id_reportperiod,calyear,calweek,weekstart, -coalesce(sum(workhours),'00:00:00') as workhours , -coalesce(sum(vacancyhours),'00:00:00') as vacancyhours , -coalesce(sum(recuperationhours) ,'00:00:00' ) as recuperationhours , -coalesce(sum(dayhours),'00:00:00') as totalhours, -coalesce(sum(contracthours),'00:00:00') as contracthours, -count(wdcontracthours) as caldays -from ( -select swp.id,swp.id_reportperiod,swp.id_staff, -date_part('isoyear',swp.daydate) as calyear, -date_part('week',swp.daydate) as calweek, -date(date_trunc('week',swp.daydate)) as weekstart, -swp.workhours, -swp.contracthours, -swp.recuperationhours, -swp.dayhours, -swp.vacancyhours, -swp.wdcontracthours -from portanova.staffreportperioddays swp -where swp.id_reportperiod= pid_reportperiod and swp.id_staff=pid_staff) wkwp group by id_staff,id_reportperiod,calyear,calweek,weekstart - loop - --raise notice 'id_staff: % id_period: % calweek: % calyear: %',pid_staff,pid_reportperiod,wkpd.calweek,wkpd.calyear; - insert into portanova.staffreportperiodweeks (id_staff, id_reportperiod, calyear, calweek, workhours,vacancyhours, recuperationhours, weekstart,totalhours,caldays,contracthours,diffhours) - VALUES(wkpd.id_staff, wkpd.id_reportperiod, wkpd.calyear, wkpd.calweek, wkpd.workhours, wkpd.vacancyhours, wkpd.recuperationhours, wkpd.weekstart,wkpd.totalhours,wkpd.caldays,wkpd.contracthours,wkpd.contracthours-wkpd.totalhours) - on conflict on constraint uniq_staffweekplan_cal do update set workhours=wkpd.workhours, vacancyhours=wkpd.vacancyhours, recuperationhours=wkpd.recuperationhours,totalhours=wkpd.totalhours,caldays=wkpd.caldays,contracthours=wkpd.contracthours,diffhours=wkpd.contracthours-wkpd.totalhours; - end loop; - perform portanova.set_staffperiodweek_sums(pid_reportperiod, pid_staff); - - return true; -end; + AS $$ +declare + wkpd record; + wkcon record; +begin +--INSERT DAY DATA into WEEK + for wkpd in select id_staff,id_reportperiod,calyear,calweek,weekstart, +coalesce(sum(workhours),'00:00:00') as workhours , +coalesce(sum(vacancyhours),'00:00:00') as vacancyhours , +coalesce(sum(recuperationhours) ,'00:00:00' ) as recuperationhours , +coalesce(sum(dayhours),'00:00:00') as totalhours, +coalesce(sum(contracthours),'00:00:00') as contracthours, +count(wdcontracthours) as caldays +from ( +select swp.id,swp.id_reportperiod,swp.id_staff, +date_part('isoyear',swp.daydate) as calyear, +date_part('week',swp.daydate) as calweek, +date(date_trunc('week',swp.daydate)) as weekstart, +swp.workhours, +swp.contracthours, +swp.recuperationhours, +swp.dayhours, +swp.vacancyhours, +swp.wdcontracthours +from portanova.staffreportperioddays swp +where swp.id_reportperiod= pid_reportperiod and swp.id_staff=pid_staff) wkwp group by id_staff,id_reportperiod,calyear,calweek,weekstart + loop + --raise notice 'id_staff: % id_period: % calweek: % calyear: %',pid_staff,pid_reportperiod,wkpd.calweek,wkpd.calyear; + insert into portanova.staffreportperiodweeks (id_staff, id_reportperiod, calyear, calweek, workhours,vacancyhours, recuperationhours, weekstart,totalhours,caldays,contracthours,diffhours) + VALUES(wkpd.id_staff, wkpd.id_reportperiod, wkpd.calyear, wkpd.calweek, wkpd.workhours, wkpd.vacancyhours, wkpd.recuperationhours, wkpd.weekstart,wkpd.totalhours,wkpd.caldays,wkpd.contracthours,wkpd.contracthours-wkpd.totalhours) + on conflict on constraint uniq_staffweekplan_cal do update set workhours=wkpd.workhours, vacancyhours=wkpd.vacancyhours, recuperationhours=wkpd.recuperationhours,totalhours=wkpd.totalhours,caldays=wkpd.caldays,contracthours=wkpd.contracthours,diffhours=wkpd.contracthours-wkpd.totalhours; + end loop; + perform portanova.set_staffperiodweek_sums(pid_reportperiod, pid_staff); + + return true; +end; $$; @@ -382,17 +382,17 @@ $$; CREATE FUNCTION portanova.update_all_staff_in_period(pid_period text) RETURNS boolean LANGUAGE plpgsql - AS $$ - declare - staffrec record; - staffreportid text; - BEGIN - for staffrec in select id_staff from portanova.getperiod_staffcontract(pid_period) group by id_staff - loop - perform portanova.update_staff_in_period(pid_period,staffrec.id_staff); - end loop; - return true; - END; + AS $$ + declare + staffrec record; + staffreportid text; + BEGIN + for staffrec in select id_staff from portanova.getperiod_staffcontract(pid_period) group by id_staff + loop + perform portanova.update_staff_in_period(pid_period,staffrec.id_staff); + end loop; + return true; + END; $$; @@ -402,17 +402,17 @@ $$; CREATE FUNCTION portanova.update_staff_in_period(pid_period text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ - declare - staffreportid text; - BEGIN - insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,pid_staff) - on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid; - perform portanova.set_stafftoperioddays(pid_period,pid_staff); - perform portanova.set_stafftoperiodweeks(pid_period,pid_staff); - perform portanova.set_staffperiod_sums(pid_period,pid_staff); - return true; - END; + AS $$ + declare + staffreportid text; + BEGIN + insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,pid_staff) + on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid; + perform portanova.set_stafftoperioddays(pid_period,pid_staff); + perform portanova.set_stafftoperiodweeks(pid_period,pid_staff); + perform portanova.set_staffperiod_sums(pid_period,pid_staff); + return true; + END; $$; @@ -422,19 +422,19 @@ $$; CREATE FUNCTION portanova.update_staffreportperiod(pid_reportperiod text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - stprd record; -begin - for stprd in SELECT id_staff, id_period, sum(plannedhours) as plannedhours,sum(contracthours) as contracthours, sum(trackedhours) as trackedhours, sum(vacancyhours) as vacancyhours, sum(recuperationhours) as recuperationhours, sum(hoursdiff) as hoursdiff - FROM portanova.staffweeksums where id_period=pid_reportperiod and id_staff=pid_staff group by id_staff,id_period - loop - INSERT INTO portanova.staffreportperiodsums (id_staff, id_reportperiod, plannedhours, contracthours, trackedhours, vacancyhours, recuperationhours, hoursdiff) - values (stprd.id_staff,stprd.id_period,stprd.plannedhours,stprd.contracthours,stprd.trackedhours,stprd.vacancyhours,stprd.recuperationhours,stprd.hoursdiff) - on conflict on constraint uniq_staffperiod_cal do update set plannedhours=stprd.plannedhours,contracthours=stprd.contracthours,trackedhours=stprd.trackedhours,vacancyhours=stprd.vacancyhours,recuperationhours=stprd.recuperationhours,hoursdiff=stprd.hoursdiff; - end loop; - return true; -end; + AS $$ +declare + stprd record; +begin + for stprd in SELECT id_staff, id_period, sum(plannedhours) as plannedhours,sum(contracthours) as contracthours, sum(trackedhours) as trackedhours, sum(vacancyhours) as vacancyhours, sum(recuperationhours) as recuperationhours, sum(hoursdiff) as hoursdiff + FROM portanova.staffweeksums where id_period=pid_reportperiod and id_staff=pid_staff group by id_staff,id_period + loop + INSERT INTO portanova.staffreportperiodsums (id_staff, id_reportperiod, plannedhours, contracthours, trackedhours, vacancyhours, recuperationhours, hoursdiff) + values (stprd.id_staff,stprd.id_period,stprd.plannedhours,stprd.contracthours,stprd.trackedhours,stprd.vacancyhours,stprd.recuperationhours,stprd.hoursdiff) + on conflict on constraint uniq_staffperiod_cal do update set plannedhours=stprd.plannedhours,contracthours=stprd.contracthours,trackedhours=stprd.trackedhours,vacancyhours=stprd.vacancyhours,recuperationhours=stprd.recuperationhours,hoursdiff=stprd.hoursdiff; + end loop; + return true; +end; $$; @@ -444,21 +444,21 @@ $$; CREATE FUNCTION portanova.update_staffweeksums(pid_staffworkplan text) RETURNS void LANGUAGE plpgsql - AS $$ -declare - wkpl_record record; - wkpltt time without time zone := '00:00:00'::interval; -begin - select - case WHEN timestart1 > timeend1 THEN '24:00:00'::time without time zone - (timestart1 - timeend1)::time without time zone ELSE timeend1 - timestart1 END AS time1, - CASE WHEN timestart2 > timeend2 THEN '24:00:00'::time without time zone - (timestart2 - timeend2)::time without time zone ELSE timeend2 - timestart2 END AS time2, - timepause - into wkpl_record - from portanova.staffworkplan where id= pid_staffworkplan; - - wkpltt := wkpl_record.time1 + wkpl_record.time2 - wkpl_record.timepause::interval; - update portanova.staffworkplan set totaltime=wkpltt where id=pid_staffworkplan; -end; + AS $$ +declare + wkpl_record record; + wkpltt time without time zone := '00:00:00'::interval; +begin + select + case WHEN timestart1 > timeend1 THEN '24:00:00'::time without time zone - (timestart1 - timeend1)::time without time zone ELSE timeend1 - timestart1 END AS time1, + CASE WHEN timestart2 > timeend2 THEN '24:00:00'::time without time zone - (timestart2 - timeend2)::time without time zone ELSE timeend2 - timestart2 END AS time2, + timepause + into wkpl_record + from portanova.staffworkplan where id= pid_staffworkplan; + + wkpltt := wkpl_record.time1 + wkpl_record.time2 - wkpl_record.timepause::interval; + update portanova.staffworkplan set totaltime=wkpltt where id=pid_staffworkplan; +end; $$; @@ -468,49 +468,49 @@ $$; CREATE FUNCTION portanova.update_staffworkplan(pid_period text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - cont record; - prd record; - cdl record; - cdate date; - edate date; - wday text; - wdayplan record; - cid_staffworkplan text; -begin - select * into prd from portanova.reportperiod where id= pid_period; - for cont in select * from portanova.staffcontract where id_staff= pid_staff and (enddate >= prd.startdate or (enddate is null and startdate <= prd.enddate)) /*order by startdate,enddate nulls last*/ - loop - if cont.enddate is null then - cont.enddate := prd.enddate; - end if; - cdate := cont.startdate; - while cdate <= cont.enddate loop - if cdate between prd.startdate and prd.enddate then - if (cont.id_workplan is not null) then - wday := substr(to_char(cdate,'day'),1,3); - execute 'select ' || wday || '_timestart1 as ts1,' || wday || '_timeend1 as te1,' || wday || '_timestart2 as ts2,' || wday ||'_timeend2 as te2,'|| wday ||'_timepause as tp from portanova.workplans where id=' || cont.id_workplan || ';' into wdayplan; - insert into portanova.staffworkplan (id_staff,daydate,id_reportperiod,timestart1,timeend1,timestart2,timeend2,timepause,contracthours,id_staffgroup,fullweeksplithours) - values (pid_staff,cdate,pid_period,wdayplan.ts1,wdayplan.te1,wdayplan.ts2,wdayplan.te2,wdayplan.tp,cont.weekhours/cont.weekdays,cont.id_staffgroup,cont.weekhours/7) - on conflict on constraint uniq_staffworplan_staffday do update set id_reportperiod = pid_period,contracthours=cont.weekhours/cont.weekdays,id_staffgroup=cont.id_staffgroup,fullweeksplithours=cont.weekhours/7 - returning id into cid_staffworkplan; - else - insert into portanova.staffworkplan (id_staff,daydate,id_reportperiod,contracthours,id_staffgrou) values ( pid_staff , cdate , pid_period,cont.weekhours/cont.weekdays,cont.id_staffgroup,fullweeksplithours) - on conflict on constraint uniq_staffworplan_staffday do update set id_reportperiod = pid_period,contracthours=cont.weekhours/cont.weekdays,id_staffgroup=cont.id_staffgroup,fullweeksplithours=cont.weekhours/7 - returning id into cid_staffworkplan; - end if; - end if; - perform portanova.update_staffworkplan_sums(cid_staffworkplan); - cdate = cdate + interval '1 day'; - end loop; - - end loop; - perform portanova.verify_staffworplan_with_contractdates(pid_period,pid_staff); - --perform portanova.update_staffweekplan(pid_period,pid_staff); - --perform portanova.set_staffperiod_data(pid_period,pid_staff); - return true; -end; + AS $$ +declare + cont record; + prd record; + cdl record; + cdate date; + edate date; + wday text; + wdayplan record; + cid_staffworkplan text; +begin + select * into prd from portanova.reportperiod where id= pid_period; + for cont in select * from portanova.staffcontract where id_staff= pid_staff and (enddate >= prd.startdate or (enddate is null and startdate <= prd.enddate)) /*order by startdate,enddate nulls last*/ + loop + if cont.enddate is null then + cont.enddate := prd.enddate; + end if; + cdate := cont.startdate; + while cdate <= cont.enddate loop + if cdate between prd.startdate and prd.enddate then + if (cont.id_workplan is not null) then + wday := substr(to_char(cdate,'day'),1,3); + execute 'select ' || wday || '_timestart1 as ts1,' || wday || '_timeend1 as te1,' || wday || '_timestart2 as ts2,' || wday ||'_timeend2 as te2,'|| wday ||'_timepause as tp from portanova.workplans where id=' || cont.id_workplan || ';' into wdayplan; + insert into portanova.staffworkplan (id_staff,daydate,id_reportperiod,timestart1,timeend1,timestart2,timeend2,timepause,contracthours,id_staffgroup,fullweeksplithours) + values (pid_staff,cdate,pid_period,wdayplan.ts1,wdayplan.te1,wdayplan.ts2,wdayplan.te2,wdayplan.tp,cont.weekhours/cont.weekdays,cont.id_staffgroup,cont.weekhours/7) + on conflict on constraint uniq_staffworplan_staffday do update set id_reportperiod = pid_period,contracthours=cont.weekhours/cont.weekdays,id_staffgroup=cont.id_staffgroup,fullweeksplithours=cont.weekhours/7 + returning id into cid_staffworkplan; + else + insert into portanova.staffworkplan (id_staff,daydate,id_reportperiod,contracthours,id_staffgrou) values ( pid_staff , cdate , pid_period,cont.weekhours/cont.weekdays,cont.id_staffgroup,fullweeksplithours) + on conflict on constraint uniq_staffworplan_staffday do update set id_reportperiod = pid_period,contracthours=cont.weekhours/cont.weekdays,id_staffgroup=cont.id_staffgroup,fullweeksplithours=cont.weekhours/7 + returning id into cid_staffworkplan; + end if; + end if; + perform portanova.update_staffworkplan_sums(cid_staffworkplan); + cdate = cdate + interval '1 day'; + end loop; + + end loop; + perform portanova.verify_staffworplan_with_contractdates(pid_period,pid_staff); + --perform portanova.update_staffweekplan(pid_period,pid_staff); + --perform portanova.set_staffperiod_data(pid_period,pid_staff); + return true; +end; $$; @@ -520,36 +520,36 @@ $$; CREATE FUNCTION portanova.verify_perioddays(pid_period text, pid_staff text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - rpstart date; - rpend date; - wkpd record; - qlnotin text := ''; - sqlcheck text := ''; -begin - select startdate,enddate into rpstart,rpend from portanova.reportperiod where id=pid_period; - for wkpd in select id_staff,case when startdate <= rpstart then rpstart else startdate end as startdate,case when enddate is null then rpend else enddate end as enddate from portanova.staffcontract where id_staff=pid_staff and startdate <= rpend and (enddate is null or enddate >= rpstart) - loop - --raise notice '%: % => % ',wkpd.id_staff,wkpd.startdate,wkpd.enddate; - qlnotin := qlnotin || ' and daydate not between date(''' || wkpd.startdate || ''') AND date(''' || wkpd.enddate || ''')'; - --raise notice 'xx: %',qlnotin; - end loop; - sqlcheck := 'delete from portanova.staffreportperioddays where id in (select id from portanova.staffreportperioddays where id_staff=''' || pid_staff || ''' and id_reportperiod=''' || pid_period || ''' ' || qlnotin || ');'; - --raise notice 'SQL: %',sqlcheck; - execute sqlcheck; - /*update portanova.staffworkplan - set contracthours=(select weekhours2/weekdays as contracthours - from portanova.staffcontract where id_staff=pid_staff - and ((portanova.staffworkplan.daydate between startdate and enddate) or - (startdate <= portanova.staffworkplan.daydate and enddate is null))), - id_staffgroup=(select id_staffgroup - from portanova.staffcontract where id_staff=pid_staff - and ((portanova.staffworkplan.daydate between startdate and enddate) or - (startdate <= portanova.staffworkplan.daydate and enddate is null))) - where id_staff=pid_staff and id_reportperiod=pid_period; */ - return true; -end; + AS $$ +declare + rpstart date; + rpend date; + wkpd record; + qlnotin text := ''; + sqlcheck text := ''; +begin + select startdate,enddate into rpstart,rpend from portanova.reportperiod where id=pid_period; + for wkpd in select id_staff,case when startdate <= rpstart then rpstart else startdate end as startdate,case when enddate is null then rpend else enddate end as enddate from portanova.staffcontract where id_staff=pid_staff and startdate <= rpend and (enddate is null or enddate >= rpstart) + loop + --raise notice '%: % => % ',wkpd.id_staff,wkpd.startdate,wkpd.enddate; + qlnotin := qlnotin || ' and daydate not between date(''' || wkpd.startdate || ''') AND date(''' || wkpd.enddate || ''')'; + --raise notice 'xx: %',qlnotin; + end loop; + sqlcheck := 'delete from portanova.staffreportperioddays where id in (select id from portanova.staffreportperioddays where id_staff=''' || pid_staff || ''' and id_reportperiod=''' || pid_period || ''' ' || qlnotin || ');'; + --raise notice 'SQL: %',sqlcheck; + execute sqlcheck; + /*update portanova.staffworkplan + set contracthours=(select weekhours2/weekdays as contracthours + from portanova.staffcontract where id_staff=pid_staff + and ((portanova.staffworkplan.daydate between startdate and enddate) or + (startdate <= portanova.staffworkplan.daydate and enddate is null))), + id_staffgroup=(select id_staffgroup + from portanova.staffcontract where id_staff=pid_staff + and ((portanova.staffworkplan.daydate between startdate and enddate) or + (startdate <= portanova.staffworkplan.daydate and enddate is null))) + where id_staff=pid_staff and id_reportperiod=pid_period; */ + return true; +end; $$; @@ -559,20 +559,20 @@ $$; CREATE FUNCTION portanova.zzold_onchange_reportperiod(pid_period text) RETURNS boolean LANGUAGE plpgsql - AS $$ -declare - prdstart date; - prdend date; - strec record; -begin - select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period; - for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff - loop - raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate; - perform portanova.update_staffworkplan(pid_period,strec.id_staff); - end loop; - return true; -end; + AS $$ +declare + prdstart date; + prdend date; + strec record; +begin + select startdate,enddate into prdstart,prdend from portanova.reportperiod where id=pid_period; + for strec in select id_staff,startdate,enddate from portanova.staffcontract where startdate <= prdend and (enddate is null or enddate >= prdstart) group by id_staff + loop + raise notice 'Start Update period % staffworkplan for % from % to %',pid_period,strec.id_staff,strec.startdate,strec.enddate; + perform portanova.update_staffworkplan(pid_period,strec.id_staff); + end loop; + return true; +end; $$; @@ -582,24 +582,24 @@ $$; CREATE FUNCTION portanova.zzold_set_staffperiod(pid_period text) RETURNS boolean LANGUAGE plpgsql - AS $$ - declare - periodstart date; - periodend date; - staffrec record; - staffreportid int4; - BEGIN - select startdate,enddate into periodstart,periodend from portanova.reportperiod where id= pid_period; - for staffrec in select id_staff from portanova.staffcontract where (enddate >= periodstart or (enddate is null and startdate <= periodend)) group by id_staff - loop - insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,staffrec.id_staff) - on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid; - raise notice 'staffreport ID: %',staffreportid; - perform portanova.set_staffperioddays(pid_period,staffrec.id_staff); - perform portanova.set_staffperiodweeks(pid_period,staffrec.id_staff); - end loop; - return true; - END; + AS $$ + declare + periodstart date; + periodend date; + staffrec record; + staffreportid int4; + BEGIN + select startdate,enddate into periodstart,periodend from portanova.reportperiod where id= pid_period; + for staffrec in select id_staff from portanova.staffcontract where (enddate >= periodstart or (enddate is null and startdate <= periodend)) group by id_staff + loop + insert into portanova.staffreportperiod (id_reportperiod,id_staff) values (pid_period,staffrec.id_staff) + on conflict on constraint uniq_staffreportperiod_cal do nothing returning id into staffreportid; + raise notice 'staffreport ID: %',staffreportid; + perform portanova.set_staffperioddays(pid_period,staffrec.id_staff); + perform portanova.set_staffperiodweeks(pid_period,staffrec.id_staff); + end loop; + return true; + END; $$; diff --git a/install/windows/pot_setup_new.iss b/install/windows/pot_setup_new.iss index 9bc1e5e4..51a62934 100644 --- a/install/windows/pot_setup_new.iss +++ b/install/windows/pot_setup_new.iss @@ -1,53 +1,53 @@ -; Script generated by the Inno Setup Script Wizard. -; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! - -#define MyAppName "POT - Plan d'Organisation du Travail" -#define MyAppVersion "0.8" -#define MyAppPublisher "DKS s.à r.l." -#define MyAppURL "http://pot.dks.lu/" -#define MyAppExeName "pot.exe" - -[Setup] -; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. -; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) -AppId={{C583A11C-7811-4C73-B26C-1D61A6F5B679} -AppName={#MyAppName} -AppVersion={#MyAppVersion} -;AppVerName={#MyAppName} {#MyAppVersion} -AppPublisher={#MyAppPublisher} -AppPublisherURL={#MyAppURL} -AppSupportURL={#MyAppURL} -AppUpdatesURL={#MyAppURL} -DefaultDirName={autopf}\POT -DisableProgramGroupPage=yes -DisableDirPage=yes -CloseApplications=force -CloseApplicationsFilter=pot.exe -LicenseFile=C:\Users\kilian\Workspace\pot_lu\install\license.txt -; Uncomment the following line to run in non administrative install mode (install for current user only.) -PrivilegesRequired=lowest -;PrivilegesRequiredOverridesAllowed=dialog -OutputDir=C:\Users\kilian\Workspace\pot_lu\install\setups -OutputBaseFilename=mysetup -SetupIconFile=C:\Users\kilian\Workspace\pot_lu\install\windows\icons\Install-Icon.ico -Compression=lzma -SolidCompression=yes -WizardStyle=modern -WizardSmallImageFile=wizpotsmall.bmp -[Languages] -Name: "english"; MessagesFile: "compiler:Default.isl" -Name: "french"; MessagesFile: "compiler:Languages\French.isl" -Name: "german"; MessagesFile: "compiler:Languages\German.isl" - -[Files] -Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\pot.exe"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion -Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\*"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion recursesubdirs createallsubdirs -; NOTE: Don't use "Flags: ignoreversion" on any shared system files - -[Icons] -Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" - -[Run] -Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent - +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "POT - Plan d'Organisation du Travail" +#define MyAppVersion "0.8" +#define MyAppPublisher "DKS s.à r.l." +#define MyAppURL "http://pot.dks.lu/" +#define MyAppExeName "pot.exe" + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{C583A11C-7811-4C73-B26C-1D61A6F5B679} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\POT +DisableProgramGroupPage=yes +DisableDirPage=yes +CloseApplications=force +CloseApplicationsFilter=pot.exe +LicenseFile=C:\Users\kilian\Workspace\pot_lu\install\license.txt +; Uncomment the following line to run in non administrative install mode (install for current user only.) +PrivilegesRequired=lowest +;PrivilegesRequiredOverridesAllowed=dialog +OutputDir=C:\Users\kilian\Workspace\pot_lu\install\setups +OutputBaseFilename=mysetup +SetupIconFile=C:\Users\kilian\Workspace\pot_lu\install\windows\icons\Install-Icon.ico +Compression=lzma +SolidCompression=yes +WizardStyle=modern +WizardSmallImageFile=wizpotsmall.bmp +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "french"; MessagesFile: "compiler:Languages\French.isl" +Name: "german"; MessagesFile: "compiler:Languages\German.isl" + +[Files] +Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\pot.exe"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion +Source: "C:\Users\kilian\Workspace\pot_lu\desktopapp\release-builds\pot-win32-ia32\*"; DestDir: "{app}"; Flags: overwritereadonly ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + diff --git a/webapp/app.cgi b/webapp/app.cgi index d6379abd..a42bddcb 100644 --- a/webapp/app.cgi +++ b/webapp/app.cgi @@ -43,10 +43,6 @@ if (($cgi->request_method() eq "GET") || ($cgi->request_method() eq "POST")){ if (exists($p->{fn})){ my $db = dksdb->new(); - - - - if($p->{fn} eq "savepassword"){ if ((length($p->{pwd}) > 7) && ($p->{pwd} =~ /\d/) && ($p->{pwd} =~ /[a-z]/) && ($p->{pwd} =~ /[A-Z]/) ){ $se->savepassword($sess->{id},$p->{pwd}); diff --git a/webapp/data/output/pot/periode_20191230-20200223_pot_period.pdf b/webapp/data/output/pot/periode_20191230-20200223_pot_period.pdf deleted file mode 100644 index f795af75..00000000 Binary files a/webapp/data/output/pot/periode_20191230-20200223_pot_period.pdf and /dev/null differ diff --git a/webapp/data/output/pot/periode_20200224-20200419_pot_period.pdf b/webapp/data/output/pot/periode_20200224-20200419_pot_period.pdf deleted file mode 100644 index 629ee018..00000000 Binary files a/webapp/data/output/pot/periode_20200224-20200419_pot_period.pdf and /dev/null differ diff --git a/webapp/data/output/pot/periode_20200420-20200614_pot_period.pdf b/webapp/data/output/pot/periode_20200420-20200614_pot_period.pdf deleted file mode 100644 index d5e695db..00000000 Binary files a/webapp/data/output/pot/periode_20200420-20200614_pot_period.pdf and /dev/null differ diff --git a/webapp/data/output/pot/periode_20200615-20200809_pot_period.pdf b/webapp/data/output/pot/periode_20200615-20200809_pot_period.pdf deleted file mode 100644 index 1e852a17..00000000 Binary files a/webapp/data/output/pot/periode_20200615-20200809_pot_period.pdf and /dev/null differ diff --git a/webapp/data/reports/pot/pot_staffmember_period.tt b/webapp/data/reports/pot/pot_staffmember_period.tt index 1bc144b3..e63b8be6 100644 --- a/webapp/data/reports/pot/pot_staffmember_period.tt +++ b/webapp/data/reports/pot/pot_staffmember_period.tt @@ -7,8 +7,8 @@ POT - Staffmember - Period