fix: correct name to Kópáček Ondřej; O (otcovská) looks like D, counts like N
The new worker's surname was misheard: Kropáček → Kópáček everywhere (default data, both Excel templates, export rosters). The person id tkb-kropacek is kept. The server now normalises the name in stored files at startup and in every incoming save, so clients that still hold the old name cannot write it back. "O" (otcovská dovolená) is now rendered in the same yellow as "D" in the app and the month Excel, labelled "Otcovská dovolená", and for the FPD balance a working-day O is credited like N (a normal worked day) both in the web FPD check and in the month Excel's FPD column, which previously counted N and O as zero and disagreed with the web. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -26,7 +26,7 @@ CELL_COLORS = {
|
||||
'A': 'FFE082', 'B': 'B0BEC5',
|
||||
'D': 'FFFF00', 'D/2': 'FFF9C4',
|
||||
'N': 'FF4444', 'U': '92D050',
|
||||
'O': 'FFC000', 'x': 'E0E0E0',
|
||||
'O': 'FFFF00', 'x': 'E0E0E0', # O = otcovská: same look as D
|
||||
}
|
||||
|
||||
# Czech weekday names indexed by Python's weekday() (Monday=0)
|
||||
@@ -36,7 +36,7 @@ CZECH_DAYS = ['Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota',
|
||||
TKB_ROWS = {
|
||||
'Pauzer Libor': 7, 'Vörös Pavel': 8, 'Janouš Petr': 9,
|
||||
'Franek Lukáš': 10, 'Svoboda Daniel': 11, 'Dvořák Václav': 12,
|
||||
'Kropáček Ondřej': 13,
|
||||
'Kópáček Ondřej': 13,
|
||||
'Vondrák Pavel': 14, 'Čeleda Olda': 15, 'Hanzlík Marek': 16,
|
||||
'Kohl David': 17, 'Dittrich Vladimír': 18, 'Toman Milan': 19,
|
||||
'Zábranský Petr': 20, 'Žemlička Miroslav': 21, 'Teslík Hynek': 22,
|
||||
@@ -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,6 +442,11 @@ 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:
|
||||
worked += hours_for(v)
|
||||
for d in schedule['dayIndex']:
|
||||
@@ -450,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)
|
||||
|
||||
Reference in New Issue
Block a user