Merge branch 'spidev' into 'master'

Zeiterfassungs Billing Update/Devices Parents

See merge request fronk/thetool!332
This commit is contained in:
Frank Schubert
2024-04-16 14:13:19 +00:00
10 changed files with 149 additions and 3 deletions
+7
View File
@@ -43,6 +43,7 @@ class DeviceController extends mfBaseController
$this->layout()->setTemplate("Device/Detail");
$devicesconfig = DeviceModel::getconifg($id);
$devices = DeviceModel::getOne($id);
$devicesall= DeviceModel::getAll();
if ($devices->devicetype->olt == "1") {
$customer = DeviceModel::getOltCustomer($device->ip);
@@ -52,6 +53,7 @@ class DeviceController extends mfBaseController
$this->layout()->set("devicesconfig", $devicesconfig);
$this->layout()->set("devices", $devices);
$this->layout()->set("devicesall", $devicesall);
$this->layout()->set("customer", $customer);
}
@@ -61,6 +63,7 @@ class DeviceController extends mfBaseController
$this->layout()->setTemplate("Device/Form");
$this->layout()->set("devicetypes", DevicetypeModel::getAll());
$this->layout()->set("pops", PopModel::getAll());
$this->layout()->set("devices", DeviceModel::getAll());
}
@@ -102,6 +105,7 @@ class DeviceController extends mfBaseController
$data = [];
$data['name'] = trim($r->name);
$data['devicetype_id'] = $r->devicetype_id;
$data['parent_id'] = $r->parent_id;
$data['autobackup'] = trim($r->autobackup);
if (trim($r->pop_id) == "0") {
@@ -132,6 +136,9 @@ class DeviceController extends mfBaseController
if ($data['autobackup'] != "1") {
$data['autobackup'] = "0";
}
if (!$data['parent_id']) {
$data['parent_id'] = NULL;
}
$data['ip'] = $r->ip;
$data['mac'] = $r->mac;
$data['serial'] = $r->serial;
+1
View File
@@ -8,6 +8,7 @@ class DeviceModel
public $serial = null;
public $comment = null;
public $devicetype_id = null;
public $parent_id = null;
public $pop_id = null;
public $addr_street = null;
public $addr_number = null;
@@ -228,6 +228,7 @@ class TimerecordingBillingController extends mfBaseController
$employee_number = (string)$user->getFlag('employee_number');
$employeetypesbmd = TimerecordingEmployeeModel::$employeetypesbmd;
$employee_type = $employeetypesbmd[$timerecordingBillingEmployee->timerecordingEmployee->type];
$overtimebase = 0;
if ($nlz == 0) {
$hours = $timerecordingBillingEmployee->ishours / 3600;
$hours = round($hours, 2);
@@ -239,6 +240,7 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime50free > 0) {
$overtime50free = $timerecordingBillingEmployee->overtime50free / 3600;
$overtime50free = round($overtime50free, 2);
$overtimebase = $overtimebase + $overtime50free;
$overtime50free = str_replace(".", ",", $overtime50free);
$bodyarray = [$monthbmd, "1", $employee_number, "3110", $overtime50free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
@@ -246,10 +248,17 @@ class TimerecordingBillingController extends mfBaseController
if ($timerecordingBillingEmployee->overtime100free > 0) {
$overtime100free = $timerecordingBillingEmployee->overtime100free / 3600;
$overtime100free = round($overtime100free, 2);
$overtimebase = $overtimebase + $overtime100free;
$overtime100free = str_replace(".", ",", $overtime100free);
$bodyarray = [$monthbmd, "1", $employee_number, "3150", $overtime100free, "", "", "", "", "", ""];
$bodyarray = [$monthbmd, "1", $employee_number, "3160", $overtime100free, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
if ($overtimebase > 0) {
$overtimebase = str_replace(".", ",", $overtimebase);
$bodyarray = [$monthbmd, "1", $employee_number, "3100", $overtimebase, "", "", "", "", "", ""];
fputcsv($file, $bodyarray, ";");
}
if ($timerecordingBillingEmployee->homeoffice > 0) {
$homeoffice = $timerecordingBillingEmployee->homeoffice;
$homeoffice = round($homeoffice, 2);