Zeiterfassungs Billing Update/Devices Parents
This commit is contained in:
@@ -175,6 +175,9 @@ if ($devices->power != "0.0") {
|
||||
} else {
|
||||
$power = $devices->devicetype->power;
|
||||
}
|
||||
foreach ($devicesall as $deviceall) {
|
||||
$DevicesAll[$deviceall->id] = $deviceall->name;
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -205,6 +208,12 @@ if ($devices->power != "0.0") {
|
||||
<th>Geräte Hersteller</th>
|
||||
<td><?= $devices->devicetype->devicemanufactor->name ?> </td>
|
||||
</tr>
|
||||
<?php if ($devices->parent_id) : ?>
|
||||
<tr>
|
||||
<th>Parent Device</th>
|
||||
<td><a href="<?= self::getUrl("Device", "Detail", ["id" => $devices->parent_id]) ?>"><?= $DevicesAll[$devices->parent_id]?></a></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th>Mac Adresse</th>
|
||||
<td><?= $devices->mac ?> </td>
|
||||
@@ -221,6 +230,7 @@ if ($devices->power != "0.0") {
|
||||
<th>Leistung</th>
|
||||
<td><?= $power ?> Watt</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Bemerkung</th>
|
||||
<td><?= nl2br($devices->comment) ?> </td>
|
||||
|
||||
@@ -22,6 +22,10 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "device-detail") {
|
||||
} else {
|
||||
$cancelUrl = self::getUrl("Device");
|
||||
}
|
||||
foreach ($devices as $Device) {
|
||||
$Devices[$Device->id] = $Device->name;
|
||||
}
|
||||
asort($Devices);
|
||||
?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
@@ -80,6 +84,17 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "device-detail") {
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="parent_id">Parent </label>
|
||||
<div class="col-lg-10">
|
||||
<select class="select2 form-control " name="parent_id" id="parent_id">
|
||||
<option value=""> </option>
|
||||
<?php foreach ($Devices as $key => $value): ?>
|
||||
<option value="<?= $key ?>" <?= ($device->parent_id == $key) ? "selected='selected'" : "" ?>><?= ($value) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="pop_id">Pop</label>
|
||||
<div class="col-lg-10">
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
39
db/migrations/20240409064828_fiber_plan_dispatcher.php
Normal file
39
db/migrations/20240409064828_fiber_plan_dispatcher.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class FiberPlanDispatcher extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("FiberPlanDispatcher", ["signed" => true]);
|
||||
|
||||
$table->addColumn("network_id", "integer", ["null" => false]);
|
||||
$table->addColumn("object_type", "integer", ["null" => false]);
|
||||
$table->addColumn("gps_lat", "decimal", ["null" => true, "precision" => 15, "scale" => 10]);
|
||||
$table->addColumn("gps_long", "decimal", ["null" => true, "precision" => 15, "scale" => 10]);
|
||||
$table->addColumn("description", "text", ["null" => false]);
|
||||
$table->addColumn("type", "text", ["null" => true]);
|
||||
$table->addColumn("comment", "text", ["null" => true]);
|
||||
$table->addColumn("create_by", "integer", ["null" => false]);
|
||||
$table->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$table->addColumn("create", "integer", ["null" => false]);
|
||||
$table->addColumn("edit", "integer", ["null" => false]);
|
||||
$table->save();
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("FiberPlanDispatcher")->drop()->save();
|
||||
}
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
}
|
||||
}
|
||||
}
|
||||
34
db/migrations/20240409064838_fiber_plan_dispatchersleeve.php
Normal file
34
db/migrations/20240409064838_fiber_plan_dispatchersleeve.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class FiberPlanDispatchersleeve extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("FiberPlanDispatchersleeve", ["signed" => true]);
|
||||
|
||||
$table->addColumn("fiberPlanDispatcher_id", "integer", ["null" => false]);
|
||||
$table->addColumn("name", "text", ["null" => false]);
|
||||
$table->addColumn("create_by", "integer", ["null" => false]);
|
||||
$table->addColumn("edit_by", "integer", ["null" => false]);
|
||||
$table->addColumn("create", "integer", ["null" => false]);
|
||||
$table->addColumn("edit", "integer", ["null" => false]);
|
||||
$table->save();
|
||||
}
|
||||
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if ($this->getEnvironment() == "thetool") {
|
||||
$this->table("FiberPlanDispatchersleeve")->drop()->save();
|
||||
}
|
||||
if ($this->getEnvironment() == "addressdb") {
|
||||
}
|
||||
}
|
||||
}
|
||||
31
db/migrations/20240416123342_device_add_field_parent_id.php
Normal file
31
db/migrations/20240416123342_device_add_field_parent_id.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class DeviceAddFieldParentId extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$table = $this->table("Device", ["signed" => true]);
|
||||
$table->addColumn("parent_id", "integer", ["null" => true, "after" => "devicetype_id"]);
|
||||
$table->update();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
if($this->getEnvironment() == "thetool") {
|
||||
$this->table("Device")->removeColumn("parent_id")->save();
|
||||
}
|
||||
|
||||
if($this->getEnvironment() == "addressdb") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user