revert: month Excel FPD column counts N/O as 0 h again

The Excel FPD column is meant to differ from the web FPD check; only
O should behave like N, which it already did. Keeps the D-like colour
for O.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Docker Config Backup
2026-09-22 09:36:18 +02:00
parent 575164d8a1
commit e2da33bc44

View File

@@ -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)