Gestion du changement de type de contrat + correction du calcule des RTT sur un contrat qui commence en milieu de semaine #19
@@ -413,10 +413,17 @@ final readonly class RttRecoveryComputationService
|
|||||||
{
|
{
|
||||||
$total = 0;
|
$total = 0;
|
||||||
foreach ($days as $date) {
|
foreach ($days as $date) {
|
||||||
$isoDay = (int) new DateTimeImmutable($date)->format('N');
|
$isoDay = (int) new DateTimeImmutable($date)->format('N');
|
||||||
$contract = $contractsByDate[$date] ?? null;
|
$contract = $contractsByDate[$date] ?? null;
|
||||||
$hours = $contract?->getWeeklyHours();
|
$hours = $contract?->getWeeklyHours();
|
||||||
$startHours = (null !== $hours && $hours >= 39) ? 39 : 35;
|
// 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);
|
$total += $this->resolveDailyReferenceMinutes($startHours, $isoDay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user