fix(shifts): fix overlaping logic
This commit is contained in:
parent
3741bf3b26
commit
c2203f77cb
|
|
@ -187,8 +187,23 @@ export class ShiftsUpsertService {
|
||||||
select: shift_select,
|
select: shift_select,
|
||||||
});
|
});
|
||||||
|
|
||||||
existing.push({ start_time: row.start_time, end_time: row.end_time });
|
const normalizeHHmm = (value: Date) => toHHmmFromString(toStringFromHHmm(value));
|
||||||
existing_map.set(map_key, existing);
|
|
||||||
|
for (const { timesheet_id, day, key } of timesheet_keys) {
|
||||||
|
const day_date = new Date(day);
|
||||||
|
existing.push({
|
||||||
|
start_time: normalizeHHmm(row.start_time),
|
||||||
|
end_time: normalizeHHmm(row.end_time)
|
||||||
|
});
|
||||||
|
existing_map.set(
|
||||||
|
key,
|
||||||
|
existing.map(row => ({
|
||||||
|
start_time: normalizeHHmm(row.start_time),
|
||||||
|
end_time: normalizeHHmm(row.end_time),
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const {type: bank_type} = await this.typeResolver.findTypeByBankCodeId(row.bank_code_id);
|
const {type: bank_type} = await this.typeResolver.findTypeByBankCodeId(row.bank_code_id);
|
||||||
const summary = await this.overtime.getWeekOvertimeSummary(timesheet_id, normed.date, tx);
|
const summary = await this.overtime.getWeekOvertimeSummary(timesheet_id, normed.date, tx);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user