QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: SELECT * FROM public.companies WHERE schemata='demo' and isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM public.companies WHERE schemata='demo' and isdeleted IS NULL;
QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
+ FROM kajiwara.workplans wp
ORDER BY wp.isdefault, wp.workplan;
+QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM kajiwara.reportperiod rp ORDER BY startdate, enddate;
+QUERYARRAY: SELECT id,vacancyname,color
+ FROM kajiwara.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM public.companies WHERE schemata='demo' and isdeleted IS NULL;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='10:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zo!= - (start1 - end1)::time without time zo!= else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zo!= - (start2 - end2)::time without time zo!= else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zo!=)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='10:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zo!= - (start1 - end1)::time without time zo!= else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zo!= - (start2 - end2)::time without time zo!= else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zo!=)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='10:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zo!= - (start1 - end1)::time without time zo!= else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zo!= - (start2 - end2)::time without time zo!= else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zo!=)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: SELECT * FROM public.companies WHERE schemata='demo' and isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT * FROM demo.workplandays where id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='11:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zonene!= - (start1 - end1)::time without time zone else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zone - (start2 - end2)::time without time zone else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zone)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='11:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zonene!= - (start1 - end1)::time without time zone else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zone - (start2 - end2)::time without time zone else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zone)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='11:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zonene!= - (start1 - end1)::time without time zone else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zone - (start2 - end2)::time without time zone else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zone)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='', weekdays=, freeweekdayslist='' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.workplandays SET start1='11:00', end1='16:30', start2=null, end2=null, pause='00:30', pausestart1='11:00', pauseend1='11:30', pausestart2=null, pauseend2=null WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e';
-QUERY: select id_workplan from demo.workplandays WHERE id='27fd3b0c-cad8-0f72-d172-489756ac836e'
-QUERY: select payedpauses from public.companies where schemata='demo'
-QUERY: select '["' || string_agg(case when start1 is null and start2 is null then weekday::text else null end,'","') || '"]' as freedays, sum (case when start1 is not null or start2 is not null then 1 else 0 end) as weekdays, sum( coalesce(case when start1 > end1 then '24:00:00'::time without time zone - (start1 - end1)::time without time zone else end1 - start1 end, '00:00:00'::interval) + coalesce(case when start2 > end2 and start1 is not null then '24:00:00'::time without time zone - (start2 - end2)::time without time zone else end2 - start2 end, '00:00:00'::interval) - coalesce(pause, '00:00:00'::time without time zone)) as weekhours from demo.workplandays where id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb' group by id_workplan;
-EXEC: UPDATE demo.workplans SET weekhours='38:00:00', weekdays=6, freeweekdayslist='["7"]' WHERE id='ec796603-0d87-8457-b92d-1a792e5f5acb'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wpd.workplan,
- to_char(wpd.weekhours, 'HH24:MI') AS weekhours,
- wpd.id,wpd.id_workplan,wpd.weekday,NULL AS staffcount, wpd.weeknum,
- to_char(wpd.start1::interval, 'HH24:MI') AS start1,
- to_char(wpd.end1::interval, 'HH24:MI') AS end1,
- to_char(wpd.start2::interval, 'HH24:MI') AS start2,
- to_char(wpd.end2::interval, 'HH24:MI') AS end2,
- to_char(wpd.pause::interval, 'HH24:MI') AS pause,
- to_char(wpd.interruption::interval, 'HH24:MI')AS interruption,
- to_char(wpd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(wpd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(wpd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(wpd.pauseend2::interval, 'HH24:MI') AS pauseend2,to_char( dt1+dt2-pdt1-pdt2, 'HH24:MI') AS dayhours, COALESCE((to_char(wpd.pausestart1::interval, 'HH24:MI') || '-') || to_char(wpd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.pausestart1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(wpd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(wpd.start1::interval, 'HH24:MI') || '-') || to_char(wpd.end1::interval, 'HH24:MI'), '') || COALESCE(((
- CASE WHEN wpd.start1 IS NOT NULL THEN '<br/>' ELSE ''
- END || to_char(wpd.start2::interval, 'HH24:MI')) || '-') || to_char(wpd.end2::interval, 'HH24:MI'), '') AS dspworkdata
- from
- ( select wpd1.*,wp1.weekhours,wp1.workplan,
- case when wpd1.start1 is not null and wpd1.end1 is not null then case when wpd1.end1 < wpd1.start1 then '24:00:00'::interval + wpd1.end1::interval -wpd1.start1::interval else wpd1.end1::interval - wpd1.start1::interval end else '00:00:00'::interval end as dt1,
- case when wpd1.start2 is not null and wpd1.end2 is not null then case when wpd1.end2 < wpd1.start2 then '24:00:00'::interval + wpd1.end2::interval - wpd1.start2::interval else wpd1.end2::interval - wpd1.start2::interval end else '00:00:00'::interval end as dt2,
- case when wpd1.pausestart1 is not null and wpd1.pauseend1 is not null then case when wpd1.pauseend1 < wpd1.pausestart1 then '24:00:00'::interval + wpd1.pauseend1::interval - wpd1.pausestart1::interval else wpd1.pauseend1::interval - wpd1.pausestart1::interval end else '00:00:00'::interval end as pdt1,
- case when wpd1.pausestart2 is not null and wpd1.pauseend2 is not null then case when wpd1.pauseend2 < wpd1.pausestart2 then '24:00:00'::interval + wpd1.pauseend2::interval -wpd1. pausestart2::interval else wpd1.pauseend2::interval - wpd1.pausestart2::interval end else '00:00:00'::interval end as pdt2,
- case when wpd1.start2 is not null and wpd1.end1 is not null and wpd1.start1 is not null and wpd1.end2 is not null then wpd1.start2::interval - wpd1.end1::interval else null end as interruption
- FROM demo.workplandays wpd1 LEFT JOIN demo.workplans wp1 ON wpd1.id_workplan = wp1.id
- where wpd1.id_workplan='ec796603-0d87-8457-b92d-1a792e5f5acb') wpd
- ORDER BY wpd.workplan, wpd.weekday;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-ame,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='412e4b03-bf23-c30a-9cf4-0a6d7f72b457'
-EXEC: update public.sessions set sessiondata='{"schemata":"demo15"}' where id='412e4b03-bf23-c30a-9cf4-0a6d7f72b457'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo15';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='412e4b03-bf23-c30a-9cf4-0a6d7f72b457'
-EXEC: update public.sessions set sessiondata='{"schemata":"lousdiner"}' where id='412e4b03-bf23-c30a-9cf4-0a6d7f72b457'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-ame,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-03') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-03') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-03')) and date(date_trunc('week',date('2021-11-03')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-27') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-27') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-27')) and date(date_trunc('week',date('2021-10-27')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-20') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-20') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-20')) and date(date_trunc('week',date('2021-10-20')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-13') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-13')) and date(date_trunc('week',date('2021-10-13')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-06') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-06')) and date(date_trunc('week',date('2021-10-06')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-13') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-13')) and date(date_trunc('week',date('2021-10-13')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-06') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-06')) and date(date_trunc('week',date('2021-10-06')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-29') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-29') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-29')) and date(date_trunc('week',date('2021-09-29')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-22') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-22') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-22')) and date(date_trunc('week',date('2021-09-22')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-15') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-15') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-15')) and date(date_trunc('week',date('2021-09-15')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-08') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-08') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-08')) and date(date_trunc('week',date('2021-09-08')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-01') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-01') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-01')) and date(date_trunc('week',date('2021-09-01')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-18') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-18')) and date(date_trunc('week',date('2021-08-18')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-11') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-11')) and date(date_trunc('week',date('2021-08-11')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-18') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-18')) and date(date_trunc('week',date('2021-08-18')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-01') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-01') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-01')) and date(date_trunc('week',date('2021-09-01')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-01') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-01') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-01')) and date(date_trunc('week',date('2021-09-01')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select timetrackertype,sector from public.companies where schemata='lousdiner';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-03') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-03') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-03')) and date(date_trunc('week',date('2021-11-03')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-27') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-27') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-27')) and date(date_trunc('week',date('2021-10-27')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-20') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-20') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-20')) and date(date_trunc('week',date('2021-10-20')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-13') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-13')) and date(date_trunc('week',date('2021-10-13')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-06') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-06')) and date(date_trunc('week',date('2021-10-06')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-29') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-29') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-29')) and date(date_trunc('week',date('2021-09-29')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-22') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-22') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-22')) and date(date_trunc('week',date('2021-09-22')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-15') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-15') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-15')) and date(date_trunc('week',date('2021-09-15')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-08') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-08') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-08')) and date(date_trunc('week',date('2021-09-08')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-09-01') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-09-01') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-09-01')) and date(date_trunc('week',date('2021-09-01')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-18') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-18')) and date(date_trunc('week',date('2021-08-18')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '412e4b03-bf23-c30a-9cf4-0a6d7f72b457' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from lousdiner.staffcontract sc join lousdiner.staff st on (st.id=sc.id_staff) left join lousdiner.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-08-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-08-25') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from lousdiner.timetracker tt where tt.daydate between date_trunc('week',date('2021-08-25')) and date(date_trunc('week',date('2021-08-25')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '29fa1f54-cd8d-1dfa-12a6-16d2da0b5eaf' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '19494d06-38f1-5687-a8b7-5c7b65386760' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '9d68b5bf-9871-ed95-b892-5e338ea0df32' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-08-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-04-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-06-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2021-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2021-02-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2021-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month','2018-01-01') order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-EXEC: update public.sessions set sessiondata='{"schemata":"alicehartmann"}' where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-02-01')) order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-08-01')) order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-11-01')) order by spd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by spd.daydate, st.surname,st.prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2020-08-01')) order by spd.daydate, st.surname,st.prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2020-01-01')) order by spd.daydate, st.surname,st.prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-08-01')) order by spd.daydate, st.surname,st.prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-08-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM alicehartmann.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM alicehartmann.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM alicehartmann.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-ame,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-04') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-04')) and date(date_trunc('week',date('2021-11-04')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-04') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-04')) and date(date_trunc('week',date('2021-11-04')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-04') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-04')) and date(date_trunc('week',date('2021-11-04')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-04') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-04')) and date(date_trunc('week',date('2021-11-04')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-04') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-04')) and date(date_trunc('week',date('2021-11-04')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-10-28') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-10-28') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-10-28')) and date(date_trunc('week',date('2021-10-28')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from alicehartmann.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from alicehartmann.staff st
-LEFT JOIN alicehartmann.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='alicehartmann') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM alicehartmann.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM alicehartmann.staffgroups sg LEFT JOIN alicehartmann.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM alicehartmann.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM alicehartmann.staffreportperiod srp
- LEFT JOIN alicehartmann.staff st ON srp.id_staff = st.id
- LEFT JOIN alicehartmann.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN alicehartmann.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = ''
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM alicehartmann.staffreportperiod srp
- LEFT JOIN alicehartmann.staff st ON srp.id_staff = st.id
- LEFT JOIN alicehartmann.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN alicehartmann.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = ''
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM alicehartmann.staffreportperiod srp
- LEFT JOIN alicehartmann.staff st ON srp.id_staff = st.id
- LEFT JOIN alicehartmann.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN alicehartmann.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = ''
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-EXEC: update public.sessions set sessiondata='{"schemata":"dolcevita"}' where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='cd20d578-869c-693f-db20-198cca57cbe5' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cd20d578-869c-693f-db20-198cca57cbe5'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='cd20d578-869c-693f-db20-198cca57cbe5' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cd20d578-869c-693f-db20-198cca57cbe5'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-cyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='cd20d578-869c-693f-db20-198cca57cbe5' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cd20d578-869c-693f-db20-198cca57cbe5'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-ours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='cd20d578-869c-693f-db20-198cca57cbe5' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='cd20d578-869c-693f-db20-198cca57cbe5' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cd20d578-869c-693f-db20-198cca57cbe5'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
- ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='a8b680ac-2c28-318c-7db4-f81ec058b925'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-07-01') and date('2021-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-07-01') and date('2021-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-06-28') and date('2021-09-05')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-06-28') then startdate else date('2021-06-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-09-05') then date('2021-09-05')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-09-05')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-06-28') and date('2021-09-05')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-07-01') and date('2021-08-31') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-06-28') and date('2021-09-05') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-06-28') and date('2021-09-05')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id='dbf0835b-63e2-e6d8-8d0b-d7211d4e954f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by startdate,enddate;
-cyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='29488caf-66ac-84e6-ab9b-1aebadd8bcf2') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='29488caf-66ac-84e6-ab9b-1aebadd8bcf2' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='50e446df-14ca-87b6-f443-2cd70b33e069' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '50e446df-14ca-87b6-f443-2cd70b33e069'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='50e446df-14ca-87b6-f443-2cd70b33e069' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='a32da709-0202-71c4-43c9-bc89fdf5aaba' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='a32da709-0202-71c4-43c9-bc89fdf5aaba' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a32da709-0202-71c4-43c9-bc89fdf5aaba'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-29') between startdate and enddate) or (startdate <= date('2021-04-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-28') between startdate and enddate) or (startdate <= date('2021-04-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-27') between startdate and enddate) or (startdate <= date('2021-04-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-27') between startdate and enddate) or (startdate <= date('2021-04-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-27') between startdate and enddate) or (startdate <= date('2021-04-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-28') between startdate and enddate) or (startdate <= date('2021-04-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-04-28') between startdate and enddate) or (startdate <= date('2021-04-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='8ad632ef-aa14-468d-ede6-283cb9c1ce24') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate < date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate > date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and ((date('2021-04-28') between startdate and enddate) or (startdate <= date('2021-04-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='8ad632ef-aa14-468d-ede6-283cb9c1ce24') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate < date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate > date('2021-04-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and ((date('2021-04-28') between startdate and enddate) or (startdate <= date('2021-04-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM dolcevita.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='8ad632ef-aa14-468d-ede6-283cb9c1ce24') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate < date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate > date('2021-04-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and ((date('2021-04-27') between startdate and enddate) or (startdate <= date('2021-04-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-04-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-04-27') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-04-27') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-04-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-04-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate < date('2021-05-01') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate > date('2021-05-01') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and ((date('2021-05-01') between startdate and enddate) or (startdate <= date('2021-05-01') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-05-01') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-05-01') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-05-01') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-05-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-05-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate < date('2021-05-06') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '8ad632ef-aa14-468d-ede6-283cb9c1ce24' and daydate > date('2021-05-06') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' and ((date('2021-05-06') between startdate and enddate) or (startdate <= date('2021-05-06') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2021-05-27' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-05-06') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-05-06') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-05-06') and id_staff='8ad632ef-aa14-468d-ede6-283cb9c1ce24' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-05-06') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '8ad632ef-aa14-468d-ede6-283cb9c1ce24' as id_staff,date('2021-05-06') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='e5c70de3-366c-4b2a-1af0-aed175cf37c0' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e5c70de3-366c-4b2a-1af0-aed175cf37c0' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e5c70de3-366c-4b2a-1af0-aed175cf37c0'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='978b4987-67ba-f071-0601-e5704bffc5cb'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-09-01') and date('2021-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-09-01') and date('2021-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '10d324ef-e2da-a461-5b3b-ae0705d8d301' and daydate between date('2021-08-30') and date('2021-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-08-30') then startdate else date('2021-08-30') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-10-31') then date('2021-10-31')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301'
- and startdate < date('2021-10-31')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' and lpd.daydate between date('2021-08-30') and date('2021-10-31')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-09-01') and date('2021-10-31') and id_staff ='10d324ef-e2da-a461-5b3b-ae0705d8d301') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' and daydate between date('2021-08-30') and date('2021-10-31') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-08-30') and date('2021-10-31')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='eb5819bb-6268-3485-1845-2c1806f71b5c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eb5819bb-6268-3485-1845-2c1806f71b5c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eb5819bb-6268-3485-1845-2c1806f71b5c' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '10d324ef-e2da-a461-5b3b-ae0705d8d301'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='978b4987-67ba-f071-0601-e5704bffc5cb'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-09-01') and date('2021-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-09-01') and date('2021-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '10d324ef-e2da-a461-5b3b-ae0705d8d301' and daydate between date('2021-08-30') and date('2021-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-08-30') then startdate else date('2021-08-30') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-10-31') then date('2021-10-31')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301'
- and startdate < date('2021-10-31')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' and lpd.daydate between date('2021-08-30') and date('2021-10-31')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-09-01') and date('2021-10-31') and id_staff ='10d324ef-e2da-a461-5b3b-ae0705d8d301') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='10d324ef-e2da-a461-5b3b-ae0705d8d301' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='10d324ef-e2da-a461-5b3b-ae0705d8d301' and daydate between date('2021-08-30') and date('2021-10-31') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-08-30') and date('2021-10-31')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '813c99cd-fe76-c8ef-4352-65fda02ddb7f' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='813c99cd-fe76-c8ef-4352-65fda02ddb7f') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='813c99cd-fe76-c8ef-4352-65fda02ddb7f' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='053e9c88-651b-ff30-87f9-cffcd927990d'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-05-01') and date('2021-06-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-04-26') then startdate else date('2021-04-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-07-04') then date('2021-07-04')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-07-04')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-04-26') and date('2021-07-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-05-01') and date('2021-06-30') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-04-26') and date('2021-07-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-04-26') and date('2021-07-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM dolcevita.staffgroups sg LEFT JOIN dolcevita.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM dolcevita.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select id,trackername from dolcevita.timetrackerconfig order by trackername
-is null or isworktime=false order by vacancyname;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from dolcevita.staff st
-LEFT JOIN dolcevita.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='dolcevita') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from dolcevita.staff where id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from dolcevita.staffvacancyyear where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from dolcevita.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM dolcevita.staffreportperiod srp
- LEFT JOIN dolcevita.staff st ON srp.id_staff = st.id
- LEFT JOIN dolcevita.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN dolcevita.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '440afd12-38a6-8b64-b68a-77b88ecf5c75'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from dolcevita.reportperiod where id='a8b680ac-2c28-318c-7db4-f81ec058b925'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-07-01') and date('2021-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-07-01') and date('2021-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from dolcevita.staffreportperioddays
- where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-06-28') and date('2021-09-05')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2021-06-28') then startdate else date('2021-06-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-09-05') then date('2021-09-05')
- else enddate end as staffperiodend from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75'
- and startdate < date('2021-09-05')
- ) sc
- join dolcevita.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from dolcevita.staffreportperioddays lpd
- left join dolcevita.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from dolcevita.worktimes where isdefault=true) wkdef
- where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and lpd.daydate between date('2021-06-28') and date('2021-09-05')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from dolcevita.timetracker
-where daydate between date('2021-07-01') and date('2021-08-31') and id_staff ='440afd12-38a6-8b64-b68a-77b88ecf5c75') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM dolcevita.staffreportperioddays pd
- JOIN dolcevita.staff st ON pd.id_staff = st.id and st.id='440afd12-38a6-8b64-b68a-77b88ecf5c75' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM dolcevita.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join dolcevita.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from dolcevita.worktimes where isdefault =true) wkstd
- left join dolcevita.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from dolcevita.timetracker where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate between date('2021-06-28') and date('2021-09-05') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2021-06-28') and date('2021-09-05')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-08-03') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-08-03') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-08-03') between startdate and enddate) or (startdate <= date('2021-08-03') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2021-08-01' as datebefore,
- '15:30' as timebefore,
- '2021-08-05' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-08-03') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-08-03') and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-08-03') and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate < date('2021-08-04') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from dolcevita.staffreportperioddays where id_staff= '440afd12-38a6-8b64-b68a-77b88ecf5c75' and daydate > date('2021-08-04') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from dolcevita.staffcontract where id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' and ((date('2021-08-04') between startdate and enddate) or (startdate <= date('2021-08-04') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2021-08-03' as datebefore,
- '22:30' as timebefore,
- '2021-08-05' as dateafter,
- '10:00' as timeafter
- from dolcevita.worktimes wk where (date('2021-08-04') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-08-04') and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from dolcevita.timetracker where daydate=date('2021-08-04') and id_staff='440afd12-38a6-8b64-b68a-77b88ecf5c75' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '440afd12-38a6-8b64-b68a-77b88ecf5c75' as id_staff,date('2021-08-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '440afd12-38a6-8b64-b68a-77b88ecf5c75' as id_staff,date('2021-08-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='dolcevita';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-EXEC: update public.sessions set sessiondata='{"schemata":"demo50"}' where id='6de82864-4076-8bf7-8f7d-bc99a6d6e4d6'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo50.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo50.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo50.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='6332f4fa-2b55-e230-4015-095bf5ed1c13') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='6332f4fa-2b55-e230-4015-095bf5ed1c13' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate < date('2020-09-02') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate > date('2020-09-02') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and ((date('2020-09-02') between startdate and enddate) or (startdate <= date('2020-09-02') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-01' as datebefore,
- '22:00' as timebefore,
- '2020-09-03' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-02') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-02') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-02') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-02') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='1cc69be6-e91f-745f-54ab-24e80427a006';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('68e26cb2-0736-70fd-b95e-96ff8d59e607',date('2020-09-02'),'6332f4fa-2b55-e230-4015-095bf5ed1c13','2020-09-02 00:00:00'::timestamp,'2020-09-02 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-02 00:00:00'::timestamp,stamp_out='2020-09-02 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate=date('2020-09-02') and id not in ('68e26cb2-0736-70fd-b95e-96ff8d59e607');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='6332f4fa-2b55-e230-4015-095bf5ed1c13') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,5+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-09-30')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,5+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-09-30')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='6332f4fa-2b55-e230-4015-095bf5ed1c13' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days')
- --where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-09-01') and date('2020-09-30')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=1,last44date=date('2020-09-28'),avgtotalweekhours='40:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and pd.daydate between date('2020-09-01') and date('2020-09-30')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '6332f4fa-2b55-e230-4015-095bf5ed1c13'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate < date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate > date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and ((date('2020-09-04') between startdate and enddate) or (startdate <= date('2020-09-04') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-03' as datebefore,
- '22:00' as timebefore,
- '2020-09-05' as dateafter,
- '19:30' as timeafter
- from demo50.worktimes wk where (date('2020-09-04') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-04') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-04') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate < date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate > date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and ((date('2020-09-04') between startdate and enddate) or (startdate <= date('2020-09-04') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-03' as datebefore,
- '22:00' as timebefore,
- '2020-09-05' as dateafter,
- '19:30' as timeafter
- from demo50.worktimes wk where (date('2020-09-04') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-04') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-04') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='491ecfe0-f29b-28aa-8940-7188eef1c2e7';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('235cfac3-fec9-01ce-934e-a8d33e9ad56c',date('2020-09-04'),'6332f4fa-2b55-e230-4015-095bf5ed1c13','2020-09-04 00:00:00'::timestamp,'2020-09-04 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-04 00:00:00'::timestamp,stamp_out='2020-09-04 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate=date('2020-09-04') and id not in ('235cfac3-fec9-01ce-934e-a8d33e9ad56c');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='6332f4fa-2b55-e230-4015-095bf5ed1c13') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,5+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-09-30')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by daydate
-) xsunday) sunresult;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='6332f4fa-2b55-e230-4015-095bf5ed1c13' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,5+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-09-30')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days')
- --where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate between date('2020-09-01') and date('2020-09-30')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=1,last44date=date('2020-09-28'),avgtotalweekhours='40:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and pd.daydate between date('2020-09-01') and date('2020-09-30')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '6332f4fa-2b55-e230-4015-095bf5ed1c13'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate < date('2020-09-11') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate > date('2020-09-11') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and ((date('2020-09-11') between startdate and enddate) or (startdate <= date('2020-09-11') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-10' as datebefore,
- '22:00' as timebefore,
- '2020-09-12' as dateafter,
- '19:30' as timeafter
- from demo50.worktimes wk where (date('2020-09-11') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-11') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-11') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-11') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-11') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate < date('2020-09-09') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '6332f4fa-2b55-e230-4015-095bf5ed1c13' and daydate > date('2020-09-09') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' and ((date('2020-09-09') between startdate and enddate) or (startdate <= date('2020-09-09') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-08' as datebefore,
- '22:00' as timebefore,
- '2020-09-10' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-09') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-09') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-09') and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-09') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '6332f4fa-2b55-e230-4015-095bf5ed1c13' as id_staff,date('2020-09-09') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from demo50.staff st
-LEFT JOIN demo50.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='demo50') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM demo50.staffgroups sg LEFT JOIN demo50.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo50.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select id,trackername from demo50.timetrackerconfig order by trackername
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo50.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='28527822-7e9e-baa4-e825-684d015eed40' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by vacyear;
-to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate < date('2020-07-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate > date('2020-07-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and ((date('2020-07-27') between startdate and enddate) or (startdate <= date('2020-07-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2020-07-29' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-07-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-27') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-27') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate < date('2020-07-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate > date('2020-07-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and ((date('2020-07-29') between startdate and enddate) or (startdate <= date('2020-07-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-07-27' as datebefore,
- '22:00' as timebefore,
- '2020-07-30' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-07-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-29') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-29') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate < date('2020-07-27') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate > date('2020-07-27') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and ((date('2020-07-27') between startdate and enddate) or (startdate <= date('2020-07-27') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2020-07-29' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-07-27') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-27') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-27') and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' as id_staff,date('2020-07-27') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='14fee166-c4a3-f1a9-69d4-0f9b62dde45b';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('1df9757f-cfe7-32f3-942f-55b824f9b8c7',date('2020-07-27'),'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c','2020-07-27 00:00:00'::timestamp,'2020-07-27 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-07-27 00:00:00'::timestamp,stamp_out='2020-07-27 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate=date('2020-07-27') and id not in ('1df9757f-cfe7-32f3-942f-55b824f9b8c7');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERY: select * from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by rp.startdate,rp.enddate)
- sper ) prp where id='2583c916-2d07-f42d-9c85-18ee42959317';
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='4944e59f-fd58-87a1-e22f-84808be49767' and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-08-01') and date('2020-08-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-08-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and sr.daydate between date('2020-08-01') and date(date_trunc('week',date('2020-08-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days')
- --where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-08-01') and date('2020-08-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=5,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=5,last44date=date('2020-08-31'),avgtotalweekhours='40:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317')
- where pd.id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and pd.daydate between date('2020-08-01') and date('2020-08-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='28527822-7e9e-baa4-e825-684d015eed40' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='4944e59f-fd58-87a1-e22f-84808be49767'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-07-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-07-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-06-29') and date('2020-08-02')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-08-02') then date('2020-08-02')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40'
- and startdate < date('2020-08-02')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and lpd.daydate between date('2020-06-29') and date('2020-08-02')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-07-01') and date('2020-07-31') and id_staff ='28527822-7e9e-baa4-e825-684d015eed40') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='28527822-7e9e-baa4-e825-684d015eed40' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-06-29') and date('2020-08-02') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-08-02')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='eef01d53-ac8f-de1d-4073-2e7c8f3e8f9c' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='a77618bc-86f2-800f-b26d-6d641147ab7c' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c' order by daydate;
-plhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a77618bc-86f2-800f-b26d-6d641147ab7c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'a77618bc-86f2-800f-b26d-6d641147ab7c'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'a77618bc-86f2-800f-b26d-6d641147ab7c' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='a77618bc-86f2-800f-b26d-6d641147ab7c') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='a77618bc-86f2-800f-b26d-6d641147ab7c' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='a77618bc-86f2-800f-b26d-6d641147ab7c' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from demo50.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from demo50.staff st
-LEFT JOIN demo50.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='demo50') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo50.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo50.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='28527822-7e9e-baa4-e825-684d015eed40' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='28527822-7e9e-baa4-e825-684d015eed40' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by startdate,enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='28527822-7e9e-baa4-e825-684d015eed40') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='28527822-7e9e-baa4-e825-684d015eed40' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate < date('2020-07-30') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate > date('2020-07-30') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and ((date('2020-07-30') between startdate and enddate) or (startdate <= date('2020-07-30') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-07-28' as datebefore,
- '14:30' as timebefore,
- '2020-07-31' as dateafter,
- '10:30' as timeafter
- from demo50.worktimes wk where (date('2020-07-30') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-30') and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-07-30') and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '28527822-7e9e-baa4-e825-684d015eed40' as id_staff,date('2020-07-30') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, '28527822-7e9e-baa4-e825-684d015eed40' as id_staff,date('2020-07-30') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='10:30',timeend1='14:30',timestart2='18:00',timeend2='23:00',pausestart1='10:30',pauseend1='11:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='1d03fe93-ec10-143e-52bc-5df940c4906a';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('6543a9cd-12d7-2f87-20fc-91113502fedb',date('2020-07-30'),'28527822-7e9e-baa4-e825-684d015eed40','2020-07-30 00:00:00'::timestamp,'2020-07-30 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-07-30 00:00:00'::timestamp,stamp_out='2020-07-30 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate=date('2020-07-30') and id not in ('6543a9cd-12d7-2f87-20fc-91113502fedb');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERY: select * from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='28527822-7e9e-baa4-e825-684d015eed40') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by rp.startdate,rp.enddate)
- sper ) prp where id='2583c916-2d07-f42d-9c85-18ee42959317';
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='4944e59f-fd58-87a1-e22f-84808be49767' and id_staff='28527822-7e9e-baa4-e825-684d015eed40';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-08-01') and date('2020-08-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-08-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='28527822-7e9e-baa4-e825-684d015eed40' and sr.daydate between date('2020-08-01') and date(date_trunc('week',date('2020-08-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='28527822-7e9e-baa4-e825-684d015eed40' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days')
- --where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-08-01') and date('2020-08-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=5,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=1,last44date=date('2020-08-31'),avgtotalweekhours='44:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317')
- where pd.id_staff='28527822-7e9e-baa4-e825-684d015eed40' and pd.daydate between date('2020-08-01') and date('2020-08-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate < date('2020-08-06') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate > date('2020-08-06') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and ((date('2020-08-06') between startdate and enddate) or (startdate <= date('2020-08-06') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-04' as datebefore,
- '14:30' as timebefore,
- '2020-08-07' as dateafter,
- '10:30' as timeafter
- from demo50.worktimes wk where (date('2020-08-06') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-08-06') and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-08-06') and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, '28527822-7e9e-baa4-e825-684d015eed40' as id_staff,date('2020-08-06') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='10:30',timeend1='14:30',timestart2='18:00',timeend2='23:00',pausestart1='10:30',pauseend1='11:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='d4ba15fd-fcd7-552b-4c72-f0e0143caabe';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('0ecdfce6-15f3-e3c0-c928-2899fe7f6657',date('2020-08-06'),'28527822-7e9e-baa4-e825-684d015eed40','2020-08-06 00:00:00'::timestamp,'2020-08-06 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-08-06 00:00:00'::timestamp,stamp_out='2020-08-06 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate=date('2020-08-06') and id not in ('0ecdfce6-15f3-e3c0-c928-2899fe7f6657');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERY: select * from demo50.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-08-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-07-27') then startdate else date('2020-07-27') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40'
- and startdate < date('2020-09-06')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and lpd.daydate between date('2020-07-27') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-08-01') and date('2020-08-31') and id_staff ='28527822-7e9e-baa4-e825-684d015eed40') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by rp.startdate,rp.enddate)
- sper ) prp where id='2583c916-2d07-f42d-9c85-18ee42959317';
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='4944e59f-fd58-87a1-e22f-84808be49767' and id_staff='28527822-7e9e-baa4-e825-684d015eed40';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-08-01') and date('2020-08-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='28527822-7e9e-baa4-e825-684d015eed40' order by daydate
-) xsunday) sunresult;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-08-01')));
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='28527822-7e9e-baa4-e825-684d015eed40' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-07-27') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-07-27') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='28527822-7e9e-baa4-e825-684d015eed40' and sr.daydate between date('2020-08-01') and date(date_trunc('week',date('2020-08-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date(date_trunc('week',date('2020-08-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days')
- --where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-08-01') and date('2020-08-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=5,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=1,last44date=date('2020-08-31'),avgtotalweekhours='44:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317')
- where pd.id_staff='28527822-7e9e-baa4-e825-684d015eed40' and pd.daydate between date('2020-08-01') and date('2020-08-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '28527822-7e9e-baa4-e825-684d015eed40'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo50';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from demo50.staff st
-LEFT JOIN demo50.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='demo50') ttr
-where st.isdeleted is null order by groupname,surname,prename;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo50.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM demo50.staffgroups sg LEFT JOIN demo50.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo50.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: select id,trackername from demo50.timetrackerconfig order by trackername
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='6332f4fa-2b55-e230-4015-095bf5ed1c13' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '6332f4fa-2b55-e230-4015-095bf5ed1c13'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='6332f4fa-2b55-e230-4015-095bf5ed1c13' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by vacyear;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by startdate,enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo50.staff where id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by startdate,enddate;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from demo50.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by daydate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from demo50.staffvacancyyear where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by vacyear;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='af9f604b-fcf9-0161-da20-1e3d7b1e4111') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate < date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate > date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and ((date('2020-09-01') between startdate and enddate) or (startdate <= date('2020-09-01') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-31' as datebefore,
- '22:00' as timebefore,
- '2020-09-03' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-01') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-01') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='c0410bb2-72d6-9649-b10b-329cf7abe200';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('651d2805-f018-d925-7cfd-8ca324b5aec6',date('2020-09-01'),'af9f604b-fcf9-0161-da20-1e3d7b1e4111','2020-09-01 00:00:00'::timestamp,'2020-09-01 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-01 00:00:00'::timestamp,stamp_out='2020-09-01 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate=date('2020-09-01') and id not in ('651d2805-f018-d925-7cfd-8ca324b5aec6');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='af9f604b-fcf9-0161-da20-1e3d7b1e4111') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,5+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-09-30')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,5+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-09-30')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days')
- --where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-09-01') and date('2020-09-30')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=1,last44date=date('2020-09-28'),avgtotalweekhours='40:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and pd.daydate between date('2020-09-01') and date('2020-09-30')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate < date('2020-09-07') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate > date('2020-09-07') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and ((date('2020-09-07') between startdate and enddate) or (startdate <= date('2020-09-07') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-06' as datebefore,
- '22:00' as timebefore,
- '2020-09-08' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-07') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-07') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-07') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-07') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-07') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate < date('2020-09-13') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate > date('2020-09-13') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and ((date('2020-09-13') between startdate and enddate) or (startdate <= date('2020-09-13') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-12' as datebefore,
- '22:00' as timebefore,
- '2020-09-14' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-13') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-13') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-13') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-13') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-13') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo50.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause='1',timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='9e5ca7ca-4e30-e407-bd7c-cafb658c9b60';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo50.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('9876a4db-d855-5e0c-d8e7-bc5d6c855c93',date('2020-09-13'),'af9f604b-fcf9-0161-da20-1e3d7b1e4111','2020-09-13 00:00:00'::timestamp,'2020-09-13 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-13 00:00:00'::timestamp,stamp_out='2020-09-13 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo50.timetracker WHERE id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate=date('2020-09-13') and id not in ('9876a4db-d855-5e0c-d8e7-bc5d6c855c93');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo50.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-09-30') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-10-04') then date('2020-10-04')
- else enddate end as staffperiodend from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- and startdate < date('2020-10-04')
- ) sc
- join demo50.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo50.staffreportperioddays lpd
- left join demo50.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo50.worktimes where isdefault=true) wkdef
- where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and lpd.daydate between date('2020-08-31') and date('2020-10-04')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo50.timetracker
-where daydate between date('2020-09-01') and date('2020-09-30') and id_staff ='af9f604b-fcf9-0161-da20-1e3d7b1e4111') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo50.staffreportperiod srp
- join demo50.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-EXEC: update demo50.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo50.staffreportperioddays where id in (select id from demo50.staffreportperioddays where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo50.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,5+row_number() over (order by daydate) as rowx from demo50.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-09-30')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo50.staffreportperiod where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and id_reportperiod in (select id from demo50.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,5+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-09-30')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo50.staffreportperioddays pd
- JOIN demo50.staff st ON pd.id_staff = st.id and st.id='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo50.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo50.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo50.worktimes where isdefault =true) wkstd
- left join demo50.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo50.timetracker where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-08-31') and date('2020-10-04') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-10-04')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo50.staffreportperioddays
- where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-09-30')) + interval '6 days')
- --where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate between date('2020-09-01') and date('2020-09-30')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo50.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=1,last44date=date('2020-09-28'),avgtotalweekhours='40:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo50.staffreportperioddays pd
- join demo50.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and pd.daydate between date('2020-09-01') and date('2020-09-30')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo50.staffreportperiod srp
- LEFT JOIN demo50.staff st ON srp.id_staff = st.id
- LEFT JOIN demo50.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo50.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'af9f604b-fcf9-0161-da20-1e3d7b1e4111'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate < date('2020-09-15') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate > date('2020-09-15') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and ((date('2020-09-15') between startdate and enddate) or (startdate <= date('2020-09-15') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-14' as datebefore,
- '22:00' as timebefore,
- '2020-09-17' as dateafter,
- '11:00' as timeafter
- from demo50.worktimes wk where (date('2020-09-15') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-15') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-15') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-15') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-15') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate < date('2020-09-11') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo50.staffreportperioddays where id_staff= 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' and daydate > date('2020-09-11') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo50.staffcontract where id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' and ((date('2020-09-11') between startdate and enddate) or (startdate <= date('2020-09-11') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-10' as datebefore,
- '14:30' as timebefore,
- '2020-09-12' as dateafter,
- '17:30' as timeafter
- from demo50.worktimes wk where (date('2020-09-11') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '6de82864-4076-8bf7-8f7d-bc99a6d6e4d6' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-11') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo50.timetracker where daydate=date('2020-09-11') and id_staff='af9f604b-fcf9-0161-da20-1e3d7b1e4111' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-11') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'af9f604b-fcf9-0161-da20-1e3d7b1e4111' as id_staff,date('2020-09-11') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-ame,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-06-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-06-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-06-29') between startdate and enddate) or (startdate <= date('2020-06-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2020-06-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-06-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-06-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-06-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-06-30') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-06-30') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-06-30') between startdate and enddate) or (startdate <= date('2020-06-30') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-06-29' as datebefore,
- '23:00' as timebefore,
- '2020-07-01' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-06-30') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-30') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-30') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-06-30') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-06-30') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='c7263cff-a5fd-54a5-9831-73aa72ec78bd';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('1970ad9b-72f3-e4f5-bb7e-fffaba38bd24',date('2020-06-30'),'cc63023b-4892-c29c-787d-088392d58b88','2020-06-30 00:00:00'::timestamp,'2020-06-30 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-06-30 00:00:00'::timestamp,stamp_out='2020-06-30 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-06-30') and id not in ('1970ad9b-72f3-e4f5-bb7e-fffaba38bd24');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERY: select * from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-07-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-07-01') and date('2020-08-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-07-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-07-01') and date(date_trunc('week',date('2020-08-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-07-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-07-01') and date('2020-08-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2020-08-31'),avgtotalweekhours='38:27:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-07-01') and date('2020-08-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-11-09') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-11-09') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-11-09') between startdate and enddate) or (startdate <= date('2020-11-09') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-11-08' as datebefore,
- '14:30' as timebefore,
- '2020-11-10' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-11-09') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-11-09') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-11-09') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-11-09') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-11-09') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-10-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-10-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-10-28') between startdate and enddate) or (startdate <= date('2020-10-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-10-27' as datebefore,
- '22:00' as timebefore,
- '2020-10-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-10-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-10-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-10-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-10-28') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-10-28') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment='Test',vacancycomment='Test',vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='65459340-42c8-0197-d126-c53605906e10';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('cfed57ab-cc7b-7008-3804-33dd7421b3cd',date('2020-10-28'),'cc63023b-4892-c29c-787d-088392d58b88','2020-10-28 00:00:00'::timestamp,'2020-10-28 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-10-28 00:00:00'::timestamp,stamp_out='2020-10-28 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-10-28') and id not in ('cfed57ab-cc7b-7008-3804-33dd7421b3cd');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a';
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='e3e85c3e-1afa-768e-7938-f0c9996c618a';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-11-01'))) and date(date_trunc('week',date('2020-12-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='9b93bd90-2325-fe28-4bff-852203fc99ce' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,17+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-11-01') and date('2020-12-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-11-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,7+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-10-26') and date(date_trunc('week',date('2020-12-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-11-01'))) and date(date_trunc('week',date('2020-12-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-11-01') and date('2020-12-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=26,suppvacancysunwork=2,suppvacancy44hours=2,status44hcount=0,last44date=date('2020-12-28'),avgtotalweekhours='36:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-11-01') and date('2020-12-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-11-02') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-11-02') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-11-02') between startdate and enddate) or (startdate <= date('2020-11-02') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-11-01' as datebefore,
- '14:30' as timebefore,
- '2020-11-03' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-11-02') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-11-02') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-11-02') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-11-02') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='c646d640-c344-620d-60c6-330d887c3f3a';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('e1755bb2-10a3-611b-a841-500b9caa2a8c',date('2020-11-02'),'cc63023b-4892-c29c-787d-088392d58b88','2020-11-02 00:00:00'::timestamp,'2020-11-02 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-11-02 00:00:00'::timestamp,stamp_out='2020-11-02 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-11-02') and id not in ('e1755bb2-10a3-611b-a841-500b9caa2a8c');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERY: select * from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-11-01'))) and date(date_trunc('week',date('2020-12-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='9b93bd90-2325-fe28-4bff-852203fc99ce' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,17+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-11-01') and date('2020-12-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-11-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,7+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-10-26') and date(date_trunc('week',date('2020-12-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-11-01'))) and date(date_trunc('week',date('2020-12-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-11-01') and date('2020-12-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=26,suppvacancysunwork=2,suppvacancy44hours=2,status44hcount=0,last44date=date('2020-12-28'),avgtotalweekhours='36:00:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-11-01') and date('2020-12-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '4944e59f-fd58-87a1-e22f-84808be49767'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '5e7f6023-870d-990b-e2ac-9f12c1788d97'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '5e7f6023-870d-990b-e2ac-9f12c1788d97'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-ame,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-06-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-06-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-06-29') between startdate and enddate) or (startdate <= date('2020-06-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '' as datebefore,
- '' as timebefore,
- '2020-06-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-06-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-06-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-06-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours='01:00',vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='2c429e32-6367-d7e0-231b-1ab12a49ae8d';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('140ff778-d712-1c12-f48a-67fb6ed7deb3',date('2020-06-29'),'cc63023b-4892-c29c-787d-088392d58b88','2020-06-29 00:00:00'::timestamp,'2020-06-29 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-06-29 00:00:00'::timestamp,stamp_out='2020-06-29 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-06-29') and id not in ('140ff778-d712-1c12-f48a-67fb6ed7deb3');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERY: select * from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='2583c916-2d07-f42d-9c85-18ee42959317';
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-07-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-07-01') and date('2020-08-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-07-01')));
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-07-01') and date(date_trunc('week',date('2020-08-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-07-01'))) and date(date_trunc('week',date('2020-08-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-07-01') and date('2020-08-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=9,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2020-08-31'),avgtotalweekhours='38:27:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-07-01') and date('2020-08-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-08-31') between startdate and enddate) or (startdate <= date('2020-08-31') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-30' as datebefore,
- '14:30' as timebefore,
- '2020-09-01' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-08-31') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-08-31') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-08-31') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours='01:00',vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='8dde55e4-8f66-f561-24bb-06336598ea36';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef',date('2020-08-31'),'cc63023b-4892-c29c-787d-088392d58b88','2020-08-31 00:00:00'::timestamp,'2020-08-31 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-08-31 00:00:00'::timestamp,stamp_out='2020-08-31 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-08-31') and id not in ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,9+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-10-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-10-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-09-01') and date('2020-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=17,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=7,last44date=date('2020-10-26'),avgtotalweekhours='36:10:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-09-01') and date('2020-10-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-09-01') between startdate and enddate) or (startdate <= date('2020-09-01') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-31' as datebefore,
- '23:00' as timebefore,
- '2020-09-02' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-09-01') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-09-01') between startdate and enddate) or (startdate <= date('2020-09-01') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-31' as datebefore,
- '23:00' as timebefore,
- '2020-09-02' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-09-01') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-09-04') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-09-04') between startdate and enddate) or (startdate <= date('2020-09-04') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-09-02' as datebefore,
- '12:30' as timebefore,
- '2020-09-05' as dateafter,
- '17:30' as timeafter
- from demo.worktimes wk where (date('2020-09-04') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-04') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-04') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='53a8c688-a5af-4af5-4533-f229870c2705';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('3d2bd4d3-fe73-8706-b9bc-ca463288a5be',date('2020-09-04'),'cc63023b-4892-c29c-787d-088392d58b88','2020-09-04 00:00:00'::timestamp,'2020-09-04 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-04 00:00:00'::timestamp,stamp_out='2020-09-04 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-09-04') and id not in ('3d2bd4d3-fe73-8706-b9bc-ca463288a5be');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
- as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,9+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-10-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-10-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-09-01') and date('2020-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=17,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=7,last44date=date('2020-10-26'),avgtotalweekhours='36:10:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-09-01') and date('2020-10-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-09-01') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-09-01') between startdate and enddate) or (startdate <= date('2020-09-01') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-31' as datebefore,
- '23:00' as timebefore,
- '2020-09-02' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-09-01') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-09-01') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-09-01') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='37066eac-4609-2105-ebea-2bfdcefae3c3';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('caadb366-4fde-eecb-b7a8-caf421ce8bf3',date('2020-09-01'),'cc63023b-4892-c29c-787d-088392d58b88','2020-09-01 00:00:00'::timestamp,'2020-09-01 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-09-01 00:00:00'::timestamp,stamp_out='2020-09-01 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-09-01') and id not in ('caadb366-4fde-eecb-b7a8-caf421ce8bf3');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,9+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-10-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-10-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-09-01') and date('2020-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=17,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=7,last44date=date('2020-10-26'),avgtotalweekhours='36:10:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-09-01') and date('2020-10-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-12-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-12-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-12-28') between startdate and enddate) or (startdate <= date('2020-12-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-12-27' as datebefore,
- '14:30' as timebefore,
- '2020-12-29' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-12-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='15b19d2c-6c14-7948-72c3-f97f6bc29247';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('c1d5484a-15a4-4acd-0ffa-6807756915c0',date('2020-12-28'),'cc63023b-4892-c29c-787d-088392d58b88','2020-12-28 12:00:00'::timestamp,'2020-12-28 15:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-12-28 12:00:00'::timestamp,stamp_out='2020-12-28 15:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-12-28') and id not in ('c1d5484a-15a4-4acd-0ffa-6807756915c0');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERY: select * from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='e3e85c3e-1afa-768e-7938-f0c9996c618a' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,26+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2021-01-01') and date('2021-02-28')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-01-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-12-28') and date(date_trunc('week',date('2021-02-28')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2021-01-01') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=35,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2021-02-22'),avgtotalweekhours='39:33:20'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2021-01-01') and date('2021-02-28')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-urs::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-08-31') between startdate and enddate) or (startdate <= date('2020-08-31') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-30' as datebefore,
- '14:30' as timebefore,
- '2020-09-01' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-08-31') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours='01:00',vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='8dde55e4-8f66-f561-24bb-06336598ea36';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef',date('2020-08-31'),'cc63023b-4892-c29c-787d-088392d58b88','2020-08-31 00:00:00'::timestamp,'2020-08-31 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-08-31 00:00:00'::timestamp,stamp_out='2020-08-31 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-08-31') and id not in ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,9+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-10-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-10-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-09-01') and date('2020-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=17,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=7,last44date=date('2020-10-26'),avgtotalweekhours='36:10:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-09-01') and date('2020-10-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-10-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-10-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-10-29') between startdate and enddate) or (startdate <= date('2020-10-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-10-28' as datebefore,
- '22:00' as timebefore,
- '2020-10-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-10-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-10-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-10-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-10-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-10-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='e3e85c3e-1afa-768e-7938-f0c9996c618a'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-11-01') and date('2020-12-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-10-26') then startdate else date('2020-10-26') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-01-03') then date('2021-01-03')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-01-03')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-10-26') and date('2021-01-03')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-11-01') and date('2020-12-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-10-26') and date('2021-01-03') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-10-26') and date('2021-01-03')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-urs::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= '28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='28527822-7e9e-baa4-e825-684d015eed40'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='28527822-7e9e-baa4-e825-684d015eed40') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='28527822-7e9e-baa4-e825-684d015eed40' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='28527822-7e9e-baa4-e825-684d015eed40' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='2583c916-2d07-f42d-9c85-18ee42959317'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-07-01') and date('2020-08-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-06-29') then startdate else date('2020-06-29') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-09-06') then date('2020-09-06')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-09-06')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-06-29') and date('2020-09-06')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-07-01') and date('2020-08-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-06-29') and date('2020-09-06') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-06-29') and date('2020-09-06')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '2583c916-2d07-f42d-9c85-18ee42959317'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-urs::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-urs::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-12-28') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-12-28') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-12-28') between startdate and enddate) or (startdate <= date('2020-12-28') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-12-27' as datebefore,
- '14:30' as timebefore,
- '2020-12-29' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-12-28') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-28') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='15b19d2c-6c14-7948-72c3-f97f6bc29247';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('c1d5484a-15a4-4acd-0ffa-6807756915c0',date('2020-12-28'),'cc63023b-4892-c29c-787d-088392d58b88','2020-12-28 12:00:00'::timestamp,'2020-12-28 15:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-12-28 12:00:00'::timestamp,stamp_out='2020-12-28 15:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-12-28') and id not in ('c1d5484a-15a4-4acd-0ffa-6807756915c0');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERY: select * from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='e3e85c3e-1afa-768e-7938-f0c9996c618a' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,26+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2021-01-01') and date('2021-02-28')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-01-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-12-28') and date(date_trunc('week',date('2021-02-28')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2021-01-01') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=35,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2021-02-22'),avgtotalweekhours='39:33:20'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2021-01-01') and date('2021-02-28')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-12-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-12-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-12-29') between startdate and enddate) or (startdate <= date('2020-12-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-12-28' as datebefore,
- '23:00' as timebefore,
- '2020-12-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-12-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-12-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-12-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'cc63023b-4892-c29c-787d-088392d58b88' as id_staff,date('2020-12-29') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:30',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='aff58dc3-c594-3f62-a870-8eaf41afb464';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('14ce4790-dfe5-45c9-4894-a6e2bee135e4',date('2020-12-29'),'cc63023b-4892-c29c-787d-088392d58b88','2020-12-29 00:00:00'::timestamp,'2020-12-29 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-12-29 00:00:00'::timestamp,stamp_out='2020-12-29 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-12-29') and id not in ('14ce4790-dfe5-45c9-4894-a6e2bee135e4');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERY: select * from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='e3e85c3e-1afa-768e-7938-f0c9996c618a' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,26+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2021-01-01') and date('2021-02-28')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-01-01')));
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-12-28') and date(date_trunc('week',date('2021-02-28')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2021-01-01') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=35,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2021-02-22'),avgtotalweekhours='39:30:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2021-01-01') and date('2021-02-28')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-12-29') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-12-29') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-12-29') between startdate and enddate) or (startdate <= date('2020-12-29') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-12-28' as datebefore,
- '23:00' as timebefore,
- '2020-12-30' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-12-29') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-12-29') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='17:30',timeend2='22:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:00',pauseend2='18:30',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours=null,vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='aff58dc3-c594-3f62-a870-8eaf41afb464';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('14ce4790-dfe5-45c9-4894-a6e2bee135e4',date('2020-12-29'),'cc63023b-4892-c29c-787d-088392d58b88','2020-12-29 00:00:00'::timestamp,'2020-12-29 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-12-29 00:00:00'::timestamp,stamp_out='2020-12-29 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-12-29') and id not in ('14ce4790-dfe5-45c9-4894-a6e2bee135e4');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='8ee10dbb-d61a-a22a-dcfd-70d20d3324b3';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2021-01-01') and date('2021-02-28') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-12-28') then startdate else date('2020-12-28') end as staffperiodstart,
- case when enddate is null or enddate > date('2021-02-28') then date('2021-02-28')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2021-02-28')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-12-28') and date('2021-02-28')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2021-01-01') and date('2021-02-28') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='e3e85c3e-1afa-768e-7938-f0c9996c618a' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,26+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2021-01-01') and date('2021-02-28')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-01-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-12-28') and date(date_trunc('week',date('2021-02-28')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-12-28') and date('2021-02-28') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-12-28') and date('2021-02-28')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2021-01-01'))) and date(date_trunc('week',date('2021-02-28')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2021-01-01') and date('2021-02-28')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=35,suppvacancysunwork=null,suppvacancy44hours=1,status44hcount=0,last44date=date('2021-02-22'),avgtotalweekhours='39:33:20'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2021-01-01') and date('2021-02-28')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-06-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-04-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '688a7626-ff3b-b085-a6e3-7735aab4595c' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = 'e3e85c3e-1afa-768e-7938-f0c9996c618a'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '127.0.0.1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '8ee10dbb-d61a-a22a-dcfd-70d20d3324b3'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM demo.reportperiod rp ORDER BY startdate, enddate;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM demo.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
- coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM demo.workplans wp
- ORDER BY wp.isdefault, wp.workplan;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate < date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate > date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and ((date('2020-08-31') between startdate and enddate) or (startdate <= date('2020-08-31') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-30' as datebefore,
- '14:30' as timebefore,
- '2020-09-01' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-08-31') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by stamp_in,stamp_out;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-EXEC: UPDATE demo.staffreportperioddays SET timestart1='11:00',timeend1='14:30',timestart2='18:30',timeend2='23:00',pausestart1='11:30',pauseend1='12:00',pausestart2='18:30',pauseend2='19:00',payedpause=null,timepause='01:00',daycomment=null,vacancycomment=null,vacancyhours='01:00',vacillcomment=null,vacillhours=null,vacextracomment=null,vacextrahours=null,recupcomment=null,recuperationhours=null,partunempcomment=null,partunemplhours=null,otherpaidhourscomment=null,otherpaidhours=null WHERE id='8dde55e4-8f66-f561-24bb-06336598ea36';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: INSERT INTO demo.timetracker (id,daydate,id_staff,stamp_in,stamp_out)
- VALUES ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef',date('2020-08-31'),'cc63023b-4892-c29c-787d-088392d58b88','2020-08-31 00:00:00'::timestamp,'2020-08-31 00:00:00'::timestamp) on conflict on constraint timetracker_pkey do update set stamp_in='2020-08-31 00:00:00'::timestamp,stamp_out='2020-08-31 00:00:00'::timestamp returning id;
-EXEC: DELETE FROM demo.timetracker WHERE id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate=date('2020-08-31') and id not in ('f7973b0b-6509-c6a0-8f2c-ee58e17afaef');
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERY: select * from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='cc63023b-4892-c29c-787d-088392d58b88'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='cc63023b-4892-c29c-787d-088392d58b88') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
- select srp.id_reportperiod ,startdate,enddate,rp.id from demo.staffreportperiod srp
- join demo.reportperiod rp on (rp.id=srp.id_reportperiod)
- where srp.id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by rp.startdate,rp.enddate)
- sper ) prp where id='9b93bd90-2325-fe28-4bff-852203fc99ce';
-EXEC: update demo.staffreportperioddays spds set
- workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
- dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
- contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
- from (
- select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
- case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
- case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
- case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
- case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
- case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
- preds.interruption,
- (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
- (preds.pdt1+preds.pdt2) as timepause,
- wdcontracthours
- from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
- case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
- case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
- case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
- case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
- case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
- wdcontracthours
- from demo.staffreportperioddays where id in (select id from demo.staffreportperioddays where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days'))
- ) preds) ds where spds.id=ds.id;
-QUERY: select * from demo.staffreportperiod where id_reportperiod='2583c916-2d07-f42d-9c85-18ee42959317' and id_staff='cc63023b-4892-c29c-787d-088392d58b88';
-QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
-select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
-select daydate,9+row_number() over (order by daydate) as rowx from demo.staffreportperioddays
-where daydate between date('2020-09-01') and date('2020-10-31')
-and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
-and id_staff='cc63023b-4892-c29c-787d-088392d58b88' order by daydate
-) xsunday) sunresult;
-QUERY: select sum(suppvacancy44hours) as curvac44h from demo.staffreportperiod where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and id_reportperiod in (select id from demo.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2020-09-01')));
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
-select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
-select weekstart,0+sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
- SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
- case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and sr.daydate between date('2020-08-31') and date(date_trunc('week',date('2020-10-31')) - interval '1 day')
- and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
- ) aa group by aa.weekstart order by weekstart
- ) bb)cc;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='cc63023b-4892-c29c-787d-088392d58b88' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select weekstart,id_staff,avgtotalhours from (
- select ws.weekstart, ws.id_staff,
- AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
- from (
- SELECT weekstart, id_staff,
-sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date(date_trunc('week',date('2020-09-01'))) and date(date_trunc('week',date('2020-10-31')) + interval '6 days')
- --where id_staff= 'cc63023b-4892-c29c-787d-088392d58b88' and daydate between date('2020-09-01') and date('2020-10-31')
- ) srpd GROUP BY srpd.weekstart,srpd.id_staff
- ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
-EXEC: update demo.staffreportperiod rpd set
- --contracthours=csp.contracthours,
- workhours=csp.workhours,
- vacancyill=csp.vacillhours,
- vacancynormal=csp.vacancynormal,
- vacancyextra=csp.vacextrahours,
- otherpaidhours=csp.otherpaidhours,
- partunemplhours=csp.partunemplhours,
- totalhours=csp.totalhours,
- recuperationhours=csp.recuperationhours,statussuncount=17,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=7,last44date=date('2020-10-26'),avgtotalweekhours='36:10:00'::interval,hoursdiff=csp.diffhours
- FROM (
- select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
- select dp.id,
- sum(pd.workhours) as workhours,
- sum(pd.dayhours) as totalhours,
- sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
- sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
- sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
- sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
- sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
- sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
- coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
- coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
- coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
- coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
- from demo.staffreportperioddays pd
- join demo.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce')
- where pd.id_staff='cc63023b-4892-c29c-787d-088392d58b88' and pd.daydate between date('2020-09-01') and date('2020-10-31')
- group by dp.id,dp.payedhours,dp.transferedhourscalc
- ) rp) csp where csp.id=rpd.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'cc63023b-4892-c29c-787d-088392d58b88'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select date(date_trunc('week',startdate)) as startdate,startdate as periodstart, enddate as periodend,date(date_trunc('week',enddate) + interval '6 days') as enddate from demo.reportperiod where id='9b93bd90-2325-fe28-4bff-852203fc99ce'
-QUERYBYKEY: select ws.weekstart,ws.weekend,ws.calweek,ws.calyear, ws.id_staff
- ,to_char(ws.workhours::interval,'HH24:MI') as workhours
- ,to_char(ws.vacancyhours,'HH24:MI') as vacancynormal
- ,to_char(ws.vacillhours,'HH24:MI') as vacancyill
- ,to_char(ws.vacextrahours,'HH24:MI') as vacancyextra
- ,to_char(ws.otherpaidhours,'HH24:MI') as otherpaidhours
- ,to_char(ws.partunemplhours,'HH24:MI') as partunemplhours
- ,to_char(ws.recuperationhours,'HH24:MI') as recuperationhours
- ,to_char(ws.totalhours,'HH24:MI') as totalhours
- ,cd.contractworkdays
- ,cd.cmpcontractdays
- ,cd.cmpweekhours
- ,to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval),'HH24:MI') as weektrackedhours
- ,ws.periodworkhours
- ,interval_to_char(sum(coalesce(ttr.weektrackedhours,'00:00:00'::interval)) over (order by ws.weekstart) - sum(ws.periodworkhours::interval) over (order by ws.weekstart)) as periodtrackdiff
- ,sum(ws.workhours::interval) over (order by ws.weekstart) as runningworkhours
- ,interval_to_char(coalesce(ttr.weektrackedhours,'00:00:00'::interval) - ws.periodworkhours::interval) as trackeddiff
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else to_char(cd.contracthours,'HH24:MI') end as contracthours
- ,to_char(AVG(ws.totalhours) over (order by ws.weekstart),'HH24:MI') as avgtotalhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then '00:00' else interval_to_char(ws.totalhours-cd.contracthours) end as diffhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then
- to_char(case when cd.cmpweekhours < '40:00:00'::interval then cd.contracthours * 1.15 * cd.contractworkdays else (cd.contractworkdays*'08:00:00'::interval) + (cd.contractworkdays* case when maxdata.maxweekhours > '48:00:00' then '01:16:50'::interval else '00:50:00'::interval end) end,'HH24:MI')
- else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours * 1.15 else maxdata.maxweekhours end,'HH24:MI')
- end as maxweekhours
- ,case when cd.contractworkdays < cd.cmpcontractdays then to_char(cd.contractworkdays*'08:00:00'::interval,'HH24:MI') else
- to_char(case when cd.contracthours < '40:00:00'::interval then cd.contracthours else maxdata.defaultweekhours end,'HH24:MI')
- end as defaultweekhours
- from (
- SELECT weekstart,weekend,calweek,calyear, id_staff,
- sum(CASE WHEN srpd.workhours IS NULL THEN '00:00:00'::interval ELSE srpd.workhours::interval END) AS workhours,
- sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhours,
- --sum(case when srpd.daydate between date('2020-09-01') and date('2020-10-31') then coalesce(srpd.workhours::interval, '00:00:00'::interval) else '00:00:00'::interval end) as periodworkhoursnopause,
- sum(CASE WHEN srpd.vacancyhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacancyhours::interval END) AS vacancyhours,
- sum(CASE WHEN srpd.vacillhours IS NULL THEN '00:00:00'::interval ELSE srpd.vacillhours::interval END) AS vacillhours,
- sum(CASE WHEN srpd.vacextrahours IS NULL THEN '00:00:00'::interval ELSE srpd.vacextrahours::interval END) AS vacextrahours,
- sum(CASE WHEN srpd.recuperationhours IS NULL THEN '00:00:00'::interval ELSE srpd.recuperationhours::interval END) AS recuperationhours,
- sum(CASE WHEN srpd.otherpaidhours IS NULL THEN '00:00:00'::interval ELSE srpd.otherpaidhours::interval END) AS otherpaidhours,
- sum(CASE WHEN srpd.partunemplhours IS NULL THEN '00:00:00'::interval ELSE srpd.partunemplhours::interval END) AS partunemplhours,
- sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours,
- sum(CASE WHEN srpd.workhours > '00:00:00'::time without time zone OR srpd.recuperationhours > '00:00:00'::time without time zone OR srpd.vacancyhours > '00:00:00'::time without time zone OR srpd.vacillhours > '00:00:00'::time without time zone OR srpd.vacextrahours > '00:00:00'::time without time zone OR srpd.otherpaidhours > '00:00:00'::time without time zone or srpd.partunemplhours > '00:00:00'::time without time zone THEN 1 ELSE 0 END) AS workdays,
- sum( CASE WHEN srpd.contracthours IS NULL THEN '00:00:00'::interval ELSE srpd.contracthours::interval END) AS contracthours
- FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
- date(date_trunc('week', daydate) + interval '6 days') AS weekend,
- date_part('week', daydate) AS calweek,
- date_part('isoyear', daydate) AS calyear from demo.staffreportperioddays
- where id_staff= 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-08-31') and date('2020-11-01')
- ) srpd GROUP BY srpd.weekstart,srpd.weekend,srpd.calweek,srpd.calyear,srpd.id_staff
- ORDER BY weekstart) ws left join (
- select date(date_trunc('week',pd.daydate)) as weekstart,pd.id_staff,max(sc.weekdays) as cmpcontractdays,max(sc.weekhours) as cmpweekhours,
- case when count(pd.daydate) < avg(sc.weekdays) then count(pd.daydate) else avg(sc.weekdays) end as contractworkdays,
- case when count(pd.daydate) < avg(sc.weekdays) then avg(sc.weekhours/ sc.weekdays) * count(pd.daydate) else avg(sc.weekhours/ sc.weekdays) * avg(sc.weekdays) end as contracthours ,sum(case when coalesce(pd.workhours,'00:00:00'::time) > '00:00:00'::time then 1 else 0 end) as realworkdays
- from ( select id_staff,weekdays ,weekhours,
- case when startdate> date('2020-08-31') then startdate else date('2020-08-31') end as staffperiodstart,
- case when enddate is null or enddate > date('2020-11-01') then date('2020-11-01')
- else enddate end as staffperiodend from demo.staffcontract where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507'
- and startdate < date('2020-11-01')
- ) sc
- join demo.staffreportperioddays pd on (pd.id_staff=sc.id_staff and pd.daydate between sc.staffperiodstart and sc.staffperiodend)
- group by date(date_trunc('week',pd.daydate)),pd.id_staff
- ) cd on ws.id_staff = cd.id_staff and ws.weekstart=cd.weekstart
- left join (
- select id_staff,weekstart,max(defaultweekhours) as defaultweekhours,avg(maxweekhours) as maxweekhours from (
- select lpd.id_staff,date(date_trunc('week',lpd.daydate)) as weekstart,lpd.daydate,
- case when wk.defaultweekhours is null then wkdef.defaultweekhours else wk.defaultweekhours end as defaultweekhours ,
- case when wk.maxweekhours is null then wkdef.maxweekhours else wk.maxweekhours end as maxweekhours
- from demo.staffreportperioddays lpd
- left join demo.worktimes wk on (lpd.daydate between wk.startdate and wk.enddate)
- cross join (select * from demo.worktimes where isdefault=true) wkdef
- where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and lpd.daydate between date('2020-08-31') and date('2020-11-01')
- order by lpd.daydate ) mh group by id_staff,weekstart
- ) maxdata on ws.id_staff = maxdata.id_staff and ws.weekstart=maxdata.weekstart
- left join (
- select weekstart,id_staff,coalesce(sum(daytracked),'00:00:00'::interval) as weektrackedhours from (
- select daydate,id_staff,weekstart,case when sum(trackedhours) > '06:00:00'::interval then sum(trackedhours)- '00:30:00'::interval else coalesce(sum(trackedhours),'00:00:00'::interval) end as daytracked from (
-select daydate,date(date_trunc('week',daydate)) as weekstart,id_staff,(stamp_out-stamp_in)::interval as trackedhours from demo.timetracker
-where daydate between date('2020-09-01') and date('2020-10-31') and id_staff ='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507') tto group by daydate,id_staff,weekstart,trackedhours) ttx group by weekstart,id_staff
- ) ttr on ws.weekstart=ttr.weekstart and ws.id_staff=ttr.id_staff;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT pd.id,pd.id_staff,pd.id_reportperiod,pd.daydate,pd.payedpause,pd.daytype,pd.daycomment,
- vacancycomment,vacillcomment,vacextracomment,recupcomment,otherpaidhourscomment,partunempcomment,
- date(date_trunc('week',pd.daydate)) as weekstart,
- to_char(pd.timestart1::interval, 'HH24:MI') AS timestart1,
- to_char(pd.timeend1::interval, 'HH24:MI') AS timeend1,
- to_char(pd.timestart2::interval, 'HH24:MI') AS timestart2,
- to_char(pd.timeend2::interval, 'HH24:MI') AS timeend2,
- to_char(pd.timepause::interval, 'HH24:MI') AS timepause,
- -- coalesce('<div class="dspvacancynormal">' || to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN null ELSE pd.vacancyhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyill">' || to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN null else pd.vacillhours END::interval, 'HH24:MI') || '</div>','') ||
- -- coalesce('<div class="dspvacancyextra">' || to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN null ELSE pd.vacextrahours END::interval, 'HH24:MI') || '</div>','') AS dspvacancyhours,
- to_char(CASE WHEN pd.vacancyhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacancyhours END::interval, 'HH24:MI') AS vacancyhours,
- to_char(CASE WHEN pd.vacillhours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacillhours END::interval, 'HH24:MI') AS vacillhours,
- to_char(CASE WHEN pd.vacextrahours::interval = '00:00:00'::interval THEN NULL ELSE pd.vacextrahours END::interval, 'HH24:MI') AS vacextrahours,
- to_char(CASE WHEN pd.otherpaidhours::interval = '00:00:00'::interval THEN NULL ELSE pd.otherpaidhours END::interval, 'HH24:MI') AS otherpaidhours,
- to_char(CASE WHEN pd.partunemplhours::interval = '00:00:00'::interval THEN NULL ELSE pd.partunemplhours END::interval, 'HH24:MI') AS partunemplhours,
- to_char(pd.contracthours::interval, 'HH24:MI') AS contracthours,
- to_char(CASE WHEN pd.workhours::interval = '00:00:00'::interval THEN NULL ELSE pd.workhours END::interval, 'HH24:MI') AS workhours,
- to_char(CASE WHEN pd.dayhours::interval = '00:00:00'::interval THEN NULL ELSE pd.dayhours END::interval, 'HH24:MI') AS dayhours,
- to_char(case WHEN pd.recuperationhours::interval = '00:00:00'::interval THEN NULL ELSE pd.recuperationhours END::interval, 'HH24:MI') AS recuperationhours,
- to_char(CASE WHEN pd.interruptionhours::interval = '00:00:00'::interval THEN NULL ELSE pd.interruptionhours END::interval, 'HH24:MI') AS interruptionhours,
- to_char(pd.pausestart1::interval, 'HH24:MI') AS pausestart1,
- to_char(pd.pauseend1::interval, 'HH24:MI') AS pauseend1,
- to_char(pd.pausestart2::interval, 'HH24:MI') AS pausestart2,
- to_char(pd.pauseend2::interval, 'HH24:MI') AS pauseend2,
- COALESCE((to_char(pd.pausestart1::interval, 'HH24:MI') || '-') || to_char(pd.pauseend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.pausestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.pausestart2::interval, 'HH24:MI')) || '-') || to_char(pd.pauseend2::interval, 'HH24:MI'), '') AS dsppausedata,
- COALESCE((to_char(pd.timestart1::interval, 'HH24:MI') || '-') || to_char(pd.timeend1::interval, 'HH24:MI'), '') || COALESCE(((CASE WHEN pd.timestart1 IS NOT NULL THEN '<br/>' ELSE '' END || to_char(pd.timestart2::interval, 'HH24:MI')) || '-') || to_char(pd.timeend2::interval, 'HH24:MI'), '') AS dspworkdata,
- CASE WHEN max(freehours.freehours) < '00:00:00'::interval THEN NULL ELSE to_char(max(freehours.freehours), 'HH24:MI') END AS freehoursafter,
- to_char(coalesce(max(wk.defaultdayhours),max(wkstd.defaultdayhours)),'HH24:MI') as defaultdayhours,
- to_char(coalesce(max(wk.maxdayhours),max(wkstd.maxdayhours)),'HH24:MI') as maxdayhours,
- to_char(coalesce(max(wk.mindailyrecuperation),max(wkstd.mindailyrecuperation)),'HH24:MI') as mindailyrecuperation,
- to_char(coalesce(max(wk.maxinterruptionhours),max(wkstd.maxinterruptionhours)),'HH24:MI') as maxinterruptionhours,
- max(vd.vacancyname) as vacancyname,
- to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end,'HH24:MI') as trackedtime,
- interval_to_char(case when (max(tt.trackedtime) >= '06:00:00'::interval) then max(tt.trackedtime) - case when pd.timepause::interval > '00:30:00'::interval then pd.timepause::interval else '00:30:00'::interval end else max(tt.trackedtime) end - coalesce(pd.workhours::interval,'00:00:00'::interval)) as trackeddiff,
- max(tt.incompletetrack) as incompletetrack
- FROM demo.staffreportperioddays pd
- JOIN demo.staff st ON pd.id_staff = st.id and st.id='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and st.isdeleted is null
- LEFT JOIN ( SELECT yy.id_staff, yy.ndaydate AS daydate,yy.ndaydate + yy.ntimeend AS tmfrom, yy.daydate + yy.timestart AS tmto,
- yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend) AS realinterval,
- date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval AS freehours
- FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
- lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
- xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
- FROM ( SELECT sr.id_staff, sr.daydate,
- CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
- CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
- FROM demo.staffreportperioddays sr
- WHERE sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
- ORDER BY sr.id_staff, sr.daydate) xx_1) yy) freehours ON pd.id_staff = freehours.id_staff AND freehours.daydate = pd.daydate
- left join demo.worktimes wk on pd.daydate between wk.startdate and wk.enddate
- cross join (select defaultdayhours,maxdayhours,mindailyrecuperation,maxinterruptionhours from demo.worktimes where isdefault =true) wkstd
- left join demo.vacancydays vd on pd.daydate=vd.daydate
- left join (
- select daydate,sum(case when stamp_out is not null then cast(stamp_out-stamp_in as interval)::interval else '00:00:00'::interval end) as trackedtime,
- sum(case when stamp_out is null and daydate < current_date then 1 else 0 end) as incompletetrack
-from demo.timetracker where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate between date('2020-08-31') and date('2020-11-01') group by daydate
- ) tt on pd.daydate=tt.daydate
- WHERE pd.daydate between date('2020-08-31') and date('2020-11-01')
- group by pd.id
- ORDER BY pd.id_staff, pd.daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select daydate as datebefore,to_char(case when timestart2 is null then timeend1 else timeend2 end,'HH24:MI') as timeendbefore from demo.staffreportperioddays where id_staff= 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate < date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate desc limit 1;
-QUERY: select daydate as dateafter ,to_char(case when timestart1 is null then timestart2 else timestart1 end,'HH24:MI') as timestartafter from demo.staffreportperioddays where id_staff= 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and daydate > date('2020-08-31') and (timestart1 is not null or timestart2 is not null) order by daydate asc limit 1;
-QUERY: select weekhours from demo.staffcontract where id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' and ((date('2020-08-31') between startdate and enddate) or (startdate <= date('2020-08-31') and enddate is null)) order by startdate,enddate nulls first limit 1;
-QUERY: select to_char(wk.maxdayhours,'HH24:MI') as maxdayhours,
- to_char(wk.maxweekhours,'HH24:MI') as maxweekhours,
- to_char(wk.maxinterruptionhours,'HH24:MI') as maxinterruptionhours,
- to_char(wk.mindailyrecuperation,'HH24:MI') as mindailyrecuperation,
- to_char(wk.defaultweekhours,'HH24:MI') as defaultweekhours,
- '2020-08-30' as datebefore,
- '14:30' as timebefore,
- '2020-09-01' as dateafter,
- '11:00' as timeafter
- from demo.worktimes wk where (date('2020-08-31') between wk.startdate and wk.enddate) or (wk.startdate is null and wk.enddate is null) and maxhourspercents is null
- order by wk.startdate,wk.enddate nulls last limit 1;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' order by stamp_in,stamp_out;
-QUERYARRAY: select id,id_staff,daydate,to_char(stamp_in,'HH24:MI') as stamp_in,to_char(stamp_out,'HH24:MI') as stamp_out,
-case when stamp_in is null or stamp_out is null then '00:00' else to_char(stamp_out-stamp_in,'HH24:MI') end as total
-from demo.timetracker where daydate=date('2020-08-31') and id_staff='e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' order by stamp_in,stamp_out;
-QUERYARRAY: select public.getuuid() as id, 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' as id_staff,date('2020-08-31') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERYARRAY: select public.getuuid() as id, 'e4cc11c3-dc5c-fb32-9de0-3ce9ac721507' as id_staff,date('2020-08-31') as daydate,'00:00' as stamp_in,'00:00' as stamp_out, '00:00' as total
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
- to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
- to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
- --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
- to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
- to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
- to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
- to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
- to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
- to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
- case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
- to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
- srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
- COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
- st.id_staffgroup, sgr.groupname,
- case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
- case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
- case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
- ,itmcontracthours,maxdays,srp.isvalidated,
- to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
- to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
- to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
- to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
- to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
- to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
- to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM demo.staffreportperiod srp
- LEFT JOIN demo.staff st ON srp.id_staff = st.id
- LEFT JOIN demo.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN demo.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '9b93bd90-2325-fe28-4bff-852203fc99ce'
- ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='637870f8-5eb6-b156-54dc-f50aa089da15'
-EXEC: update public.sessions set sessiondata='{"schemata":"alicehartmann"}' where id='637870f8-5eb6-b156-54dc-f50aa089da15'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2018-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-groups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '637870f8-5eb6-b156-54dc-f50aa089da15' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select us.id,cp.schemata from public.users us left join public.companies cp on (us.id_company=cp.id) where lower(us.username)=lower('ksaffran@dks.lu') and us.userpassword = 'a1b496fa520a1c52edd076ca7a59e56667e7ebeb5ba5ba966d2d01628e165359' and us.isblocked is null;
-EXEC: delete from public.sessions where id_user='e9e6880b-75c7-70b5-ce61-49cf6d62630f' and remote_addr='::1' and user_agent='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36';
-QUERY: insert into public.sessions (id_user,id,remote_addr,user_agent,sessiondata) VALUES( 'e9e6880b-75c7-70b5-ce61-49cf6d62630f',public.getuuid(), '::1','Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36',('{"schemata":"demo"}'::text)::json) returning id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-11-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-12-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2022-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2022-02-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2022-03-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2022-02-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from demo.staffreportperioddays spd
- join demo.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2022-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='demo';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select sessiondata from public.sessions where id='052d31c8-8273-3dda-cc0c-2edb6ea4a78a'
-EXEC: update public.sessions set sessiondata='{"schemata":"alicehartmann"}' where id='052d31c8-8273-3dda-cc0c-2edb6ea4a78a'
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-groups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-11-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-09-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-02-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-03-01')) order by st.surname,st.prename,spd.daydate
+QUERYARRAY: select id from kajiwara.staff where isdeleted is null;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','11796d0b-6de0-c137-4a20-4ef48c92e6e5') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','a21bf35f-797d-f9f1-1796-34e3591934bc') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','34f850b6-7a29-6900-637e-8c145886000c') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','0be74e54-4c4e-3801-caa8-0031df35742a') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','4971b1a7-555b-8552-92a2-e8fc85fa6861') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','96623b4b-5bb4-0822-ce31-1e2a0ac19e9d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','4dbf2328-c00b-0174-5604-67088bf87e6e') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='780:00:00' where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','0920d9fa-f53c-6244-1859-43c37159cca3') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','97ac0b46-1e0a-8389-22cb-39c1dfd89596') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-04-30')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-05-01'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-05-01') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-05-01'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-04-01')) order by st.surname,st.prename,spd.daydate
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select max(startdate) as startdate,max(enddate) as enddate,case when date(max(startdate) - interval '1 year') < current_date then null else date(max(startdate) - interval '1 year') end as alloweddate from kajiwara.reportperiod;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-04-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select reportperiodunit,reportperiodlength,reportperiodstart,periodtypes,subinterval from public.companies where schemata='kajiwara';
+QUERY: select case when max(enddate) is null then date('2021-11-01') else date(max(enddate) + interval '1 day') end as rpstart from kajiwara.reportperiod;
+QUERY: select date(date('2022-05-01') + interval '6 months' - interval '1 day' ) as rpend;
+QUERY: select id from kajiwara.reportperiod order by startdate DESC,enddate LIMIT 1;
+QUERY: INSERT INTO kajiwara.reportperiod (startdate, enddate, id_parentreportperiod,periodtype,subinterval) VALUES('2022-05-01','2022-10-31','3295dc17-be6c-3f8a-d5e0-b44a5de1277e','<15','1 month') returning id;
+QUERYARRAY: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ select '883c34d8-cfea-aa41-57c0-85fa8ca0b222' as id_reportperiod,id_staff from kajiwara.staffcontract sc
+left join kajiwara.staff st on (st.id=sc.id_staff)
+where st.isdeleted is null and sc.enddate is null or ( sc.startdate between date('2022-05-01') and date('2022-10-31')) or (sc.enddate between date('2022-05-01') and date('2022-10-31')) on conflict on constraint uniq_staffreportperiod_cal do nothing returning id_staff;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
+ join users us on (us.id=se.id_user)
+ left join usergroups ugrp on (ugrp.id=us.id_usergroup)
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
+ us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-03-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
- us.schemaaccess AS schemaname,
- cp.datasetname
- FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
- FROM users WHERE users.isdeleted IS null) us
- LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select yy.id_staff,yy.staffnumber,yy.staffname,yy.groupname,xx.cw,
- xx.montime,xx.monentry,xx.monexit,
- xx.tuetime,xx.tueentry,xx.tueexit,
- xx.wedtime,xx.wedentry,xx.wedexit,
- xx.thutime,xx.thuentry,xx.thuexit,
- xx.fritime,xx.frientry,xx.friexit,
- xx.sattime,xx.satentry,xx.satexit,
- xx.suntime,xx.sunentry,xx.sunexit,
- xx.weeksum from (
- select st.id as id_staff,st.staffnumber,st.surname || ' ' || st.prename as staffname,gg.groupname from alicehartmann.staffcontract sc join alicehartmann.staff st on (st.id=sc.id_staff) left join alicehartmann.staffgroups gg on (gg.id=st.id_staffgroup)
- where (sc.enddate >= date_trunc('week',date('2021-11-08') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-11-08') + interval '6 days')
- and st.isdeleted is null
- group by st.id,st.surname,st.prename,gg.groupname) yy left join (
- select id_staff,cw,
- to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
- min(case when dow = 1 then timeentry else null end) as monentry,
- max(case when dow = 1 then timeexit else null end) as monexit,
- to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
- min(case when dow = 2 then timeentry else null end) as tueentry,
- max(case when dow = 2 then timeexit else null end) as tueexit,
- to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
- min(case when dow = 3 then timeentry else null end) as wedentry,
- max(case when dow = 3 then timeexit else null end) as wedexit,
- to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
- min(case when dow = 4 then timeentry else null end) as thuentry,
- max(case when dow = 4 then timeexit else null end) as thuexit,
- to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
- min(case when dow = 5 then timeentry else null end) as frientry,
- max(case when dow = 5 then timeexit else null end) as friexit,
- to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
- min(case when dow = 6 then timeentry else null end) as satentry,
- max(case when dow = 6 then timeexit else null end) as satexit,
- to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
- min(case when dow = 7 then timeentry else null end) as sunentry,
- max(case when dow = 7 then timeexit else null end) as sunexit,
- to_char(sum(daystamptime),'HH24:MI') as weeksum
- from (
- select id_staff,
- date_part('week',daydate) as cw,
- to_char(min(stamp_in),'HH24:MI') as timeentry,
- to_char(max(stamp_out),'HH24:MI') as timeexit,
- case when sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) >= '06:00:00'::interval then sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) - '00:30:00'::interval else sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) end as daystamptime,
- date_part('isodow',daydate) as dow,daydate
- from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-11-08')) and date(date_trunc('week',date('2021-11-08')) + interval '6 days') group by tt.id_staff,daydate
- ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff order by staffnumber,staffname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
us.schemaaccess AS schemaname,
cp.datasetname
FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
FROM users WHERE users.isdeleted IS null) us
LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select id,trackername from alicehartmann.timetrackerconfig order by trackername
-QUERYARRAY: select ttr.*, st.* ,stg.groupname,COALESCE(st.surname || ' ', '') || COALESCE(st.prename, '') AS staffname from alicehartmann.staff st
-LEFT JOIN alicehartmann.staffgroups stg ON st.id_staffgroup = stg.id
-cross join (select timetrackertype,case when timetrackertype is not null then true else null end as istimetrackerenabled,periodtypes from public.companies where schemata='alicehartmann') ttr
-where st.isdeleted is null order by groupname,surname,prename;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERYARRAY: SELECT id,startdate,enddate,id_parentreportperiod,periodtype,subinterval,viewpartunempl,to_char(startdate,'MM/YY') || ' - ' || to_char(enddate,'MM/YY') as dspperiod FROM kajiwara.reportperiod rp ORDER BY startdate, enddate;
QUERYARRAY: SELECT wp.id,wp.workplan,wp.isdefault,wp.weekhours,wp.weekdays,
coalesce((((((wp.workplan || ' / ') ||substr(wp.weekhours::text, 1, 5)) || 'h / ') || wp.weekdays) || 'j / libre: ') || (( SELECT string_agg(ww.wday, ',') AS string_agg FROM ( SELECT public.day_name(json_array_elements_text(wp.freeweekdayslist)) AS wday) ww)),wp.workplan ) AS dspworkplandetail
- FROM alicehartmann.workplans wp
+ FROM kajiwara.workplans wp
ORDER BY wp.isdefault, wp.workplan;
-QUERYARRAY: SELECT id,vacancyname,color
- FROM alicehartmann.vacancytypes where isworktime is null or isworktime=false order by vacancyname;
-QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM alicehartmann.staffgroups sg LEFT JOIN alicehartmann.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
- GROUP BY sg.id ORDER BY sg.groupname;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from alicehartmann.staff where id='e697a201-a3f0-9c0a-fa90-72aceebfdb36' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM alicehartmann.staffreportperiod srp
- LEFT JOIN alicehartmann.staff st ON srp.id_staff = st.id
- LEFT JOIN alicehartmann.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN alicehartmann.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = 'e697a201-a3f0-9c0a-fa90-72aceebfdb36'
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.staff where isdeleted is null;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5')) between startdate and enddate order by startdate,enddate;
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','11796d0b-6de0-c137-4a20-4ef48c92e6e5') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','11796d0b-6de0-c137-4a20-4ef48c92e6e5') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='' order by startdate,enddate;
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select date(date_trunc('week',date(''))) as firstday , date(date_trunc('week',date('')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+QUERY: select round(cast(((extract(epoch from (current_date + ''::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/ as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'' as id_staff, null as payedpause,
+ '' as wdcontracthours
+FROM generate_series( ''::timestamp,''::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='' and (daydate > date('') or daydate < date(''))
+ OR (id_staff='' AND daydate not between date('') and date('') AND daydate not between date('') and date(''));
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5';
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='' order by daydate
+) xsunday) sunresult;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours=null,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = ''
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'11796d0b-6de0-c137-4a20-4ef48c92e6e5' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '11796d0b-6de0-c137-4a20-4ef48c92e6e5' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='11796d0b-6de0-c137-4a20-4ef48c92e6e5' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '11796d0b-6de0-c137-4a20-4ef48c92e6e5'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','a21bf35f-797d-f9f1-1796-34e3591934bc') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','a21bf35f-797d-f9f1-1796-34e3591934bc') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'a21bf35f-797d-f9f1-1796-34e3591934bc' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= 'a21bf35f-797d-f9f1-1796-34e3591934bc' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='a21bf35f-797d-f9f1-1796-34e3591934bc' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = 'a21bf35f-797d-f9f1-1796-34e3591934bc'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','34f850b6-7a29-6900-637e-8c145886000c') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','34f850b6-7a29-6900-637e-8c145886000c') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='34f850b6-7a29-6900-637e-8c145886000c'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='34f850b6-7a29-6900-637e-8c145886000c';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'34f850b6-7a29-6900-637e-8c145886000c' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='34f850b6-7a29-6900-637e-8c145886000c' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='34f850b6-7a29-6900-637e-8c145886000c';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='34f850b6-7a29-6900-637e-8c145886000c' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='34f850b6-7a29-6900-637e-8c145886000c' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '34f850b6-7a29-6900-637e-8c145886000c' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='34f850b6-7a29-6900-637e-8c145886000c' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '34f850b6-7a29-6900-637e-8c145886000c'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','0be74e54-4c4e-3801-caa8-0031df35742a') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','0be74e54-4c4e-3801-caa8-0031df35742a') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0be74e54-4c4e-3801-caa8-0031df35742a' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '0be74e54-4c4e-3801-caa8-0031df35742a' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='0be74e54-4c4e-3801-caa8-0031df35742a' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0be74e54-4c4e-3801-caa8-0031df35742a'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','4971b1a7-555b-8552-92a2-e8fc85fa6861') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','4971b1a7-555b-8552-92a2-e8fc85fa6861') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4971b1a7-555b-8552-92a2-e8fc85fa6861' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '4971b1a7-555b-8552-92a2-e8fc85fa6861' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='4971b1a7-555b-8552-92a2-e8fc85fa6861' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4971b1a7-555b-8552-92a2-e8fc85fa6861'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='524:00:00' where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '44cbd54f-c0a8-6bc7-dbe7-cdab23bc059f'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','96623b4b-5bb4-0822-ce31-1e2a0ac19e9d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','96623b4b-5bb4-0822-ce31-1e2a0ac19e9d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='96623b4b-5bb4-0822-ce31-1e2a0ac19e9d' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '96623b4b-5bb4-0822-ce31-1e2a0ac19e9d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','4dbf2328-c00b-0174-5604-67088bf87e6e') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','4dbf2328-c00b-0174-5604-67088bf87e6e') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='780:00:00' where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='786:00:00' where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '30:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'4dbf2328-c00b-0174-5604-67088bf87e6e' as id_staff, null as payedpause,
+ '06:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '06:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '4dbf2328-c00b-0174-5604-67088bf87e6e' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='4dbf2328-c00b-0174-5604-67088bf87e6e' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '4dbf2328-c00b-0174-5604-67088bf87e6e'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='524:00:00' where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '6e47c7e0-a43f-9c25-977c-f6fc4bf1d55d'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','0920d9fa-f53c-6244-1859-43c37159cca3') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','0920d9fa-f53c-6244-1859-43c37159cca3') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='520:00:00' where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='524:00:00' where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '20:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'0920d9fa-f53c-6244-1859-43c37159cca3' as id_staff, null as payedpause,
+ '04:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '04:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '0920d9fa-f53c-6244-1859-43c37159cca3' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='0920d9fa-f53c-6244-1859-43c37159cca3' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '0920d9fa-f53c-6244-1859-43c37159cca3'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id from kajiwara.reportperiod order by startdate,enddate;
+QUERYARRAY: select id,startdate,enddate from kajiwara.reportperiod where
+startdate >= date((select min(startdate) from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'))
+or date((select min(startdate) from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596')) between startdate and enddate order by startdate,enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('3295dc17-be6c-3f8a-d5e0-b44a5de1277e','97ac0b46-1e0a-8389-22cb-39c1dfd89596') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+EXEC: INSERT INTO kajiwara.staffreportperiod (id_reportperiod, id_staff)
+ VALUES ('883c34d8-cfea-aa41-57c0-85fa8ca0b222','97ac0b46-1e0a-8389-22cb-39c1dfd89596') on conflict on constraint uniq_staffreportperiod_cal do nothing;
+QUERY: select reportperiodunit,reportperiodlength from public.companies where schemata='kajiwara'
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) scx where startdate < enddate and id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2021-11-01'),date('2022-04-30'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 130 as maxdays,130 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-04-30') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-04-30')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=130,contracthours='1040:00:00' where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERYARRAY: select id,weekhours,weekdays,startdate,enddate,defaultfreedays from (
+ select rp.id,case when sc.startdate < rp.startdate then rp.startdate else sc.startdate end as startdate ,
+ case when sc.enddate is null or sc.enddate > rp.enddate then rp.enddate else sc.enddate end as enddate,
+ sc.weekhours,sc.weekdays,sc.defaultfreedays from kajiwara.staffcontract sc
+ cross join kajiwara.reportperiod rp
+ where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) scx where startdate < enddate and id='883c34d8-cfea-aa41-57c0-85fa8ca0b222' order by startdate,enddate;
+QUERY: select sum(dow) as maxdays from ( select case when date_part('isodow',generate_series) in (6,7) then 0 else 1 end as dow from pg_catalog.generate_series(date('2022-05-01'),date('2022-10-31'),'1 day')) mxdays
+QUERY: select sum(maxdays) as maxdays,sum(contracthours - ('00:00:'|| extract(second from contracthours))::interval ) as itmcontracthours from (
+ select 131 as maxdays,131 * (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)-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 kajiwara.staffreportperioddays
+ where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) wgr
+ left join (
+ select date(date_trunc('week',startdate)) as weekstartdate,startdate,case when enddate is null then date('2022-10-31') else enddate end as enddate,case when enddate is null then date(date_trunc('week',date('2022-10-31')) + interval '6 days') else enddate end as weekenddate,weekdays,weekhours from kajiwara.staffcontract where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ) sc on (wgr.calweek between sc.weekstartdate and sc.weekenddate ) where wgr.daydate between sc.startdate and sc.enddate group by sc.weekhours,sc.weekdays,calweek
+ ) rnddays group by weekhours,weekdays) xx
+EXEC: update kajiwara.staffreportperiod set maxdays=131,contracthours='1048:00:00' where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+EXEC: insert into kajiwara.staffvacancyyear (id_staff,vacyear)
+ select id_staff,to_char(daydate,'YYYY')::int4 as vyear from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by id_staff,vyear order by id_staff,vyear
+ on conflict on constraint staffvacancyyear_id_staff_vacyear_key do nothing;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='3295dc17-be6c-3f8a-d5e0-b44a5de1277e';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2021-11-01') and date('2022-04-30')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2021-11-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2021-11-01') and date(date_trunc('week',date('2022-04-30')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2021-11-01'))) and date(date_trunc('week',date('2022-04-30')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2021-11-01') and date('2022-04-30')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '3295dc17-be6c-3f8a-d5e0-b44a5de1277e')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2021-11-01') and date('2022-04-30')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
+ ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
+QUERY: select date(date_trunc('week',min(startdate))) as startdatealt,min(startdate) as startdate,max(enddate) as enddate from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select payedpauses,reportperiodunit from public.companies where schemata ='kajiwara'
+QUERYARRAY: select case when sc.startdate > rp.minstartdate then sc.startdate else rp.minstartdatealt end as startdate ,
+case when sc.enddate is null or sc.enddate > rp.maxenddate then rp.maxenddate else sc.enddate end as enddate,
+sc.startdate as scstart,sc.enddate as scend,rp.minstartdate as minperiodstart,rp.maxenddate as maxperiodend,
+sc.weekhours,sc.weekdays from kajiwara.staffcontract sc
+left join (select date(date_trunc('week',min(startdate))) as minstartdatealt,min(startdate) as minstartdate,max(enddate) as maxenddate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff from kajiwara.reportperiod) rp on rp.id_staff=sc.id_staff
+where sc.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by startdate,enddate;
+QUERY: select date(date_trunc('week',date('2021-11-01'))) as firstday , date(date_trunc('week',date('2022-10-31')) + interval '6 days') as lastday
+QUERY: select round(cast(((extract(epoch from (current_date + '40:00:00'::interval)::timestamp) - extract(epoch from current_date::timestamp))/3600.0)/5 as numeric) ,2) * '01:00:00'::interval as wdcontracthours
+EXEC: insert into kajiwara.staffreportperioddays (daydate,id_staff,payedpause,wdcontracthours)
+SELECT date_trunc('day', dd)::date as daydate,'97ac0b46-1e0a-8389-22cb-39c1dfd89596' as id_staff, null as payedpause,
+ '08:00:00' as wdcontracthours
+FROM generate_series( '2021-11-01'::timestamp,'2022-11-06'::timestamp,'1 day'::interval) dd on conflict on constraint uniq_staffworplan_staffday
+do update set wdcontracthours = '08:00:00';
+EXEC: DELETE FROM kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and (daydate > date('2022-11-06') or daydate < date('2021-11-01'))
+ OR (id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' AND daydate not between date('2021-11-01') and date('2022-11-06'));
+EXEC: delete from kajiwara.staffreportperiod sp where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod not in (
+select rp.id from kajiwara.reportperiod rp left join kajiwara.staffreportperioddays pd on (pd.daydate between rp.startdate and rp.enddate)
+where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' group by rp.id);
+QUERY: select * from kajiwara.reportperiod where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+QUERY: select coalesce(prevperiod,'') as prevperiod from (select lag(id_reportperiod,1) over (order by startdate,enddate) as prevperiod,id from (
+ select srp.id_reportperiod ,startdate,enddate,rp.id from kajiwara.staffreportperiod srp
+ join kajiwara.reportperiod rp on (rp.id=srp.id_reportperiod)
+ where srp.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by rp.startdate,rp.enddate)
+ sper ) prp where id='883c34d8-cfea-aa41-57c0-85fa8ca0b222';
+EXEC: update kajiwara.staffreportperioddays spds set
+ workhours=ds.worktime, timepause=case when ds.timepause::interval > '00:00:00' then ds.timepause else null end,
+ dayhours=(ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval + ds.partunemplhours )::interval, interruptionhours = ds.interruption ,
+ contracthours=case when ds.worktime::interval + ds.vachours::interval + ds.vacillhours::interval + ds.vacextrahours::interval + ds.otherpaidhours::interval + ds.recup::interval > '00:00:00'::interval then ds.wdcontracthours else null end
+ from (
+ select preds.id,case when preds.recuperationhours is null then '00:00:00'::interval else preds.recuperationhours::interval end as recup,
+ case when preds.vacancyhours is null then '00:00:00'::time else preds.vacancyhours end as vachours,
+ case when preds.vacillhours is null then '00:00:00'::time else preds.vacillhours end as vacillhours,
+ case when preds.vacextrahours is null then '00:00:00'::time else preds.vacextrahours end as vacextrahours,
+ case when preds.otherpaidhours is null then '00:00:00'::time else preds.otherpaidhours end as otherpaidhours,
+ case when preds.partunemplhours is null then '00:00:00'::time else preds.partunemplhours end as partunemplhours,
+ preds.interruption,
+ (preds.dt1+preds.dt2)-(case when preds.payedpause is null then preds.pdt1+preds.pdt2 else '00:00:00'::interval end) as worktime,
+ (preds.pdt1+preds.pdt2) as timepause,
+ wdcontracthours
+ from ( select id, recuperationhours,vacancyhours,vacillhours,vacextrahours,otherpaidhours,payedpause,partunemplhours,
+ case when timestart1 is not null and timeend1 is not null then case when timeend1 < timestart1 then '24:00:00'::interval + timeend1 - timestart1 else timeend1 - timestart1 end else '00:00:00'::interval end as dt1,
+ case when timestart2 is not null and timeend2 is not null then case when timeend2 < timestart2 then '24:00:00'::interval + timeend2 - timestart2 else timeend2 - timestart2 end else '00:00:00'::interval end as dt2,
+ case when pausestart1 is not null and pauseend1 is not null then case when pauseend1 < pausestart1 then '24:00:00'::interval + pauseend1 - pausestart1 else pauseend1 - pausestart1 end else '00:00:00'::interval end as pdt1,
+ case when pausestart2 is not null and pauseend2 is not null then case when pauseend2 < pausestart2 then '24:00:00'::interval + pauseend2 - pausestart2 else pauseend2 - pausestart2 end else '00:00:00'::interval end as pdt2,
+ case when timestart2 is not null and timeend1 is not null and timestart1 is not null and timeend2 is not null then timestart2 - timeend1 else null end as interruption,
+ wdcontracthours
+ from kajiwara.staffreportperioddays where id in (select id from kajiwara.staffreportperioddays where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days'))
+ ) preds) ds where spds.id=ds.id;
+QUERY: select * from kajiwara.staffreportperiod where id_reportperiod='3295dc17-be6c-3f8a-d5e0-b44a5de1277e' and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596';
+QUERY: select max(rowx) as statussuncount, sum(modx) as suppvacancysunwork from (
+select daydate,rowx, case when mod(rowx,20) = 0 then 2 else null end as modx from (
+select daydate,+row_number() over (order by daydate) as rowx from kajiwara.staffreportperioddays
+where daydate between date('2022-05-01') and date('2022-10-31')
+and date_part('isodow',daydate)::int4 = 7 and workhours > '00:00:00'::time
+and id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' order by daydate
+) xsunday) sunresult;
+QUERY: select sum(suppvacancy44hours) as curvac44h from kajiwara.staffreportperiod where id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and id_reportperiod in (select id from kajiwara.reportperiod where date_part('year',startdate)::int4=date_part('year',date('2022-05-01')));
+QUERY: select *,case when week44s >= 8 then (week44s/8)::int else null end as plusdays from (
+select date(date_trunc('week',max(maxdate)) + interval '7 days') as maxdate,max(sumx) as week44s,mod(max(sumx),8) as weeksrest from (
+select weekstart,sum(case when sum(cnt44) > 0 then 0 else 1 end) over (order by weekstart) as sumx, max(daydate) as maxdate from (
+ SELECT date(date_trunc('week',yy.daydate)) as weekstart,daydate,
+ case when (date_part('epoch', yy.daydate + yy.timestart - (yy.ndaydate + yy.ntimeend)) * '00:00:01'::interval) >= '44:00:00'::interval then 1 else 0 end as cnt44
+ FROM ( SELECT lag(xx_1.daydate, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ndaydate,
+ lag(xx_1.timeend, 1) OVER (ORDER BY xx_1.id_staff, xx_1.daydate) AS ntimeend,
+ xx_1.id_staff, xx_1.daydate, xx_1.timestart, xx_1.timeend
+ FROM ( SELECT sr.id_staff, sr.daydate,
+ CASE WHEN sr.timestart1 IS NOT NULL THEN sr.timestart1 ELSE sr.timestart2 END AS timestart,
+ CASE WHEN sr.timestart2 IS NOT NULL THEN sr.timeend2 ELSE sr.timeend1 END AS timeend
+ FROM kajiwara.staffreportperioddays sr
+ WHERE sr.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and sr.daydate between date('2022-05-01') and date(date_trunc('week',date('2022-10-31')) - interval '1 day')
+ and sr.dayhours IS NOT NULL AND sr.dayhours <> '00:00:00'::time without time zone
+ ORDER BY sr.id_staff, sr.daydate) xx_1) yy order by yy.daydate,weekstart
+ ) aa group by aa.weekstart order by weekstart
+ ) bb)cc;
+QUERY: select weekstart,id_staff,avgtotalhours from (
+ select ws.weekstart, ws.id_staff,
+ AVG(ws.totalhours) over (order by ws.weekstart) as avgtotalhours
+ from (
+ SELECT weekstart, id_staff,
+sum(CASE WHEN srpd.dayhours IS NULL THEN '00:00:00'::interval ELSE srpd.dayhours::interval END) AS totalhours
+ FROM (select *,date(date_trunc('week', daydate)) AS weekstart,
+ date(date_trunc('week', daydate) + interval '6 days') AS weekend,
+ date_part('week', daydate) AS calweek,
+ date_part('isoyear', daydate) AS calyear from kajiwara.staffreportperioddays
+ where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date(date_trunc('week',date('2022-05-01'))) and date(date_trunc('week',date('2022-10-31')) + interval '6 days')
+ --where id_staff= '97ac0b46-1e0a-8389-22cb-39c1dfd89596' and daydate between date('2022-05-01') and date('2022-10-31')
+ ) srpd GROUP BY srpd.weekstart,srpd.id_staff
+ ORDER BY weekstart) ws) wsavg order by weekstart DESC LIMIT 1;
+EXEC: update kajiwara.staffreportperiod rpd set
+ --contracthours=csp.contracthours,
+ workhours=csp.workhours,
+ vacancyill=csp.vacillhours,
+ vacancynormal=csp.vacancynormal,
+ vacancyextra=csp.vacextrahours,
+ otherpaidhours=csp.otherpaidhours,
+ partunemplhours=csp.partunemplhours,
+ totalhours=csp.totalhours,
+ recuperationhours=csp.recuperationhours,statussuncount=null,suppvacancysunwork=null,suppvacancy44hours=null,status44hcount=null,last44date=null,avgtotalweekhours='00:00:00'::interval,hoursdiff=csp.diffhours
+ FROM (
+ select contracthours,workhours,totalhours,recuperationhours, totalhours-contracthours-transferedhours as diffhours,id,vacillhours,vacancynormal,vacextrahours,otherpaidhours,partunemplhours from (
+ select dp.id,
+ sum(pd.workhours) as workhours,
+ sum(pd.dayhours) as totalhours,
+ sum(coalesce(pd.vacancyhours,'00:00:00'::time)) as vacancynormal,
+ sum(coalesce(pd.vacillhours,'00:00:00'::time)) as vacillhours,
+ sum(coalesce(pd.vacextrahours,'00:00:00'::time)) as vacextrahours,
+ sum(coalesce(pd.otherpaidhours,'00:00:00'::time)) as otherpaidhours,
+ sum(coalesce(pd.partunemplhours,'00:00:00'::time)) as partunemplhours,
+ sum(coalesce(pd.recuperationhours,'00:00:00'::time)) as recuperationhours,
+ coalesce(dp.contracthours,'00:00:00'::interval) as contracthours,
+ coalesce(dp.payedhours0,'00:00:00'::interval) as payedhours0,
+ coalesce(dp.payedhours40,'00:00:00'::interval) as payedhours40,
+ coalesce(dp.transferedhours,'00:00:00'::interval) as transferedhours
+ from kajiwara.staffreportperioddays pd
+ join kajiwara.staffreportperiod dp on (pd.id_staff=dp.id_staff and dp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222')
+ where pd.id_staff='97ac0b46-1e0a-8389-22cb-39c1dfd89596' and pd.daydate between date('2022-05-01') and date('2022-10-31')
+ group by dp.id,dp.payedhours,dp.transferedhourscalc
+ ) rp) csp where csp.id=rpd.id;
+QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
+ to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
+ to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
+ --to_char(srp.vacancyhours, 'HH24:MI'::text) AS vacancyhours,
+ to_char(srp.vacancyill, 'HH24:MI'::text) AS vacancyill,
+ to_char(srp.vacancynormal, 'HH24:MI'::text) AS vacancynormal,
+ to_char(srp.vacancyextra, 'HH24:MI'::text) AS vacancyextra,
+ to_char(srp.otherpaidhours, 'HH24:MI'::text) AS otherpaidhours,
+ to_char(srp.partunemplhours, 'HH24:MI'::text) AS partunemplhours,
+ to_char(srp.recuperationhours, 'HH24:MI'::text) AS recuperationhours,
+ case when position('-' in to_char(srp.hoursdiff, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.hoursdiff, 'HH24:MI'),'-','') else to_char(srp.hoursdiff, 'HH24:MI') end as hoursdiff,
+ to_char(srp.totalhours, 'HH24:MI'::text) AS totalhours,
+ srp.id as id_staffreportperiod,srp.id_reportperiod, srp.id_staff, srp.id, rp.startdate, rp.enddate,
+ COALESCE(st.surname || ' '::text, ''::text) || COALESCE(st.prename, ''::text) AS staffname,
+ st.id_staffgroup, sgr.groupname,
+ case when position('-' in to_char(srp.transferedhours, 'HH24:MI')) > 0 then '-' || replace(to_char(srp.transferedhours, 'HH24:MI'),'-','') else to_char(srp.transferedhours, 'HH24:MI') end as transferedhours,
+ case when suppvacancysunwork is not null and suppvacancysunwork > 0 then '+' || suppvacancysunwork else null end as suppvacancysunwork,
+ case when suppvacancy44hours is not null and suppvacancy44hours > 0 then '+' || suppvacancy44hours else null end as suppvacancy44hours
+ ,itmcontracthours,maxdays,srp.isvalidated,
+ to_char(srp.payedhours40calc,'HH24:MI'::text) AS payedhours,
+ to_char(payedhours0, 'HH24:MI'::text) as payedhours0,
+ to_char(payedhours40, 'HH24:MI'::text) as payedhours40,
+ to_char(payedhours40calc, 'HH24:MI'::text) as payedhours40calc,
+ to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
+ to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
+ to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_staff = '97ac0b46-1e0a-8389-22cb-39c1dfd89596'
ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from alicehartmann.staffvacancyyear where id_staff='e697a201-a3f0-9c0a-fa90-72aceebfdb36' order by vacyear;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from alicehartmann.staffcontract where id_staff='e697a201-a3f0-9c0a-fa90-72aceebfdb36' order by startdate,enddate;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='e697a201-a3f0-9c0a-fa90-72aceebfdb36' order by daydate;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select * from alicehartmann.staff where id='1081bbea-feae-e812-0734-cca5424b0718' and isdeleted is null;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: SELECT id,id as id_staffcontract,id_staff,startdate,enddate,weekdays,to_char(weekhours, 'HH24:MI'::text) AS weekhours,defaultfreedays from alicehartmann.staffcontract where id_staff='1081bbea-feae-e812-0734-cca5424b0718' order by startdate,enddate;
QUERYARRAY: SELECT st.prename, st.surname, coalesce(st.surname || ' ','') || coalesce(st.prename,'') as name,
to_char(srp.contracthours, 'HH24:MI'::text) AS contracthours,
to_char(srp.workhours, 'HH24:MI'::text) AS workhours,
to_char(hourstotransfer, 'HH24:MI'::text) as hourstotransfer,
to_char(hourstotransfercalc, 'HH24:MI'::text) as hourstotransfercalc,
to_char(srp.avgtotalweekhours, 'HH24:MI'::text) AS avgtotalweekhours
- FROM alicehartmann.staffreportperiod srp
- LEFT JOIN alicehartmann.staff st ON srp.id_staff = st.id
- LEFT JOIN alicehartmann.reportperiod rp ON srp.id_reportperiod = rp.id
- LEFT JOIN alicehartmann.staffgroups sgr ON st.id_staffgroup = sgr.id
- WHERE st.isdeleted IS NULL AND srp.id_staff = '1081bbea-feae-e812-0734-cca5424b0718'
+ FROM kajiwara.staffreportperiod srp
+ LEFT JOIN kajiwara.staff st ON srp.id_staff = st.id
+ LEFT JOIN kajiwara.reportperiod rp ON srp.id_reportperiod = rp.id
+ LEFT JOIN kajiwara.staffgroups sgr ON st.id_staffgroup = sgr.id
+ WHERE st.isdeleted IS NULL AND srp.id_reportperiod = '883c34d8-cfea-aa41-57c0-85fa8ca0b222'
ORDER BY st.surname, st.prename, srp.id_staff, rp.startdate, rp.enddate;
-QUERYARRAY: select id,id_staff,vacyear,to_char(vachours,'HH24:MI') as vachours from alicehartmann.staffvacancyyear where id_staff='1081bbea-feae-e812-0734-cca5424b0718' order by vacyear;
-QUERYARRAY: select to_char(daydate,'YYYY') as vacyear,daydate,
- to_char(vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || vacancycomment || '</div>','') || coalesce('<div>' || vacillcomment|| '</div>','') || coalesce('<div>' || vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays where (vacancyhours is not null or vacillhours is not null or vacextrahours is not null) and id_staff='1081bbea-feae-e812-0734-cca5424b0718' order by daydate;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
us.schemaaccess AS schemaname,
cp.datasetname
FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
FROM users WHERE users.isdeleted IS null) us
LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
- join users us on (us.id=se.id_user)
- left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
- us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: SELECT * FROM public.companies WHERE schemata='kajiwara' and isdeleted IS NULL;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
+QUERYARRAY: select sg.id,sg.groupname,sg.groupcolor,sg.isdefault,COALESCE(count(st.id), 0) AS staffmembers FROM kajiwara.staffgroups sg LEFT JOIN kajiwara.staff st ON (st.id_staffgroup = sg.id and st.isdeleted IS NULL)
+ GROUP BY sg.id ORDER BY sg.groupname;
+QUERYARRAY: select * from (
+SELECT us.username,us.isblocked,us.surname,us.prename,us.id_company,us.id_usergroup,us.id,cp.company,cp.datasetname,grp.groupname,us.lang,
+case when us.id_usergroup = 'teamleader' then string_agg(stgrp.groupname,',') else null end as staffgroups,
+ json_array_elements_text(us.schemaaccess) AS xschema
+ FROM public.users us join public.companies cp on (us.id_company=cp.id)
+ left join public.usergroups grp on (us.id_usergroup=grp.id)
+ left join (select stu.id as id_user,stu.id_staffgroup,stg.groupname from kajiwara.staffgroups stg
+join (select id,json_array_elements_text(id_staffgroups) as id_staffgroup from public.users) stu on (stu.id_staffgroup=stg.id)) stgrp on (us.id=stgrp.id_user)
+ WHERE us.isdeleted IS null and id_usergroup in ('teamleader','manager') group by us.id,cp.id,grp.id
+ ) xus where xschema='kajiwara' group by xus.id,xus.username,xus.groupname,xus.isblocked,xus.surname,xus.prename,xus.id_company,xus.id_usergroup,xus.company,xus.datasetname,xus.xschema,xus.staffgroups,xus.lang;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERYARRAY: select * from (
+SELECT us.username,us.isblocked,us.surname,us.prename,us.id_company,us.id_usergroup,us.id,cp.company,cp.datasetname,grp.groupname,us.lang,
+case when us.id_usergroup = 'teamleader' then string_agg(stgrp.groupname,',') else null end as staffgroups,
+ json_array_elements_text(us.schemaaccess) AS xschema
+ FROM public.users us join public.companies cp on (us.id_company=cp.id)
+ left join public.usergroups grp on (us.id_usergroup=grp.id)
+ left join (select stu.id as id_user,stu.id_staffgroup,stg.groupname from kajiwara.staffgroups stg
+join (select id,json_array_elements_text(id_staffgroups) as id_staffgroup from public.users) stu on (stu.id_staffgroup=stg.id)) stgrp on (us.id=stgrp.id_user)
+ WHERE us.isdeleted IS null and id_usergroup in ('teamleader','manager') group by us.id,cp.id,grp.id
+ ) xus where xschema='kajiwara' group by xus.id,xus.username,xus.groupname,xus.isblocked,xus.surname,xus.prename,xus.id_company,xus.id_usergroup,xus.company,xus.datasetname,xus.xschema,xus.staffgroups,xus.lang;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
+EXEC: UPDATE public.users SET userpassword = 'c79a9c394eb8ff36f262e71c2e0cecfcf0f56f791b9bcbd1aa1e544fe916b785' WHERE id='940bc991-a807-ac19-49a1-6aaedcf836f7';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-02-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-03-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-04-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-06-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-07-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-08-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-09-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-10-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-11-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
+QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
+ us.schemaaccess AS schemaname,
+ cp.datasetname
+ FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
+ FROM users WHERE users.isdeleted IS null) us
+ LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ('<div>' || spd.vacancycomment || '</div>','') || coalesce('<div>' || spd.vacillcomment|| '</div>','') || coalesce('<div>' || spd.vacextracomment|| '</div>','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-12-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- to_char(spd.vacancyhours::interval,'HH24:MI') as vacancyhours,
- to_char(spd.vacillhours::interval,'HH24:MI') as vacillhours,
- to_char(spd.vacextrahours::interval,'HH24:MI') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
+ us.schemaaccess AS schemaname,
+ cp.datasetname
+ FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
+ FROM users WHERE users.isdeleted IS null) us
+ LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-09-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-07-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-02-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-05-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-07-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-03-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-09-01')) order by st.surname,st.prename,spd.daydate
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-04-01')) order by st.surname,st.prename,spd.daydate
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERYARRAY: select st.prename,st.surname,spd.id_staff,to_char(spd.daydate,'YYYY') as vacyear,spd.daydate,
- coalesce(to_char(spd.vacancyhours::interval,'HH24:MI'),'') as vacancyhours,
- coalesce(to_char(spd.vacillhours::interval,'HH24:MI'),'') as vacillhours,
- coalesce(to_char(spd.vacextrahours::interval,'HH24:MI'),'') as vacextrahours,
- coalesce ( spd.vacancycomment || ' ' ,'') || coalesce( spd.vacillcomment || ' ' ,'') || coalesce( spd.vacextracomment|| ' ','') as description
- from alicehartmann.staffreportperioddays spd
- join alicehartmann.staff st on (st.id=spd.id_staff)
- where (spd.vacancyhours is not null or spd.vacillhours is not null or spd.vacextrahours is not null) and date_trunc('month',spd.daydate)=date_trunc('month',date('2021-01-01')) order by st.surname,st.prename,spd.daydate
+QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
+ us.schemaaccess AS schemaname,
+ cp.datasetname
+ FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
+ FROM users WHERE users.isdeleted IS null) us
+ LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
+QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
-QUERY: select timetrackertype,sector from public.companies where schemata='alicehartmann';
+QUERY: select timetrackertype,sector from public.companies where schemata='kajiwara';
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
QUERY: select se.id as idsession,us.lang,us.id,us.username,ugrp.id as usergroup,us.id_staffgroups as staffgroups,se.sessiondata from sessions se
join users us on (us.id=se.id_user)
left join usergroups ugrp on (ugrp.id=us.id_usergroup)
- where se.id= '052d31c8-8273-3dda-cc0c-2edb6ea4a78a' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36' and
+ where se.id= 'a046868f-3c94-adc9-caac-1e6088267672' and se.remote_addr= '::1' and se.user_agent ='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36' and
us.isblocked is null group by se.id,us.id,ugrp.id;
+QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';
QUERYARRAY: SELECT distinct(us.schemaaccess),cp.company,
us.schemaaccess AS schemaname,
cp.datasetname
FROM ( SELECT json_array_elements_text(users.schemaaccess) AS schemaaccess
FROM users WHERE users.isdeleted IS null) us
LEFT JOIN companies cp ON cp.schemata = us.schemaaccess AND cp.isdeleted IS NULL;
-QUERY: select terms from public.users where id='e9e6880b-75c7-70b5-ce61-49cf6d62630f';