fix(rtt) : do not cap periodFrom at phase.startDate

The RTT week table was hiding all weeks before the phase's startDate,
so for an employee hired mid-exercise (e.g. Dylan CHABOISSON, CDD
starting 2026-03-19) March displayed only from week 12 instead of
week 9, with no visible padding for the pre-hire weeks of the exercise.

Mirrors the same fix applied to the leave provider: the exercise unit
for RTT is annual (Juin→Mai). Capping periodFrom artificially clipped
the displayed weeks. Days without a contract naturally contribute 0
minutes (no reference, no worked hours), so the cumul is correct
without the cap.

periodTo and limitDate caps at phase.endDate are preserved for closed
phases so the table doesn't extend past the phase end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-19 15:08:29 +02:00
parent 54d9a30f71
commit 653845655f
3 changed files with 9 additions and 6 deletions

View File

@@ -90,7 +90,7 @@
- Exposé via `Employee.contractPhases` (`employee:read`). Endpoints `GET /employees/{id}/leave-summary` et `GET /employees/{id}/rtt-summary` acceptent `?phaseId=N` ; défaut = phase courante.
- Sélectionner une phase passée :
- Onglet **Congés** : période et règles de la phase (Juin→Mai non-forfait, Jan→Déc FORFAIT). Exercice de transition capé sur `phase.endDate`. **Cap `from` au `phase.startDate` uniquement pour FORFAIT** (sémantique année civile). Pour le non-forfait, l'exercice CP reste annuel et continu à travers les changements d'heures (35h→39h, etc.) — seul `resolveEffectivePeriodStart` clampe sur la date d'entrée en contrat des nouveaux embauchés.
- Onglet **RTT** : visible ssi `phase.contractType !== FORFAIT`. `+ Payer les RTT` actif uniquement sur l'exercice contenant `phase.endDate`.
- Onglet **RTT** : visible ssi `phase.contractType !== FORFAIT`. Tableau hebdo affiché sur l'exercice complet (Juin→Mai) ; `periodFrom` non capé sur `phase.startDate` (les semaines avant embauche ou hors phase apparaissent à 0). `periodTo`/`limitDate` capés sur `phase.endDate` pour les phases clôturées. `+ Payer les RTT` actif uniquement sur l'exercice contenant `phase.endDate`.
- Bandeau jaune affiché en mode phase passée. Édition d'absences et des stocks de report (jours fractionnés, Année N-1 payés) désactivée.
- Sélection non persistée — chaque ouverture de fiche démarre sur la phase courante.
- CP : solder via `EmployeeContractPeriod.paidLeaveSettledClosureDate` (mécanisme existant). RTT : créer un `EmployeeRttPayment` sur le dernier exercice de la phase.