fix : prise en compte de la balance des congés
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-03-10 17:07:09 +01:00
parent 180c108ded
commit 9c164fe78e

View File

@@ -193,6 +193,13 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
$leavePolicy['countOnlyCp'],
$leavePolicy['splitSaturdays']
);
// Bootstrap support: if the opening balance has pre-filled taken days
// (e.g. manual data entry for production bootstrap), add them as an offset.
if (null !== $openingBalance) {
$takenDays += $openingBalance->getTakenDays();
$takenSaturdays += $openingBalance->getTakenSaturdays();
}
if (LeaveRuleCode::CDI_CDD_NON_FORFAIT->value === $leavePolicy['ruleCode']) {
$availableAcquired = max(0.0, $carryDays);
$takenFromAcquired = min($availableAcquired, $takenDays);