Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de302d9ded | ||
| ef18210bf7 |
@@ -1,2 +1,2 @@
|
||||
parameters:
|
||||
app.version: '0.1.81'
|
||||
app.version: '0.1.82'
|
||||
|
||||
@@ -330,6 +330,13 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
|
||||
return $this->resolveCurrentLeaveYear($today);
|
||||
}
|
||||
|
||||
public function resolvePaidLeaveDays(Employee $employee, string $ruleCode, int $year): float
|
||||
{
|
||||
$balance = $this->leaveBalanceRepository->findOneByEmployeeRuleAndYear($employee, $ruleCode, $year);
|
||||
|
||||
return null !== $balance ? $balance->getPaidLeaveDays() : 0.0;
|
||||
}
|
||||
|
||||
private function resolveEffectivePeriodStart(
|
||||
Employee $employee,
|
||||
DateTimeImmutable $from,
|
||||
@@ -778,13 +785,6 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
|
||||
return null !== $balance ? $balance->getFractionedDays() : 0.0;
|
||||
}
|
||||
|
||||
private function resolvePaidLeaveDays(Employee $employee, string $ruleCode, int $year): float
|
||||
{
|
||||
$balance = $this->leaveBalanceRepository->findOneByEmployeeRuleAndYear($employee, $ruleCode, $year);
|
||||
|
||||
return null !== $balance ? $balance->getPaidLeaveDays() : 0.0;
|
||||
}
|
||||
|
||||
private function resolveCurrentLeaveYear(DateTimeImmutable $today): int
|
||||
{
|
||||
$year = (int) $today->format('Y');
|
||||
|
||||
@@ -104,6 +104,13 @@ class LeaveRecapPrintProvider implements ProviderInterface
|
||||
|
||||
if (null !== $yearSummary) {
|
||||
if ($isForfait) {
|
||||
$paidLeaveDays = $this->leaveSummaryProvider->resolvePaidLeaveDays($employee, $yearSummary['ruleCode'], $leaveYear);
|
||||
if ($paidLeaveDays > 0.0) {
|
||||
$recomputed = $this->leaveSummaryProvider->computeYearSummary($employee, $leaveYear, $paidLeaveDays);
|
||||
if (null !== $recomputed) {
|
||||
$yearSummary = $recomputed;
|
||||
}
|
||||
}
|
||||
$cpN1Remaining = round($yearSummary['previousYearRemainingDays'], 2);
|
||||
$cpN = (string) round($yearSummary['acquiredDays'], 2);
|
||||
$acquiredSaturdays = '-';
|
||||
|
||||
Reference in New Issue
Block a user