From c2209561469cbf3459b55dacd5a69f0a1c9c2f31 Mon Sep 17 00:00:00 2001 From: Docker Config Backup Date: Tue, 22 Sep 2026 09:42:16 +0200 Subject: [PATCH] feat: month Excel FPD column matches the web FPD check for N and O Restores the rule from 707e18c: a working-day N or O is credited as a worked day (8 h) in the FPD column of the Excel exported by the "Excel" button, the same as the web FPD check. Reverts e2da33b. Co-Authored-By: Claude Fable 5.1 --- web/export_full_excel.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/web/export_full_excel.py b/web/export_full_excel.py index c1ed251..68b5e75 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): + def collect(v, is_workday): nonlocal worked, vacation if not v: return @@ -442,9 +442,12 @@ 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: @@ -452,13 +455,14 @@ 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')) - collect(cd.get('nightValue')) + collect(cd.get('dayValue'), is_workday) + collect(cd.get('nightValue'), is_workday) else: - collect(cd.get('v')) + collect(cd.get('v'), is_workday) person_fpd = month_fpd - vacation diff = worked - person_fpd dst = ws.cell(row, 72)