Skip to content

Commit 7a674a5

Browse files
authored
Merge pull request #36 from eporsche/fix_half_day_vacation
Fix half day vacation
2 parents 2f45202 + 841c150 commit 7a674a5

File tree

4 files changed

+1601
-903
lines changed

4 files changed

+1601
-903
lines changed

app/AbsenceCalendar/EmployeeAbsenceCalendar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ protected function calculatePaidHours()
8585
if ($this->startAndEndDayAreSame()) {
8686
$calcHours = BigDecimal::of($this->startDay->diffInMinutes($this->endDay))
8787
->dividedBy('60', 2, RoundingMode::HALF_EVEN);
88+
// dd($calcHours);
8889
return $calcHours->isGreaterThanOrEqualTo($absenceDay->getTargetHours()) ?
8990
$absenceDay->getTargetHours() : $calcHours;
9091
}
@@ -131,7 +132,7 @@ protected function isHalfDayVacation(Carbon $date)
131132
$diffInHours = $this->diffHoursToStartOrEndOfDay($date);
132133
}
133134

134-
return $diffInHours->isLessThan(
135+
return $diffInHours->isLessThanOrEqualTo(
135136
$this->employee
136137
->targetHoursForDate($date)
137138
->dividedBy('2', 2, RoundingMode::HALF_EVEN)

0 commit comments

Comments
 (0)