fix(csv): added real paid hours for csv download
This commit is contained in:
parent
e10a7da1e4
commit
6cbf37ed86
|
|
@ -36,6 +36,7 @@ export const applyHolidayRequalifications = async (
|
|||
result.push(row);
|
||||
continue;
|
||||
}
|
||||
|
||||
const calculated = await holiday_service.calculateHolidayPay(row.email, new Date(row.holiday_date), 1);
|
||||
if (!calculated.success) {
|
||||
result.push({ ...row, quantity_hours: 0 });
|
||||
|
|
@ -45,7 +46,6 @@ export const applyHolidayRequalifications = async (
|
|||
result.push({ ...row, quantity_hours: calculated.data });
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
export const applyOvertimeRequalifications = async (
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ export class CsvExportService {
|
|||
company_code: employee.company_code,
|
||||
external_payroll_id: employee.external_payroll_id,
|
||||
timesheet_id: shift.timesheet.id,
|
||||
email: '',
|
||||
email: shift.timesheet.employee.user.email,
|
||||
shift_date: shift.date,
|
||||
full_name: `${employee.user.first_name} ${employee.user.last_name}`,
|
||||
bank_code: shift.bank_code?.bank_code ?? '',
|
||||
|
|
@ -230,14 +230,15 @@ export class CsvExportService {
|
|||
});
|
||||
|
||||
|
||||
//groups hours by bank_code
|
||||
const consolidated_rows = await consolidateRowHoursAndAmountByType(rows);
|
||||
|
||||
//requalifies the real amount paid for holidays
|
||||
const holiday_rows = await applyHolidayRequalifications(consolidated_rows, this.holiday_service);
|
||||
const holiday_rows = await applyHolidayRequalifications(rows, this.holiday_service);
|
||||
|
||||
//groups hours by bank_code
|
||||
const consolidated_rows = await consolidateRowHoursAndAmountByType(holiday_rows);
|
||||
|
||||
|
||||
//requalifies regular hours into overtime when needed
|
||||
const requalified_rows = await applyOvertimeRequalifications(holiday_rows, this.overtime_service);
|
||||
const requalified_rows = await applyOvertimeRequalifications(consolidated_rows, this.overtime_service);
|
||||
|
||||
return requalified_rows;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user