v20210407 01
authorKilian Saffran <ksaffran@dks.lu>
Wed, 7 Apr 2021 08:15:48 +0000 (10:15 +0200)
committerKilian Saffran <ksaffran@dks.lu>
Wed, 7 Apr 2021 08:15:48 +0000 (10:15 +0200)
.gitignore
app/put.log [deleted file]
app/sql.log [deleted file]

index b5afd0e..1a4cffb 100644 (file)
@@ -14,3 +14,5 @@ release-builds
 dev/tmp/*
 release
 install/tmp/*
+app/sql.log
+app/put.log
diff --git a/app/put.log b/app/put.log
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/sql.log b/app/sql.log
deleted file mode 100644 (file)
index 330bdb9..0000000
+++ /dev/null
@@ -1,2281 +0,0 @@
-alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-07select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-07') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-07') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-07')) and date(date_trunc('week',date('2021-04-07')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-14select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-14') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-14') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-14')) and date(date_trunc('week',date('2021-04-14')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-22select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-22') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-22') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-22')) and date(date_trunc('week',date('2021-04-22')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-29select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-29') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-29') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-29')) and date(date_trunc('week',date('2021-04-29')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-06select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-06') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-06')) and date(date_trunc('week',date('2021-05-06')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-28select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-28') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-28') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-28')) and date(date_trunc('week',date('2021-04-28')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-14select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-14') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-14') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-14')) and date(date_trunc('week',date('2021-04-14')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-07select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-07') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-07') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-07')) and date(date_trunc('week',date('2021-04-07')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-31select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-31') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-31') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-31')) and date(date_trunc('week',date('2021-03-31')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-04')) and date(date_trunc('week',date('2021-03-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-11')) and date(date_trunc('week',date('2021-03-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-28select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-28') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-28') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-28')) and date(date_trunc('week',date('2021-03-28')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-21select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-21') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-21') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-21')) and date(date_trunc('week',date('2021-03-21')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-14select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-14') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-14') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-14')) and date(date_trunc('week',date('2021-03-14')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-03-07select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-03-07') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-03-07') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-03-07')) and date(date_trunc('week',date('2021-03-07')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-02-28select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-02-28') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-02-28') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-02-28')) and date(date_trunc('week',date('2021-02-28')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-02-21select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-02-21') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-02-21') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-02-21')) and date(date_trunc('week',date('2021-02-21')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-02-14select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-02-14') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-02-14') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-02-14')) and date(date_trunc('week',date('2021-02-14')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-02-07select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-02-07') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-02-07') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-02-07')) and date(date_trunc('week',date('2021-02-07')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-01-31select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-01-31') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-01-31') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-01-31')) and date(date_trunc('week',date('2021-01-31')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-01-24select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-01-24') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-01-24') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-01-24')) and date(date_trunc('week',date('2021-01-24')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-01-17select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-01-17') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-01-17') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-01-17')) and date(date_trunc('week',date('2021-01-17')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-01-10select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-01-10') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-01-10') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-01-10')) and date(date_trunc('week',date('2021-01-10')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-01-03select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-01-03') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-01-03') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-01-03')) and date(date_trunc('week',date('2021-01-03')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-12-27select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-12-27') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-12-27') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-12-27')) and date(date_trunc('week',date('2020-12-27')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-12-20select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-12-20') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-12-20') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-12-20')) and date(date_trunc('week',date('2020-12-20')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-12-13select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-12-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-12-13') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-12-13')) and date(date_trunc('week',date('2020-12-13')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-12-06select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-12-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-12-06') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-12-06')) and date(date_trunc('week',date('2020-12-06')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-11-29select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-11-29') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-11-29') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-11-29')) and date(date_trunc('week',date('2020-11-29')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-11-22select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-11-22') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-11-22') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-11-22')) and date(date_trunc('week',date('2020-11-22')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-11-15select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-11-15') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-11-15') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-11-15')) and date(date_trunc('week',date('2020-11-15')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-11-08select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-11-08') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-11-08') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-11-08')) and date(date_trunc('week',date('2020-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;alicehartmann2020-11-01select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-11-01') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-11-01') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-11-01')) and date(date_trunc('week',date('2020-11-01')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-10-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-10-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-10-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-10-25')) and date(date_trunc('week',date('2020-10-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-10-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-10-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-10-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-10-18')) and date(date_trunc('week',date('2020-10-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-10-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-10-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-10-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-10-11')) and date(date_trunc('week',date('2020-10-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-10-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-10-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-10-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-10-04')) and date(date_trunc('week',date('2020-10-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-09-27select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-09-27') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-09-27') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-09-27')) and date(date_trunc('week',date('2020-09-27')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-09-20select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-09-20') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-09-20') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-09-20')) and date(date_trunc('week',date('2020-09-20')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-09-13select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-09-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-09-13') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-09-13')) and date(date_trunc('week',date('2020-09-13')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-09-06select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-09-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-09-06') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-09-06')) and date(date_trunc('week',date('2020-09-06')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-08-30select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-08-30') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-08-30') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-08-30')) and date(date_trunc('week',date('2020-08-30')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-08-23select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-08-23') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-08-23') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-08-23')) and date(date_trunc('week',date('2020-08-23')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-08-16select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-08-16') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-08-16') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-08-16')) and date(date_trunc('week',date('2020-08-16')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-08-09select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-08-09') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-08-09') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-08-09')) and date(date_trunc('week',date('2020-08-09')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-08-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-08-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-08-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-08-02')) and date(date_trunc('week',date('2020-08-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-07-26select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-07-26') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-07-26') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-07-26')) and date(date_trunc('week',date('2020-07-26')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-07-19select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-07-19') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-07-19') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-07-19')) and date(date_trunc('week',date('2020-07-19')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-07-12select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-07-12') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-07-12') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-07-12')) and date(date_trunc('week',date('2020-07-12')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-07-05select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-07-05') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-07-05') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-07-05')) and date(date_trunc('week',date('2020-07-05')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-06-28select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-06-28') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-06-28') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-06-28')) and date(date_trunc('week',date('2020-06-28')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-06-21select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-06-21') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-06-21') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-06-21')) and date(date_trunc('week',date('2020-06-21')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-06-14select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-06-14') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-06-14') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-06-14')) and date(date_trunc('week',date('2020-06-14')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-06-07select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-06-07') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-06-07') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-06-07')) and date(date_trunc('week',date('2020-06-07')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-05-31select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-05-31') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-05-31') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-05-31')) and date(date_trunc('week',date('2020-05-31')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-05-24select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-05-24') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-05-24') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-05-24')) and date(date_trunc('week',date('2020-05-24')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-05-17select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-05-17') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-05-17') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-05-17')) and date(date_trunc('week',date('2020-05-17')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-05-10select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-05-10') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-05-10') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-05-10')) and date(date_trunc('week',date('2020-05-10')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-05-03select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-05-03') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-05-03') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-05-03')) and date(date_trunc('week',date('2020-05-03')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-04-26select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-04-26') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-04-26') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-04-26')) and date(date_trunc('week',date('2020-04-26')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-04-19select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-04-19') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-04-19') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-04-19')) and date(date_trunc('week',date('2020-04-19')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-04-12select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-04-12') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-04-12') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-04-12')) and date(date_trunc('week',date('2020-04-12')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-04-05select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-04-05') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-04-05') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-04-05')) and date(date_trunc('week',date('2020-04-05')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2020-03-29select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2020-03-29') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2020-03-29') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2020-03-29')) and date(date_trunc('week',date('2020-03-29')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-11')) and date(date_trunc('week',date('2021-04-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-02')) and date(date_trunc('week',date('2021-05-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-09select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-09') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-09') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-09')) and date(date_trunc('week',date('2021-05-09')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-16select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-16') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-16') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-16')) and date(date_trunc('week',date('2021-05-16')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-09select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-09') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-09') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-09')) and date(date_trunc('week',date('2021-05-09')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-02')) and date(date_trunc('week',date('2021-05-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-11')) and date(date_trunc('week',date('2021-04-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-11')) and date(date_trunc('week',date('2021-04-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-02')) and date(date_trunc('week',date('2021-05-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-09select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-09') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-09') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-09')) and date(date_trunc('week',date('2021-05-09')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-16select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-16') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-16') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-16')) and date(date_trunc('week',date('2021-05-16')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-23select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-23') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-23') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-23')) and date(date_trunc('week',date('2021-05-23')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-30select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-30') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-30') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-30')) and date(date_trunc('week',date('2021-05-30')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-06-06select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-06-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-06-06') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-06-06')) and date(date_trunc('week',date('2021-06-06')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-06-13select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-06-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-06-13') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-06-13')) and date(date_trunc('week',date('2021-06-13')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-06-20select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-06-20') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-06-20') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-06-20')) and date(date_trunc('week',date('2021-06-20')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-06-13select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-06-13') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-06-13') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-06-13')) and date(date_trunc('week',date('2021-06-13')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-06-06select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-06-06') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-06-06') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-06-06')) and date(date_trunc('week',date('2021-06-06')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-30select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-30') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-30') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-30')) and date(date_trunc('week',date('2021-05-30')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-23select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-23') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-23') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-23')) and date(date_trunc('week',date('2021-05-23')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-16select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-16') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-16') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-16')) and date(date_trunc('week',date('2021-05-16')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-09select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-09') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-09') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-09')) and date(date_trunc('week',date('2021-05-09')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-02')) and date(date_trunc('week',date('2021-05-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-11select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-11') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-11') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-11')) and date(date_trunc('week',date('2021-04-11')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-05-02select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-05-02') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-05-02') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-05-02')) and date(date_trunc('week',date('2021-05-02')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-25select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-25') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-25') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-25')) and date(date_trunc('week',date('2021-04-25')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-18select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-18') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-18') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-18')) and date(date_trunc('week',date('2021-04-18')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;alicehartmann2021-04-04select yy.id_staff,yy.staffname,xx.cw,xx.montime,xx.tuetime,xx.wedtime,xx.thutime,xx.fritime,xx.sattime,xx.suntime,xx.weeksum from (
-    select st.id as id_staff,st.surname || ' ' || st.prename as staffname  from alicehartmann.staffcontract sc  join alicehartmann.staff st on (st.id=sc.id_staff) 
-    where (sc.enddate >= date_trunc('week',date('2021-04-04') + interval '6 days') or enddate is null) and sc.startdate <= date_trunc('week',date('2021-04-04') + interval '6 days')
-    and st.isdeleted is null
-    group by st.id,st.surname,st.prename) yy left join (
-    select id_staff,cw,
-       to_char(sum(case when dow = 1 then daystamptime else null end),'HH24:MI') as montime,
-       to_char(sum(case when dow = 2 then daystamptime else null end),'HH24:MI') as tuetime,
-       to_char(sum(case when dow = 3 then daystamptime else null end),'HH24:MI') as wedtime,
-       to_char(sum(case when dow = 4 then daystamptime else null end),'HH24:MI') as thutime,
-       to_char(sum(case when dow = 5 then daystamptime else null end),'HH24:MI') as fritime,
-       to_char(sum(case when dow = 6 then daystamptime else null end),'HH24:MI') as sattime,
-       to_char(sum(case when dow = 7 then daystamptime else null end),'HH24:MI') as suntime,
-       to_char(sum(daystamptime),'HH24:MI') as weeksum
-        from (
-       select id_staff, 
-       date_part('week',daydate) as cw,
-       sum(coalesce((stamp_out-stamp_in)::interval,'00:00:00')) as daystamptime, 
-       date_part('isodow',daydate) as dow,daydate
-       from alicehartmann.timetracker tt where tt.daydate between date_trunc('week',date('2021-04-04')) and date(date_trunc('week',date('2021-04-04')) + interval '6 days') group by tt.id_staff,daydate
-       ) ttd group by id_staff,cw) xx on yy.id_staff=xx.id_staff;
\ No newline at end of file