Zeiterfassung Update

* Nachtzulage wurde in der Personaladministration hinzugefügt
* Bei der Verrechnung werden Ü100 wenn Nachtzulage aktiv ist anders bewertet
This commit is contained in:
Daniel Spitzer
2025-10-11 18:29:53 +02:00
parent 06a148c915
commit e4a1e2a85e
5 changed files with 508 additions and 443 deletions

View File

@@ -564,7 +564,7 @@ class TimerecordingReportController extends mfBaseController
die();
}
private function checkOvertime($timerecording)
private function checkOvertime($timerecording,$night_allowance=0)
{
$start = $timerecording->start;
$end = $timerecording->end;
@@ -583,10 +583,10 @@ class TimerecordingReportController extends mfBaseController
$end = $timerecording->end;
$startday = date('Y-m-d', $start);
if (date('w', $start) == 0 || $holiDay[$startday]) {
if ((date('w', $start) == 0 || $holiDay[$startday]) && $night_allowance==0) {
$O100free = $O100free + $timerecording->end - $timerecording->start;
} else {
if ($start < $O100end || $start > $O100start || $end < $O100end || $end > $O100start) {
if (($start < $O100end || $start > $O100start || $end < $O100end || $end > $O100start) && $night_allowance==0) {
$sum = $end - $start;
if ($sum >= 10800) {
if ($start < $O100end) {
@@ -653,6 +653,7 @@ class TimerecordingReportController extends mfBaseController
$plusHours_now = $employee[0]->plushours_now;
$overtime_now = $employee[0]->overtime_now;
$auto_workinghours = $employee[0]->auto_workinghours;
$night_allowance= $employee[0]->night_allowance;
$startdate = $employee[0]->startdate;
if ($employee[0]->enddate) {
$enddate = strtotime(date('Y-m-d', $employee[0]->enddate) . " 23:59:59");
@@ -885,7 +886,7 @@ class TimerecordingReportController extends mfBaseController
$nlzTimes[$timerecording->id]['category'] = $timerecording->timerecordingCategory->name;
$nlzTimes[$timerecording->id]['categoryshort'] = $timerecording->timerecordingCategory->short;
} else {
$overtimes = $this->checkOvertime($timerecording);
$overtimes = $this->checkOvertime($timerecording,$night_allowance);
$isSecondscleanarray[$timerecording->timerecordingCategory->short] = $isSecondscleanarray[$timerecording->timerecordingCategory->short] - $overtimes['sum'];
if ($employee->only_admin != 1) {