fixes
This commit is contained in:
@@ -146,18 +146,27 @@ function registerVerwaltungRoutes(app) {
|
||||
let vacationHours = 0;
|
||||
|
||||
entries.forEach(entry => {
|
||||
if (entry.total_hours) {
|
||||
totalHours += entry.total_hours;
|
||||
}
|
||||
if (entry.overtime_taken_hours) {
|
||||
overtimeTaken += entry.overtime_taken_hours;
|
||||
}
|
||||
|
||||
// Urlaub hat Priorität - wenn Urlaub, zähle nur Urlaubsstunden, nicht zusätzlich Arbeitsstunden
|
||||
if (entry.vacation_type === 'full') {
|
||||
vacationDays += 1;
|
||||
vacationHours += 8; // Ganzer Tag = 8 Stunden
|
||||
// Bei vollem Tag Urlaub werden keine Arbeitsstunden gezählt
|
||||
} else if (entry.vacation_type === 'half') {
|
||||
vacationDays += 0.5;
|
||||
vacationHours += 4; // Halber Tag = 4 Stunden
|
||||
// Bei halbem Tag Urlaub können noch Arbeitsstunden vorhanden sein
|
||||
if (entry.total_hours) {
|
||||
totalHours += entry.total_hours;
|
||||
}
|
||||
} else {
|
||||
// Kein Urlaub - zähle nur Arbeitsstunden
|
||||
if (entry.total_hours) {
|
||||
totalHours += entry.total_hours;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user