fix(pay-period): fix total_hours calculation

This commit is contained in:
Matthieu Haineault 2025-09-09 10:24:53 -04:00
parent 4a6eed1185
commit a343ace0b7

View File

@ -239,13 +239,20 @@ export class PayPeriodsQueryService {
const hours = computeHours(shift.start_time, shift.end_time);
const type = (shift.bank_code?.type ?? '').toUpperCase();
switch (type) {
case "EVENING": record.evening_hours += hours; break;
case "EMERGENCY": record.emergency_hours += hours; break;
case "OVERTIME": record.overtime_hours += hours; break;
case "REGULAR" : record.regular_hours += hours; break;
case "EVENING": record.evening_hours += hours;
record.total_hours += hours;
break;
case "EMERGENCY": record.emergency_hours += hours;
record.total_hours += hours;
break;
case "OVERTIME": record.overtime_hours += hours;
record.total_hours += hours;
break;
case "REGULAR" : record.regular_hours += hours;
record.total_hours += hours;
break;
}
record.is_approved = record.is_approved && shift.timesheet.is_approved;
record.total_hours += hours;
record.is_remote = record.is_remote || !!shift.is_remote;
}