added overtime to week report closes #18

This commit is contained in:
2025-09-03 14:30:37 +02:00
parent 1397530cb6
commit 492216b160
4 changed files with 64 additions and 33 deletions

View File

@@ -201,6 +201,11 @@ func (d *WorkDay) GetWorkDayProgress(user User) uint8 {
}
func (d *WorkDay) CalcOvertime(user User) time.Duration {
overtime := d.workTime - time.Duration(user.ArbeitszeitPerTag*float32(time.Hour)).Round(time.Minute)
var overtime time.Duration
// weekday is WE
overtime = d.workTime - time.Duration(user.ArbeitszeitPerTag*float32(time.Hour)).Round(time.Minute)
if (d.Day.Weekday() == 6 || d.Day.Weekday() == 0) && len(d.Bookings) == 0 {
overtime = 0
}
return overtime
}