feat : sélecteur d'exercice sur l'onglet RTT de la fiche employé
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Permet de consulter les exercices passés (table hebdomadaire RTT) en réutilisant le pattern de l'onglet Congés. Plage bornée par max(début historique contrat, RTT_START_DATE). Bouton + Payer les RTT verrouillé sur exercices clos. Onglet masqué pour FORFAIT (inchangé). Backend : rttStartDate désormais toujours exposé sur EmployeeRttSummary pour que le sélecteur conserve sa borne lors de la navigation vers un exercice passé. Le masquage existant des lignes Report continue de fonctionner (comparaison mois-à-mois). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -110,14 +110,11 @@ final readonly class EmployeeRttSummaryProvider implements ProviderInterface
|
||||
$summary->currentYearRecoveryMinutes = array_sum(array_map(static fn ($d) => $d->totalMinutes, $currentByWeekStart));
|
||||
$summary->availableMinutes = $summary->carryFromPreviousYearMinutes + $summary->currentYearRecoveryMinutes;
|
||||
|
||||
// Pass rttStartDate only if it falls within this exercise
|
||||
if (null !== $this->rttStartDate) {
|
||||
$startDate = new DateTimeImmutable($this->rttStartDate);
|
||||
if ($startDate >= $periodFrom && $startDate <= $periodTo) {
|
||||
$summary->rttStartDate = $this->rttStartDate;
|
||||
}
|
||||
}
|
||||
$summary->weeks = $this->buildWeekSummaries($weekRanges, $currentByWeekStart, $periodFrom, $periodTo);
|
||||
// Always expose rttStartDate so the frontend can use it as a hard floor
|
||||
// for the year selector. Frontend already uses month-level comparison
|
||||
// to hide carry/report rows when the date is outside the exercise.
|
||||
$summary->rttStartDate = $this->rttStartDate;
|
||||
$summary->weeks = $this->buildWeekSummaries($weekRanges, $currentByWeekStart, $periodFrom, $periodTo);
|
||||
|
||||
// Post-process: distribute deficit weeks across cumulative balance (50% first, then 25%)
|
||||
$cumulative50 = $carry->base50Minutes + $carry->bonus50Minutes;
|
||||
|
||||
Reference in New Issue
Block a user