Merge remote-tracking branch 'origin/main'

# Conflicts:
#	app/calcul.py
This commit is contained in:
Antoine
2026-08-06 17:18:00 +02:00
19 changed files with 2097 additions and 123 deletions

View File

@ -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
@ -218,11 +220,23 @@ def compute_week(pointages: list[dict], conges: list[dict], heures_jour_min: int
adjs[i] -= take
left -= take
# Le matin propose toujours son horaire nominal (jamais ajusté par le rattrapage
# hebdomadaire) ; l'après-midi propose son horaire nominal éventuellement décalé
# par l'écart (retard ou avance) réparti ci-dessus.
for s in slots:
if s["half"] != "matin":
continue
# Pas de plancher matin_fin ici : le nominal est déjà borné par cap (≤ matin_fin
# - debut), donc debut + nominal ne peut pas dépasser matin_fin de lui-même.
sortie_min = s["debut"] + s["nominal"]
entree = f"{s['debut'] // 60:02d}:{s['debut'] % 60:02d}"
s["jour"]["cible_matin_entree"] = entree
s["jour"]["cible_matin"] = f"{sortie_min // 60:02d}:{sortie_min % 60:02d}"
for i, s in enumerate(aprem_slots):
if adjs[i] == 0:
continue # rythme normal suffit pour cette demi-journée, rien à signaler
sortie_min = s["debut"] + s["nominal"] + adjs[i]
sortie_min = max(sortie_min, aprem_fin_min)
sortie_min = max(s["debut"] + s["nominal"] + adjs[i], aprem_fin_min)
entree = f"{s['debut'] // 60:02d}:{s['debut'] % 60:02d}"
s["jour"]["cible_aprem_entree"] = entree
s["jour"]["cible_aprem"] = f"{sortie_min // 60:02d}:{sortie_min % 60:02d}"
extra_total = max(0, ecart_total)