From 6df3aa944de2d9761d2cdbd8ddd3e5ab68fe4847 Mon Sep 17 00:00:00 2001 From: Nic D Date: Mon, 9 Mar 2026 09:28:22 -0400 Subject: [PATCH] fix(pay-period): Fix issue where overviews would sometimes return approval false Overviews would be flagged as not approved if there were no shifts nor expenses on the timesheets, but it needs to be approved not just for accounting purposes, but to lock the timesheets from retroactive modifications as well. --- .../pay-period/services/pay-periods-build-overview.service.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts b/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts index 4fc43b0..43161dc 100644 --- a/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts +++ b/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts @@ -205,13 +205,12 @@ export class GetOverviewService { const record = by_employee.get(employee.id); if (!record) continue; const timesheets = employee.timesheet; - const has_data = timesheets.some(timesheet => timesheet.shift.length > 0 || timesheet.expense.length > 0); const cutoff_date = new Date(); cutoff_date.setDate(cutoff_date.getDate() + 14); const is_active = employee.last_work_day ? employee.last_work_day.getTime() >= cutoff_date.getTime() : true; - record.is_approved = has_data && timesheets.every(timesheet => timesheet.is_approved === true); + record.is_approved = timesheets.every(timesheet => timesheet.is_approved === true); record.is_active = is_active; }