From 30409c4a23f733960376f937763f422f907f55d8 Mon Sep 17 00:00:00 2001 From: Spitzer Daniel Date: Thu, 22 Feb 2024 19:08:32 +0100 Subject: [PATCH] =?UTF-8?q?Zeiterfassung=20Update/Bugfix=20*=20Timerecordi?= =?UTF-8?q?ngReportController.php=20verweist=20in=20einer=20gewissen=20Dat?= =?UTF-8?q?enbank-Eintragskonstellation=20auf=20einen=20ung=C3=BCltigen=20?= =?UTF-8?q?Array=20Index.=20Hab=20die=20gesamtsollzeitberechnung=20tempor?= =?UTF-8?q?=C3=A4r=20ausgeschalten=20*=20Neu=20Migration=20(Vorbereiten=20?= =?UTF-8?q?der=20DB=20auf=20eigenes=20=C3=9C-Zeitkonto)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TimerecordingEmployeeModel.php | 3 ++ .../TimerecordingReportController.php | 6 ++-- ...erecording_employee_add_field_overtime.php | 33 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 db/migrations/20240222175444_timerecording_employee_add_field_overtime.php diff --git a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php index 913b19bb1..2de108268 100644 --- a/application/TimerecordingEmployee/TimerecordingEmployeeModel.php +++ b/application/TimerecordingEmployee/TimerecordingEmployeeModel.php @@ -6,7 +6,10 @@ class TimerecordingEmployeeModel private $type; private $auto_workinghours; private $holidays; + private $holidays_now; private $plushours; + private $plushours_now; + private $overtime; private $startdate; diff --git a/application/TimerecordingReport/TimerecordingReportController.php b/application/TimerecordingReport/TimerecordingReportController.php index 0077c2402..c4e3423ae 100644 --- a/application/TimerecordingReport/TimerecordingReportController.php +++ b/application/TimerecordingReport/TimerecordingReportController.php @@ -100,7 +100,7 @@ class TimerecordingReportController extends mfBaseController $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); if (!$holiDay[$dDate]) { - $mustSeconds = $mustSeconds + $workingHours[$dDay]; + // $mustSeconds = $mustSeconds + $workingHours[$dDay]; } $timestamp = $timestamp + 86400; @@ -117,7 +117,7 @@ class TimerecordingReportController extends mfBaseController $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); if (!$holiDay[$dDate]) { - $mustSeconds = $mustSeconds + $workingHours[$dDay]; + // $mustSeconds = $mustSeconds + $workingHours[$dDay]; } $timestamp = $timestamp + 86400; } @@ -133,7 +133,7 @@ class TimerecordingReportController extends mfBaseController $dDate = date('Y-m-d', $timestamp); $dDay = date('w', $timestamp); if (!$holiDay[$dDate]) { - $mustSeconds = $mustSeconds + $workingHours[$dDay]; + //$mustSeconds = $mustSeconds + $workingHours[$dDay]; } $timestamp = $timestamp + 86400; diff --git a/db/migrations/20240222175444_timerecording_employee_add_field_overtime.php b/db/migrations/20240222175444_timerecording_employee_add_field_overtime.php new file mode 100644 index 000000000..dcbb61f15 --- /dev/null +++ b/db/migrations/20240222175444_timerecording_employee_add_field_overtime.php @@ -0,0 +1,33 @@ +getEnvironment() == "thetool") { + $table = $this->table("TimerecordingEmployee", ["signed" => true]); + $table->addColumn("overtime", "integer", ["null" => false, "default" => '0', "after" => "plushours_now"]); + $table->changeColumn('holidays_now', 'integer', ["null" => false, "default" => '0']); + $table->changeColumn('plushours_now', 'integer', ["null" => false, "default" => '0']); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $this->table("TimerecordingEmployee")->removeColumn("overtime")->save(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}