added overtime to week report closes #18
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user