feat : ajout colonne Cumul sur l'écran RTT (#18)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

Affiche le solde RTT à la fin de chaque semaine (report N-1 + somme
totalMinutes des semaines − paiements des mois antérieurs). Permet la
comparaison ligne à ligne avec un suivi RH externe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

| Numéro du ticket | Titre du ticket |
|------------------|-----------------|
|                  |                 |

## Description de la PR

## Modification du .env

## Check list

- [ ] Pas de régression
- [ ] TU/TI/TF rédigée
- [ ] TU/TI/TF OK
- [ ] CHANGELOG modifié

Reviewed-on: #18
Co-authored-by: tristan <tristan@yuno.malio.fr>
Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #18.
This commit is contained in:
2026-04-29 09:43:46 +00:00
committed by Autin
parent 973de2d094
commit 13eeeb9c86
6 changed files with 40 additions and 13 deletions

View File

@@ -17,5 +17,6 @@ final class EmployeeRttWeekSummary
public int $base50Minutes = 0,
public int $bonus50Minutes = 0,
public int $totalMinutes = 0,
public int $cumulativeBalanceMinutes = 0,
) {}
}

View File

@@ -164,6 +164,18 @@ final readonly class EmployeeRttSummaryProvider implements ProviderInterface
$monthBuckets[$m]['bonus50'] += $payment->getBonus50Minutes();
}
$runningCumul = $summary->carryFromPreviousYearMinutes;
$prevMonth = null;
foreach ($summary->weeks as $week) {
if (null !== $prevMonth && $week->month !== $prevMonth && isset($monthBuckets[$prevMonth])) {
$b = $monthBuckets[$prevMonth];
$runningCumul -= $b['base25'] + $b['bonus25'] + $b['base50'] + $b['bonus50'];
}
$runningCumul += $week->totalMinutes;
$week->cumulativeBalanceMinutes = $runningCumul;
$prevMonth = $week->month;
}
$monthPayments = [];
$totalPaidMinutes = 0;