Zeiterfassung Update/Bugfix

* TimerecordingReportController.php verweist in einer gewissen Datenbank-Eintragskonstellation auf einen ungültigen Array Index. Hab die gesamtsollzeitberechnung temporär ausgeschalten
* Neu Migration (Vorbereiten der DB auf eigenes Ü-Zeitkonto)
This commit is contained in:
Spitzer Daniel
2024-02-22 19:08:32 +01:00
parent 67336d632a
commit 30409c4a23
3 changed files with 39 additions and 3 deletions
@@ -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;
@@ -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;
@@ -0,0 +1,33 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFieldOvertime extends AbstractMigration
{
public function up(): void
{
if($this->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") {
}
}
}