corrected overtime to become > 24 hours and negative
This commit is contained in:
@ -10,7 +10,7 @@ grant select,insert,update,delete on done.t_required_worktime to timetrack;
|
||||
|
||||
create table done.t_overtime (
|
||||
pk_overtime int primary key generated always as identity,
|
||||
worktime_offset time without time zone not null,
|
||||
overtime_minutes int not null,
|
||||
impact timestamp without time zone not null,
|
||||
fk_login int not null unique references profile.t_login(pk)
|
||||
);
|
||||
@ -53,15 +53,15 @@ with x(dayworktime, day, fk_login) as (
|
||||
|
||||
grant select on done.v_daylimit to timetrack;
|
||||
|
||||
create view done.v_current_overtime as
|
||||
select x.worktime_offset + sum(l.dayworktime - r.required) as overtime,
|
||||
create or replace view done.v_current_overtime as
|
||||
select x.overtime_minutes + extract(minute from sum(l.dayworktime - r.required)) as overtime,
|
||||
to_char(now(), 'DD.MM.YYYY HH24:MI') as impact,
|
||||
x.fk_login
|
||||
from done.t_overtime x
|
||||
left join done.v_daylimit l on l.fk_login = x.fk_login and l.day >= x.impact
|
||||
left join done.t_required_worktime r on r.fk_login = x.fk_login and r.day = l.day
|
||||
where l.day < now()
|
||||
group by x.worktime_offset, x.fk_login;
|
||||
group by x.overtime_minutes, x.fk_login;
|
||||
|
||||
grant select on done.v_current_overtime to timetrack;
|
||||
|
||||
@ -80,4 +80,4 @@ with x(dayworktime, day, fk_login, required, starttime, endtime) as (
|
||||
|
||||
grant select on done.v_day to timetrack;
|
||||
|
||||
create or replace view done.v_version as select 20240103 as version;
|
||||
create or replace view done.v_version as select 20240104 as version;
|
||||
|
Reference in New Issue
Block a user