From fabdc70a7dec43859c926917ef2b4fdc01d74ad6 Mon Sep 17 00:00:00 2001
From: Benedikt Tissot <benedikt@tissot.de>
Date: Fri, 7 Jun 2019 11:01:48 +0200
Subject: [PATCH] fix small regression due to wrong total working time

---
 python/arbeitsstundenzettel.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/python/arbeitsstundenzettel.py b/python/arbeitsstundenzettel.py
index 462b1f0..78cfe26 100644
--- a/python/arbeitsstundenzettel.py
+++ b/python/arbeitsstundenzettel.py
@@ -342,12 +342,14 @@ Example Meaning: Those three dates are treated like public holidays.
             workingday         = date_list[i]
 
             make_up_duration   = 0.0
+            used_workinghours = 0
 
             if workingday.weekday() in fixed_times_weekdays:
                 tstart, tlength = fixed_times_weekdays[workingday.weekday()]
                 make_up_start_time = tstart
                 make_up_end_time   = random.randint(tstart+tlength,20)
                 make_up_duration = tlength
+                used_workinghours += tlength
             else:
                 make_up_start_time = random.randint(start_time_earliest,start_time_latest)
                 make_up_end_time   = random.randint(16,20)
@@ -375,7 +377,7 @@ Example Meaning: Those three dates are treated like public holidays.
             preset_workingday = [workingday[0] for workingday in make_up_workinghours].index(preset_workingday)
             make_up_workinghours, made_up_workinghours = move_filled_day(make_up_workinghours, preset_workingday, made_up_workinghours)
 
-        used_workinghours = 0 + sum(preset_list[1])
+        used_workinghours += sum(preset_list[1])
 
         while (used_workinghours < workhours_total):
 
-- 
GitLab