diff --git a/app/calcul.py b/app/calcul.py index 66d2476..5df373d 100644 --- a/app/calcul.py +++ b/app/calcul.py @@ -131,6 +131,8 @@ def compute_week(pointages: list[dict], conges: list[dict], heures_jour_min: int for jour in jours: jour["cible_matin"] = None jour["cible_aprem"] = None + jour["cible_matin_entree"] = None + jour["cible_aprem_entree"] = None restant = total_du - total_travaille @@ -204,8 +206,14 @@ def compute_week(pointages: list[dict], conges: list[dict], heures_jour_min: int continue # rythme normal suffit pour cette demi-journée, rien à signaler sortie_min = s["debut"] + s["nominal"] + adjs[i] sortie_min = max(sortie_min, matin_fin_min if s["half"] == "matin" else aprem_fin_min) - cible = f"{sortie_min // 60:02d}:{sortie_min % 60:02d}" - s["jour"]["cible_matin" if s["half"] == "matin" else "cible_aprem"] = cible + entree = f"{s['debut'] // 60:02d}:{s['debut'] % 60:02d}" + sortie = f"{sortie_min // 60:02d}:{sortie_min % 60:02d}" + if s["half"] == "matin": + s["jour"]["cible_matin_entree"] = entree + s["jour"]["cible_matin"] = sortie + else: + s["jour"]["cible_aprem_entree"] = entree + s["jour"]["cible_aprem"] = sortie reste_min = max(0, restant) diff --git a/app/main.py b/app/main.py index ae4757f..7e7b2d1 100644 --- a/app/main.py +++ b/app/main.py @@ -166,9 +166,9 @@ def _oob_week_extras(result): html += f'{cumul_inner}' parts = [] if jour.get("cible_matin"): - parts.append(f'M {jour["cible_matin"]}') + parts.append(f'M {jour["cible_matin_entree"]} → {jour["cible_matin"]}') if jour.get("cible_aprem"): - parts.append(f'A {jour["cible_aprem"]}') + parts.append(f'A {jour["cible_aprem_entree"]} → {jour["cible_aprem"]}') cible_inner = " ".join(parts) if parts else '—' html += f'{cible_inner}' return html diff --git a/app/templates/_ligne.html b/app/templates/_ligne.html index f444f52..73b399d 100644 --- a/app/templates/_ligne.html +++ b/app/templates/_ligne.html @@ -70,9 +70,9 @@