Gestion du changement de type de contrat + correction du calcule des RTT sur un contrat qui commence en milieu de semaine #19

Merged
tristan merged 55 commits from feat/contract-phase-view-selector into develop 2026-05-22 06:42:33 +00:00
Showing only changes of commit 750f2bffa8 - Show all commits

View File

@@ -413,10 +413,17 @@ final readonly class RttRecoveryComputationService
{
$total = 0;
foreach ($days as $date) {
$isoDay = (int) new DateTimeImmutable($date)->format('N');
$contract = $contractsByDate[$date] ?? null;
$hours = $contract?->getWeeklyHours();
$startHours = (null !== $hours && $hours >= 39) ? 39 : 35;
$isoDay = (int) new DateTimeImmutable($date)->format('N');
$contract = $contractsByDate[$date] ?? null;
$hours = $contract?->getWeeklyHours();
// Days without an active contract (pre-hire, post-termination, contract
// gaps) must NOT contribute to the weekly 25% overtime threshold —
// otherwise hiring mid-week artificially inflates the threshold and
// erases legitimate overtime.
if (null === $hours || $hours <= 0) {
continue;
}
$startHours = $hours >= 39 ? 39 : 35;
$total += $this->resolveDailyReferenceMinutes($startHours, $isoDay);
}