feat : Ajout du système de RTT sur la page employé avec le repport annuel des heures
All checks were successful
Auto Tag Develop / tag (push) Successful in 6s

This commit is contained in:
2026-03-13 10:26:33 +01:00
parent 1858817649
commit 4a2c3a8eed
29 changed files with 1595 additions and 391 deletions

View File

@@ -38,6 +38,35 @@ final class SuspensionDaysCalculator
return $total;
}
/**
* Return adjusted suspensions where the first month of each suspension is excluded (grace period).
*
* @param list<ContractSuspension> $suspensions
*
* @return list<ContractSuspension>
*/
public function applyFirstMonthGrace(array $suspensions): array
{
$adjusted = [];
foreach ($suspensions as $suspension) {
$gracedStart = $suspension->getStartDate()->modify('+1 month');
$end = $suspension->getEndDate();
if ($end instanceof DateTimeImmutable && $gracedStart > $end) {
continue;
}
$copy = new ContractSuspension();
$copy->setStartDate($gracedStart);
$copy->setEndDate($end);
$adjusted[] = $copy;
}
return $adjusted;
}
/**
* Count business days (Mon-Fri, excl. public holidays) suspended within a period.
*