Fixed RecreationDays Compensation

This commit is contained in:
2025-11-10 13:50:30 +01:00
parent c1dc88cdd9
commit 8a88c6878e

View File

@@ -39,7 +39,7 @@ export async function generateTimesEvaluation(
.select("date")
.in("state_code", [profile.state_code, "DE"])
.gte("date", startDate.format("YYYY-MM-DD"))
.lte("date", endDate.format("YYYY-MM-DD"))
.lte("date", endDate.add(1,"day").format("YYYY-MM-DD"))
if (holidaysError) throw new Error("Fehler beim Laden der Feiertage: " + holidaysError.message)
@@ -70,7 +70,7 @@ export async function generateTimesEvaluation(
let sumWorkingMinutesRecreationDays = 0
let sumRecreationDays = 0
if (profile.recreationDaysCompensation && holidays?.length) {
if (profile.recreation_days_compensation && holidays?.length) {
holidays.forEach(({ date }) => {
const weekday = server.dayjs(date).day()
const hours = profile.weekly_regular_working_hours?.[weekday] || 0