fix(csv): removed the cumulation of sick days into a single row.
This commit is contained in:
parent
4b8f1e0f77
commit
d2c7f262a4
|
|
@ -5,12 +5,13 @@ import { CsvRow, InternalCsvRow } from "src/time-and-attendance/exports/export-c
|
||||||
const REGULAR = 1;
|
const REGULAR = 1;
|
||||||
const OVERTIME = 43;
|
const OVERTIME = 43;
|
||||||
const VACATION = 109;
|
const VACATION = 109;
|
||||||
|
const SICK = 105;
|
||||||
|
|
||||||
export const consolidateRowHoursAndAmountByType = (rows: InternalCsvRow[]): InternalCsvRow[] => {
|
export const consolidateRowHoursAndAmountByType = (rows: InternalCsvRow[]): InternalCsvRow[] => {
|
||||||
const map = new Map<string, InternalCsvRow>();
|
const map = new Map<string, InternalCsvRow>();
|
||||||
|
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
if (row.code === VACATION) {
|
if (row.code === VACATION || row.code === SICK) {
|
||||||
map.set(`${row.code}|${row.shift_date.toString()}|${row.timesheet_id}`, row);
|
map.set(`${row.code}|${row.shift_date.toString()}|${row.timesheet_id}`, row);
|
||||||
} else {
|
} else {
|
||||||
const key = `${row.code}|${row.timesheet_id}`;
|
const key = `${row.code}|${row.timesheet_id}`;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user