Zeiterfassung Update

* Berechnungen für Austritte implementiert.
This commit is contained in:
Spitzer Daniel
2024-04-26 12:29:01 +02:00
parent b3fcd1f6e8
commit 5a6224df9f
2 changed files with 23 additions and 6 deletions

View File

@@ -411,6 +411,11 @@ class TimerecordingReportController extends mfBaseController
$overtime_now = $employee[0]->overtime_now;
$auto_workinghours = $employee[0]->auto_workinghours;
$startdate = $employee[0]->startdate;
if ($employee[0]->enddate) {
$enddate = strtotime(date('Y-m-d', $employee[0]->enddate) . " 23:59:59");
} else {
$enddate = 2208985200;
}
$bpahours = $employee[0]->bpahours;
}
$workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $user_id]);
@@ -445,7 +450,7 @@ class TimerecordingReportController extends mfBaseController
$dDate = date('Y-m-d', $timestamp);
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$mustSeconds = $mustSeconds + $workingHours[$dDay];
}
@@ -466,7 +471,7 @@ class TimerecordingReportController extends mfBaseController
for ($i = 1; $i <= $daycount; $i++) {
$dDate = date('Y-m-d', $timestamp);
$dDay = date('w', $timestamp);
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) {
if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate) && $dDate <= date('Y-m-d', $enddate)) {
$mustSeconds = $mustSeconds + $workingHours[$dDay];
}