added worktime base to work time calculations
Some checks failed
Tests / Run Go Tests (push) Failing after 1m4s

This commit is contained in:
2025-10-31 23:57:42 +01:00
parent ac59d2642f
commit 7e5eaebca9
4 changed files with 171 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func convertDaysToTypst(days []models.IWorkDay, u models.User) ([]typstDay, erro
var typstDays []typstDay
for _, day := range days {
var thisTypstDay typstDay
work, pause, overtime := day.GetAllWorkTimesVirtual(u)
work, pause, overtime := day.GetTimesVirtual(u, models.WorktimeBaseWeek)
thisTypstDay.Date = day.Date().Format(DE_DATE)
thisTypstDay.Worktime = helper.FormatDurationFill(work, true)
thisTypstDay.Pausetime = helper.FormatDurationFill(pause, true)
@@ -129,6 +129,8 @@ func createEmployeReport(employee models.User, startDate, endDate time.Time) (by
targetHours := (employee.ArbeitszeitProWoche() / 5) * time.Duration(helper.GetWorkingDays(startDate, endDate))
workingDays := models.GetDays(employee, startDate, endDate, false)
slog.Debug("Baseline Working hours", "targetHours", targetHours.Hours())
var actualHours time.Duration
for _, day := range workingDays {
actualHours += day.TimeWorkVirtual(employee)