This commit is contained in:
Ross
2022-01-15 08:45:43 +00:00
parent 2040499145
commit 85c1344737
6 changed files with 305 additions and 197 deletions
+12 -2
View File
@@ -35,7 +35,8 @@ def load_leave(Rota, use_live_rota):
workers[name]["leave"] = []
workers[name]["requests"] = []
workers[name]["site_pref"] = []
workers[name]["shift_balance_extra"]
workers[name]["shift_balance_extra"] = {}
workers[name]["bank_holiday_extra"] = 0
for i in range(len(r)):
try:
@@ -88,7 +89,16 @@ def load_leave(Rota, use_live_rota):
elif row_title.startswith("Extra_"):
if lower_item:
shift = row_title[len("Extra_") :]
worker["shift_balance_extra"] = shift
if shift == "twilight":
shift = f"{worker['site']}_{shift}"
elif shift == "weekend":
shift = f"weekend_{worker['site']}"
worker["shift_balance_extra"][shift] = float(lower_item)
elif row_title == "bank_holidays_worked":
if lower_item:
print("BH", lower_item)
worker["bank_holiday_extra"] = int(lower_item)
elif re.match(date_re, row_title) is not None: