feat(pay-period): added is_active to payload to filter inactive employee from the timesheets_approval page
This commit is contained in:
parent
c0d00d0ca9
commit
447d968f59
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user