From 4ae74a0e6ed08cce949b232ea86c44274ffd43b6 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 7 Mar 2024 10:11:11 +0100 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20Update=20=20*=20Berechnungsupda?= =?UTF-8?q?te=20Mehrstunden=20+=20=C3=9Cberstunden=20=20*=20Fix:=20Gewisse?= =?UTF-8?q?=20Buchungskonstellationen=20konnten=20bei=20=C3=84nderungen=20?= =?UTF-8?q?des=20Min=20Feld=20von=20der=20Endzeit=20so=20setzen=20das=20di?= =?UTF-8?q?e=20=C3=9Cberpr=C3=BCfung=20nicht=20Richtig=20ist.=20Des=20min?= =?UTF-8?q?=20Feld=20wird=20nun=20immer=20richtig=20gesetzt.=20(Habs=20sch?= =?UTF-8?q?on=20im=20Live=20gefixt,=20da=20es=20relativ=20akut=20war)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/TimerecordingEmployee/Index.php | 4 ++-- .../Timerecording/TimerecordingController.php | 13 ++++--------- public/js/pages/timerecording/index.js | 2 ++ public/js/pages/timerecordingReport/index.js | 2 ++ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Layout/default/TimerecordingEmployee/Index.php b/Layout/default/TimerecordingEmployee/Index.php index 6d4534690..760210ad2 100644 --- a/Layout/default/TimerecordingEmployee/Index.php +++ b/Layout/default/TimerecordingEmployee/Index.php @@ -97,8 +97,8 @@ $type[3] = "Lehrling"; - id]['overtime_now'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['overtime_now'] / 60 % 60)) ?> - id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> + id]['overtime'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['overtime'] / 60 % 60)) ?> + id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> id]['auto_workinghours'] == '1') ? 'Ja' : 'Nein' ?> $timerecordingemployees[$timerecordinguser->id]['id'], "userid" => $timerecordinguser->id]) ?>">redirect("Timerecording"); } - protected function updateHolidays($userid) + public function updateHolidays($userid) { $employee = TimerecordingEmployeeModel::search(['user_id' => $userid]); if ($employee) { @@ -387,7 +387,7 @@ class TimerecordingController extends mfBaseController } //check if holiday is already in the list foreach ($holidayDays as $key => $holidayDay) { - if ($realholiDay[$key]) { + if (($realholiDay[$key])) { } else if ($workingHours[date('w', strtotime($key))]) { $holidays_now--; @@ -457,6 +457,7 @@ class TimerecordingController extends mfBaseController $plusHours = $employee[0]->plushours_now; $auto_workinghours = $employee[0]->auto_workinghours; $startdate = $employee[0]->startdate; + $overtime = $employee[0]->overtime; } $workinghours = TimerecordingEmployeeWorkingHourModel::search(['user_id' => $userid]); $holidays = TimerecordingHolidayModel::getAll(); @@ -509,11 +510,8 @@ class TimerecordingController extends mfBaseController if (!$holiDay[$dDate] && $dDate >= date('Y-m-d', $startdate)) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } - $timestamp = $timestamp + 86400; } - - } else if ($datatype == 3) { $firstdate = strtotime(date("Y-01-01", $datayear)); $lastdate = strtotime(date("Y-12-31 23:59:59", $datayear)); @@ -528,11 +526,8 @@ class TimerecordingController extends mfBaseController if (!$holiDay[$dDate]) { $mustSeconds = $mustSeconds + $workingHours[$dDay]; } - $timestamp = $timestamp + 86400; } - - } else if ($datatype == 5) { $firstdate = $startime; $lastdate = $endtime; @@ -565,7 +560,6 @@ class TimerecordingController extends mfBaseController $state = ""; $enddate = ""; $sum = "-"; - $day = ""; $orderdate = $timerecording->start; if ($timerecording->timerecordingCategory->hourday == 1) { @@ -742,6 +736,7 @@ class TimerecordingController extends mfBaseController $response['must'] = $mustSeconds; return $response; } else { + $plusHours = $overtime + $plusHours; if ($plusHours < 0) { $plusHours = $plusHours * -1; $plusHours = "-" . sprintf('%02dh:%02dm', floor($plusHours / 3600), floor($plusHours / 60 % 60)); diff --git a/public/js/pages/timerecording/index.js b/public/js/pages/timerecording/index.js index 62dad2845..8d19af624 100644 --- a/public/js/pages/timerecording/index.js +++ b/public/js/pages/timerecording/index.js @@ -270,7 +270,9 @@ $(document).ready(function () { $('#date').val($(this).data('date')); $('#start').val($(this).data('start')); $('#end').val($(this).data('end')); + $('#end').prop("min", $('#start').val()); $('#enddate').val($(this).data('enddate')); + $('#enddate').prop("min", $('#date').val()); $('#comment').val($(this).data('comment')); if ($(this).data('businesstrip') == 1) { $('#businesstrip').prop("checked", true); diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js index 8fc15eedb..780213d81 100644 --- a/public/js/pages/timerecordingReport/index.js +++ b/public/js/pages/timerecordingReport/index.js @@ -303,8 +303,10 @@ $(document).ready(function () { $('#date').val($(this).data('date')); $('#start').val($(this).data('start')); $('#end').val($(this).data('end')); + $('#end').prop("min", $('#start').val()); $('#days').val($(this).data('days')); $('#enddate').val($(this).data('enddate')); + $('#enddate').prop("min", $('#date').val()); $('#comment').val($(this).data('comment')); if ($(this).data('businesstrip') == 1) { $('#businesstrip').prop("checked", true);