Zeiterfassung Update
* automatische Berechnung und BMD Import für NachtZulagen + Migration
This commit is contained in:
@@ -267,10 +267,11 @@ class TimerecordingBillingController extends mfBaseController
|
||||
$bodyarray = [$monthbmd, "1", $employee_number, $employee_type, $hours, "", "", "", "", "", ""];
|
||||
fputcsv($file, $bodyarray, ";");
|
||||
}
|
||||
//Übergangslösung für Oktober
|
||||
if ($employee_number == '1029' && $nlz == 0 && $monthbmd =='10') {
|
||||
|
||||
$bodyarray = [$monthbmd, $companybmd, $employee_number, "4080", '17,42', "", '', "", "", "", ""];
|
||||
if ($timerecordingBillingEmployee->night_allowance > 0) {
|
||||
$nightAllowance = $timerecordingBillingEmployee->night_allowance / 3600;
|
||||
$nightAllowance = round($nightAllowance, 2);
|
||||
$nightAllowance = str_replace(".", ",", $nightAllowance);
|
||||
$bodyarray = [$monthbmd, $companybmd, $employee_number, "4080", $nightAllowance, "", '', "", "", "", ""];
|
||||
fputcsv($file, $bodyarray, ";");
|
||||
}
|
||||
|
||||
@@ -616,6 +617,7 @@ class TimerecordingBillingController extends mfBaseController
|
||||
$data['overtime50free'] = $timerecording['overtimes']['O50free'];
|
||||
$data['overtime100'] = $timerecording['overtimes']['O100pfl'];
|
||||
$data['overtime100free'] = $timerecording['overtimes']['O100free'];
|
||||
$data['night_allowance'] = $timerecording['overtimes']['nightAllowance'];
|
||||
$data['transfer_plushours'] = $timerecording['overtimes']['Osum'];
|
||||
|
||||
$diff = $timerecording['istimeall'] - $timerecording['musttime'];
|
||||
|
||||
@@ -15,6 +15,7 @@ class TimerecordingBillingEmployeeModel
|
||||
private $overtime100;
|
||||
private $overtime100free;
|
||||
private $overtime_plushours;
|
||||
private $night_allowance;
|
||||
private $homeoffice;
|
||||
private $diet;
|
||||
private $nlz;
|
||||
|
||||
@@ -177,7 +177,6 @@ class TimerecordingReportController extends mfBaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else if ($datatype == 5) {
|
||||
$firstdate = strtotime(date("Y-01-01", $datayear));
|
||||
$lastdate = strtotime(date("Y-12-31 23:59:59", $datayear));
|
||||
@@ -200,7 +199,6 @@ class TimerecordingReportController extends mfBaseController
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -584,6 +582,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
$O100pfl = 0;
|
||||
$O100end = strtotime(date('Y-m-d', $start) . " 06:00:00");
|
||||
$O100start = strtotime(date('Y-m-d', $start) . " 22:00:00");
|
||||
$nightAllowance = 0;
|
||||
|
||||
|
||||
foreach ($this->holidays as $holiday) {
|
||||
@@ -626,16 +625,20 @@ class TimerecordingReportController extends mfBaseController
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
} else {
|
||||
// if (date('w', $start) == 6) {
|
||||
// $O50free = $O50free + $end - $start;
|
||||
// }
|
||||
} else if (($start < $O100end || $start > $O100start || $end < $O100end || $end > $O100start) && $night_allowance == 1) {
|
||||
if ($start < $O100end) {
|
||||
$nightAllowance = $nightAllowance + $O100end - $start;
|
||||
}
|
||||
if ($end >= $O100start) {
|
||||
$nightAllowance = $nightAllowance + $end - $O100start;
|
||||
}
|
||||
}
|
||||
}
|
||||
$response['O100free'] = $O100free;
|
||||
$response['O100pfl'] = $O100pfl;
|
||||
$response['O50free'] = $O50free;
|
||||
$response['O50pfl'] = $O50pfl;
|
||||
$response['nightAllowance'] = $nightAllowance;
|
||||
$response['sum'] = $O100free + $O100pfl + $O50free + $O50pfl;
|
||||
return $response;
|
||||
}
|
||||
@@ -828,6 +831,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
$O50free = 0;
|
||||
$O50pfl = 0;
|
||||
$Osum = 0;
|
||||
$nightAllowance = 0;
|
||||
foreach ($timerecordings as $timerecording):
|
||||
|
||||
$state = "";
|
||||
@@ -907,6 +911,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
$O100free = $O100free + $overtimes['O100free'];
|
||||
$O50free = $O50free + $overtimes['O50free'];
|
||||
$O50pfl = $O50pfl + $overtimes['O50pfl'];
|
||||
$nightAllowance = $nightAllowance + $overtimes['nightAllowance'];
|
||||
$Osum = $Osum + $overtimes['sum'];
|
||||
}
|
||||
} else if ($timerecording->timerecordingCategory->hourday == 2 || ($timerecording->timerecordingCategory->hourday == 3 && $timerecording->end)) {
|
||||
@@ -1176,7 +1181,7 @@ class TimerecordingReportController extends mfBaseController
|
||||
$json['time']['daysum'] = $daysum;
|
||||
$json['recordsFiltered'] = $responsecount;
|
||||
$json['recordsTotal'] = $responsecount;
|
||||
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl, 'Osum' => $Osum];
|
||||
$json['time']['overtimes'] = ['O100free' => $O100free, 'O100pfl' => $O100pfl, 'O50free' => $O50free, 'O50pfl' => $O50pfl,'nightAllowance' => $nightAllowance, 'Osum' => $Osum];
|
||||
|
||||
if ($ajax == 1) {
|
||||
$json = json_encode($json);
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class AddTimerecordingBillingEmployeeNightAllowance extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("TimerecordingBillingEmployee", ["signed" => true]);
|
||||
$table->addColumn("night_allowance", "integer", ["null" => false, "default" => 0, "after" => "overtime_plushours"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("TimerecordingBillingEmployee")->removeColumn("night_allowance")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user