From 447d968f59e0edae4111fad742e397c91a0ae42a Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Fri, 19 Dec 2025 16:25:39 -0500 Subject: [PATCH] feat(pay-period): added is_active to payload to filter inactive employee from the timesheets_approval page --- .../services/pay-periods-query.service.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/time-and-attendance/pay-period/services/pay-periods-query.service.ts b/src/time-and-attendance/pay-period/services/pay-periods-query.service.ts index 9f62271..bbb326b 100644 --- a/src/time-and-attendance/pay-period/services/pay-periods-query.service.ts +++ b/src/time-and-attendance/pay-period/services/pay-periods-query.service.ts @@ -252,9 +252,10 @@ export class PayPeriodsQueryService { for (const employee of all_employees) { let is_active = true; - if (employee.last_work_day) { + if (employee.last_work_day !== null) { is_active = this.checkForInactiveDate(employee.last_work_day) } + console.log('employee name: ', employee.user.first_name, employee.user.first_name, 'last work day: ', employee.last_work_day); by_employee.set(employee.id, { email: employee.user.email, employee_name: employee.user.first_name + ' ' + employee.user.last_name, @@ -465,12 +466,11 @@ export class PayPeriodsQueryService { } private checkForInactiveDate = (last_work_day: Date) => { - const inactive_date = toStringFromDate(last_work_day); - const limit = new Date(inactive_date); + const limit = new Date(last_work_day); limit.setDate(limit.getDate() + 14); - if(limit >= new Date()) { - return false - } - return true; + if (limit >= new Date()) { + return true; + } + return false; } }