Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de302d9ded | ||
| ef18210bf7 |
@@ -1,2 +1,2 @@
|
|||||||
parameters:
|
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);
|
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(
|
private function resolveEffectivePeriodStart(
|
||||||
Employee $employee,
|
Employee $employee,
|
||||||
DateTimeImmutable $from,
|
DateTimeImmutable $from,
|
||||||
@@ -778,13 +785,6 @@ final readonly class EmployeeLeaveSummaryProvider implements ProviderInterface
|
|||||||
return null !== $balance ? $balance->getFractionedDays() : 0.0;
|
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
|
private function resolveCurrentLeaveYear(DateTimeImmutable $today): int
|
||||||
{
|
{
|
||||||
$year = (int) $today->format('Y');
|
$year = (int) $today->format('Y');
|
||||||
|
|||||||
@@ -104,6 +104,13 @@ class LeaveRecapPrintProvider implements ProviderInterface
|
|||||||
|
|
||||||
if (null !== $yearSummary) {
|
if (null !== $yearSummary) {
|
||||||
if ($isForfait) {
|
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);
|
$cpN1Remaining = round($yearSummary['previousYearRemainingDays'], 2);
|
||||||
$cpN = (string) round($yearSummary['acquiredDays'], 2);
|
$cpN = (string) round($yearSummary['acquiredDays'], 2);
|
||||||
$acquiredSaturdays = '-';
|
$acquiredSaturdays = '-';
|
||||||
|
|||||||
Reference in New Issue
Block a user