diff --git a/web/export_full_excel.py b/web/export_full_excel.py index 68b5e75..c1ed251 100644 --- a/web/export_full_excel.py +++ b/web/export_full_excel.py @@ -434,7 +434,7 @@ def main(): continue worked = 0.0 vacation = 0.0 # D = 8h, D/2 = 4h — reduces person's FPD target - def collect(v, is_workday): + def collect(v): nonlocal worked, vacation if not v: return @@ -442,12 +442,9 @@ def main(): vacation += 8 elif v == 'D/2': vacation += 4 - elif v in ('N', 'O'): - # sick / paternity leave on a working day is credited as a normal - # worked day, so it neither helps nor hurts the balance (as in FpdCheck.tsx) - if is_workday: - worked += 8 else: + # N and O (like U, x) count as 0 hours here — intentionally different + # from the web FPD check, which credits them as a worked day. worked += hours_for(v) for d in schedule['dayIndex']: if d['year'] != year or d['month'] != month: @@ -455,14 +452,13 @@ def main(): cd = person['data'].get(str(d['idx'])) if not cd: continue - is_workday = not d.get('weekend') and (d['month'], d['day']) not in holidays is_split = bool(cd.get('dayColor') or cd.get('nightColor') or cd.get('dayValue') or cd.get('nightValue')) if is_split: - collect(cd.get('dayValue'), is_workday) - collect(cd.get('nightValue'), is_workday) + collect(cd.get('dayValue')) + collect(cd.get('nightValue')) else: - collect(cd.get('v'), is_workday) + collect(cd.get('v')) person_fpd = month_fpd - vacation diff = worked - person_fpd dst = ws.cell(row, 72)