diff --git a/backend/src/services/TimeEntryService.js b/backend/src/services/TimeEntryService.js index 8744170..1688d81 100644 --- a/backend/src/services/TimeEntryService.js +++ b/backend/src/services/TimeEntryService.js @@ -500,6 +500,8 @@ class TimeEntryService { // Berechne Überstunden für die aktuelle Woche const weekData = await this.getWeekOverview(uid, 0); + console.log(`🔍 Wochenüberstunden-Berechnung START: userDailyHours=${userDailyHours}`); + let weekSollMinutes = 0; // Soll-Arbeitszeit für die Woche let weekIstMinutes = 0; // Ist-Arbeitszeit für die Woche @@ -584,13 +586,17 @@ class TimeEntryService { }); let daySollHours = userDailyHours; // Fallback: User's daily_hours + console.log(` Tag ${day.date}: userDailyHours=${userDailyHours}, applicableTimewish=${applicableTimewish ? applicableTimewish.hours + 'h' : 'keine'}`); + if (applicableTimewish && applicableTimewish.wishtype === 2 && applicableTimewish.hours) { daySollHours = applicableTimewish.hours; + console.log(` → Verwende Timewish: ${daySollHours}h`); } // Bei halbem Urlaubstag: Soll halbiert if (day.vacation && day.vacation.halfDay) { daySollHours = daySollHours / 2; + console.log(` → Halber Urlaubstag: ${daySollHours}h`); } weekSollMinutes += daySollHours * 60; diff --git a/frontend/src/views/Calendar.vue b/frontend/src/views/Calendar.vue index 4e0e9b9..ba07687 100644 --- a/frontend/src/views/Calendar.vue +++ b/frontend/src/views/Calendar.vue @@ -76,7 +76,9 @@