From 8a013745184afa24f1b315e816bee8e0c59f43ce Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 29 Feb 2024 15:19:09 +0100 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20Update=20*=20Check=20der=20vorh?= =?UTF-8?q?andenen=20Buchungen=20ge=C3=A4ndert.=20=20*=20Exakte=20=C3=BCbe?= =?UTF-8?q?rschneidungen=20von=20Start=20und=20Endzeit=20k=C3=B6nnen=20nun?= =?UTF-8?q?=20verbucht=20werden=20und=20muss=20nicht=20die=201=20Minute=20?= =?UTF-8?q?differenz=20haben=20=20*=20Fix:=20Berechnung=20Mehrstunden=20we?= =?UTF-8?q?nn=20kein=20Startdatum=20festgelegt=20wurde=20=20*=20Fix:=20Arb?= =?UTF-8?q?eitswoche=20verbuchen=20kann=20nur=20mehr=20nach=20Buchungsstar?= =?UTF-8?q?tdatum=20passieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Timerecording/TimerecordingController.php | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index 86cadc2e3..df79da385 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -723,21 +723,24 @@ class TimerecordingController extends mfBaseController if (!$holiDay[$dDate]) { if ($workingHours[$dDay]) { foreach ($workingHours[$dDay] as $workingHour) { + $starttime = strtotime($dDate . " " . $workingHour['start'] . ":00"); $endtime = strtotime($dDate . " " . $workingHour['end'] . ":00"); $check = $this->checkTimerecording($starttime, $endtime); - if ($check['state'] == "success") { - $update = 1; - $data = []; - $data['user_id'] = $this->me->id; - $data['start'] = $starttime; - $data['end'] = $endtime; - $data['timerecordingCategory_id'] = 1; - $data['comment'] = "Automatisch eingetragen"; - $data['businesstrip'] = 0; - $data['businesstrip_info'] = NULL; - $timerecordings = TimerecordingModel::create($data); - $id = $timerecordings->save(); + if ($employee[0]->startdate <= $starttime) { + if ($check['state'] == "success") { + $update = 1; + $data = []; + $data['user_id'] = $this->me->id; + $data['start'] = $starttime; + $data['end'] = $endtime; + $data['timerecordingCategory_id'] = 1; + $data['comment'] = "Automatisch eingetragen"; + $data['businesstrip'] = 0; + $data['businesstrip_info'] = NULL; + $timerecordings = TimerecordingModel::create($data); + $id = $timerecordings->save(); + } } } }