feat : ajout colonne Cumul sur l'écran RTT (#18)
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
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:
@@ -17,5 +17,6 @@ final class EmployeeRttWeekSummary
|
||||
public int $base50Minutes = 0,
|
||||
public int $bonus50Minutes = 0,
|
||||
public int $totalMinutes = 0,
|
||||
public int $cumulativeBalanceMinutes = 0,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user