Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3994be6556 | ||
| f46eeaa893 | |||
|
|
eb703272c7 | ||
| 6629eb98cb |
@@ -1,2 +1,2 @@
|
||||
parameters:
|
||||
app.version: '0.1.22'
|
||||
app.version: '0.1.24'
|
||||
|
||||
@@ -349,14 +349,25 @@ final readonly class LeaveBalanceComputationService
|
||||
}
|
||||
|
||||
for ($cursor = $rangeStart; $cursor <= $rangeEnd; $cursor = $cursor->modify('+1 day')) {
|
||||
$dayOfWeek = (int) $cursor->format('N');
|
||||
|
||||
if ($splitSaturdays) {
|
||||
if (7 === $dayOfWeek) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if ($dayOfWeek >= 6) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
[$am, $pm] = $this->resolveSegmentsForDate($absence, $cursor->format('Y-m-d'));
|
||||
$dayAmount = ($am ? 0.5 : 0.0) + ($pm ? 0.5 : 0.0);
|
||||
if ($dayAmount <= 0.0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$isSaturday = $splitSaturdays && '6' === $cursor->format('N');
|
||||
if ($isSaturday) {
|
||||
if ($splitSaturdays && 6 === $dayOfWeek) {
|
||||
$takenSaturdays += $dayAmount;
|
||||
} else {
|
||||
$takenDays += $dayAmount;
|
||||
|
||||
@@ -163,7 +163,7 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
|
||||
|
||||
$effectiveFrom = $this->resolveEffectivePeriodStart($employee, $from, $to);
|
||||
$hasShiftedStart = $effectiveFrom > $from;
|
||||
if ($hasShiftedStart) {
|
||||
if ($hasShiftedStart && null === $openingBalance) {
|
||||
$carryDays = 0.0;
|
||||
$carrySaturdays = 0.0;
|
||||
}
|
||||
@@ -632,14 +632,27 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
|
||||
}
|
||||
|
||||
for ($cursor = $rangeStart; $cursor <= $rangeEnd; $cursor = $cursor->modify('+1 day')) {
|
||||
$dayOfWeek = (int) $cursor->format('N');
|
||||
|
||||
if ($splitSaturdays) {
|
||||
// Mode CDI/CDD : dimanche ignoré, samedi compté séparément.
|
||||
if (7 === $dayOfWeek) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// Mode forfait : seuls les jours ouvrés (lun-ven) comptent.
|
||||
if ($dayOfWeek >= 6) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
[$am, $pm] = $this->resolveSegmentsForDate($absence, $cursor->format('Y-m-d'));
|
||||
$dayAmount = ($am ? 0.5 : 0.0) + ($pm ? 0.5 : 0.0);
|
||||
if ($dayAmount <= 0.0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$isSaturday = $splitSaturdays && '6' === $cursor->format('N');
|
||||
if ($isSaturday && $splitSaturdays) {
|
||||
if ($splitSaturdays && 6 === $dayOfWeek) {
|
||||
$takenSaturdays += $dayAmount;
|
||||
} else {
|
||||
$takenDays += $dayAmount;
|
||||
|
||||
Reference in New Issue
Block a user