From cfb0efff629d5a3371f0ae05885bc28c0c2622f3 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 29 Feb 2024 10:01:39 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Zeiterfassung=20Update=20*=20Check=20der=20?= =?UTF-8?q?vorhandenen=20Buchungen=20ge=C3=A4ndert.=20=20*=20Exakte=20?= =?UTF-8?q?=C3=BCberschneidungen=20von=20Start=20und=20Endzeit=20k=C3=B6nn?= =?UTF-8?q?en=20nun=20verbucht=20werden=20und=20muss=20nicht=20die=201=20M?= =?UTF-8?q?inute=20differenz=20haben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/Timerecording/TimerecordingModel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/Timerecording/TimerecordingModel.php b/application/Timerecording/TimerecordingModel.php index 7b83a7a1e..cfd5833e7 100644 --- a/application/Timerecording/TimerecordingModel.php +++ b/application/Timerecording/TimerecordingModel.php @@ -164,7 +164,7 @@ class TimerecordingModel $endtime = $filter['endtime']; $id = $filter['id']; if (is_numeric($starttime) && is_numeric($endtime)) { - $where .= " AND (((`start` <= $starttime AND `end` >= $starttime ) OR (`start` >= $endtime AND `end` <= $endtime) OR (`start` >= $starttime AND `end` >= $starttime AND `start` <= $endtime AND `end` <= $endtime) OR (`start` >= $starttime AND `end` >= $starttime AND `start` <= $endtime AND `end` >= $endtime)) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; + $where .= " AND (((`start` <= $starttime AND `end` > $starttime ) OR (`start` > $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` <= $endtime AND `end` < $endtime) OR (`start` > $starttime AND `end` > $starttime AND `start` < $endtime AND `end` > $endtime) OR (`start` = $starttime AND `end` = $endtime )) OR ( `start` <= $starttime AND `end` IS NULL)) ORDER by user_id ASC"; if ($id && is_numeric($id)) { $where .= " AND `id` != $id"; } From 6e00cc3568881b6d95283e2a3e70a3dae9366bac Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 29 Feb 2024 13:32:24 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Zeiterfassung=20Update=20*=20Check=20der=20?= =?UTF-8?q?vorhandenen=20Buchungen=20ge=C3=A4ndert.=20=20*=20Exakte=20?= =?UTF-8?q?=C3=BCberschneidungen=20von=20Start=20und=20Endzeit=20k=C3=B6nn?= =?UTF-8?q?en=20nun=20verbucht=20werden=20und=20muss=20nicht=20die=201=20M?= =?UTF-8?q?inute=20differenz=20haben=20=20*=20Fix:=20Berechnung=20Mehrstun?= =?UTF-8?q?den=20wenn=20kein=20Startdatum=20festgelegt=20wurde?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/TimerecordingReport/Index.php | 2 +- .../Timerecording/TimerecordingController.php | 12 +++-- public/assets/css/datatables-std.css | 53 +++++++++++-------- public/js/pages/timerecordingReport/index.js | 2 +- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/Layout/default/TimerecordingReport/Index.php b/Layout/default/TimerecordingReport/Index.php index c6af1b85b..497c0cff0 100644 --- a/Layout/default/TimerecordingReport/Index.php +++ b/Layout/default/TimerecordingReport/Index.php @@ -316,7 +316,7 @@ $years[time() - 31536000] = date('Y', time() - 31536000); - + diff --git a/application/Timerecording/TimerecordingController.php b/application/Timerecording/TimerecordingController.php index b52c4943b..86cadc2e3 100644 --- a/application/Timerecording/TimerecordingController.php +++ b/application/Timerecording/TimerecordingController.php @@ -365,7 +365,6 @@ class TimerecordingController extends mfBaseController $data['holidays_now'] = $holidays_now; $employeeupdate->update($data); $employeeupdate->save(); - } } } @@ -386,10 +385,13 @@ class TimerecordingController extends mfBaseController $endtime = date("Y-m-d", $endtime); $endtime = strtotime($endtime . " 23:59:00"); - - $return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime); - $diffTime = $return['is'] - $return['must']; - $plushours_now = $plushours_now + $diffTime; + if ($plushours_timestamp > 0) { + $return = $this->getTimerecordingsApi(5, null, null, null, $plushours_timestamp, $endtime); + $diffTime = $return['is'] - $return['must']; + $plushours_now = $plushours_now + $diffTime; + } else { + $diffTime = 0; + } if ($employee->plushours_now != $diffTime) { $employeeupdate = new TimerecordingEmployee($employee->id); $data = []; diff --git a/public/assets/css/datatables-std.css b/public/assets/css/datatables-std.css index 622aeed0b..06364cc9e 100644 --- a/public/assets/css/datatables-std.css +++ b/public/assets/css/datatables-std.css @@ -125,26 +125,32 @@ table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) { width: unset; display: table-cell; } -.deny-button -{ + +.deny-button { color: #f00; } + .edit-td { text-align: left; letter-spacing: 12px; font-size: 1.1em; } -.display-calendar -{ - color:#0d6efd; + +.display-calendar { + color: #0d6efd; font-size: 30px; - margin-right:10px; + margin-right: 10px; cursor: pointer; } -.active-calendar -{ - color:#25b343; + +.active-calendar { + color: #25b343; } + +.select2-minw { + min-width: 150px; +} + @media (max-width: 1200px) { .fa-circle-xmark, .fa-ban, .fa-trash, .fa-edit, .fa-square-check, .fa-arrows-up-down-left-right { font-size: 25px; @@ -212,17 +218,21 @@ table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) { font-size: 14px; margin: 12px 3px 7px 0px; } - .display-calendar - { - font-size:35px; - margin-top:5px; - margin-right:10px; - margin-bottom:20px; + + .display-calendar { + font-size: 35px; + margin-top: 5px; + margin-right: 10px; + margin-bottom: 20px; } - .label-calendar - { - margin-top:7px; + + .label-calendar { + margin-top: 7px; + } + + .select2-minw { + min-width: unset; } } @@ -270,10 +280,11 @@ table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td:first-child:before transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-box-shadow .15s ease-in-out; } -table.dataTable.table-hover>tbody>tr:hover>* { + +table.dataTable.table-hover > tbody > tr:hover > * { box-shadow: none; } -table.dataTable.table-striped>tbody>tr:nth-of-type(2n+1)>* { - box-shadow: none; +table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * { + box-shadow: none; } \ No newline at end of file diff --git a/public/js/pages/timerecordingReport/index.js b/public/js/pages/timerecordingReport/index.js index 01b13ebd4..e7714c9e5 100644 --- a/public/js/pages/timerecordingReport/index.js +++ b/public/js/pages/timerecordingReport/index.js @@ -35,7 +35,7 @@ $('#filterrow th').each(function (i) { options += ''; }); - $(this).html(''); + $(this).html(''); } else { $(this).html(''); From 8a013745184afa24f1b315e816bee8e0c59f43ce Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 29 Feb 2024 15:19:09 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Zeiterfassung=20Update=20*=20Check=20der=20?= =?UTF-8?q?vorhandenen=20Buchungen=20ge=C3=A4ndert.=20=20*=20Exakte=20?= =?UTF-8?q?=C3=BCberschneidungen=20von=20Start=20und=20Endzeit=20k=C3=B6nn?= =?UTF-8?q?en=20nun=20verbucht=20werden=20und=20muss=20nicht=20die=201=20M?= =?UTF-8?q?inute=20differenz=20haben=20=20*=20Fix:=20Berechnung=20Mehrstun?= =?UTF-8?q?den=20wenn=20kein=20Startdatum=20festgelegt=20wurde=20=20*=20Fi?= =?UTF-8?q?x:=20Arbeitswoche=20verbuchen=20kann=20nur=20mehr=20nach=20Buch?= =?UTF-8?q?ungsstartdatum=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(); + } } } }
MitarbeiterMitarbeiter Datum Von Bis