fix(exports): fix issue where bank code was not being properly verified, adjust sorting of results
This commit is contained in:
parent
aa6109ff09
commit
c712e0f5db
|
|
@ -11,10 +11,10 @@ export const consolidateRowHoursAndAmountByType = (rows: InternalCsvRow[]): Inte
|
|||
const map = new Map<string, InternalCsvRow>();
|
||||
|
||||
for (const row of rows) {
|
||||
if (row.code = VACATION) {
|
||||
map.set(`${row.code}|${row.shift_date}`, row);
|
||||
if (row.code === VACATION) {
|
||||
map.set(`${row.code}|${row.shift_date}|${row.timesheet_id}`, row);
|
||||
} else {
|
||||
const key = `${row.code}|${row.semaine_no}`;
|
||||
const key = `${row.code}|${row.timesheet_id}`;
|
||||
if (!map.has(key)) {
|
||||
map.set(key, row);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -135,16 +135,13 @@ export class CsvExportService {
|
|||
dernier_jour_absence: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Sort shifts and expenses according to their bank codes
|
||||
rows.sort((a, b) => {
|
||||
if (a.code !== b.code)
|
||||
return a.code - b.code;
|
||||
|
||||
return 0;
|
||||
});
|
||||
rows.sort((a, b) =>
|
||||
a.code - b.code ||
|
||||
a.employee_matricule - b.employee_matricule
|
||||
);
|
||||
|
||||
const holiday_rows = await applyHolidayRequalifications(rows, this.holiday_service, HOLIDAY_SHIFT_CODE[0]);
|
||||
const consolidated_rows = await consolidateRowHoursAndAmountByType(holiday_rows);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user