Zeiterfassung Fahrzeugverwaltung neue Features:

* KM-Stand History
* Journal
* Neue Felder
This commit is contained in:
Daniel Spitzer
2025-03-13 21:27:48 +01:00
parent e57a9a0eed
commit 93987b4341
15 changed files with 1237 additions and 234 deletions
+25 -15
View File
@@ -97,11 +97,12 @@
<th class="text-center">Marke</th>
<th class="text-center">Model/Typ</th>
<th class="text-center">Erstzulassung</th>
<th class="text-center">$57a Korrektur</th>
<th class="text-center">$57a</th>
<th class="text-center">Fahrtenbuch</th>
<th class="text-center">KM-Stand</th>
<th class="text-center text-nowrap">KM-Stand</th>
<th class="text-center">Aktiv</th>
<th class="edit-width-w70"></th>
<th class="edit-width-min"></th>
</tr>
<tr id="filterrow">
<th></th>
@@ -114,6 +115,7 @@
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -147,13 +149,15 @@
<td><?= $timerecordingcar->model ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->initial_approval) ? $timerecordingcar->initial_approval : "-" ?>"><?= ($timerecordingcar->initial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->override_approval) ? $timerecordingcar->override_approval : "-" ?>"><?= ($timerecordingcar->override_approval) ? date("m/Y", $timerecordingcar->override_approval) : "-" ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->initial_approval) ? $firstApproval : "-" ?>"><?= ($timerecordingcar->initial_approval) ? $approval : "-" ?></td>
<td class="text-center"><?= ($timerecordingcar->timerecording) ? "Ja" : "Nein" ?></td>
<td class="text-center"><?= ($timerecordingcar->mileage_now) ? number_format($timerecordingcar->mileage_now, 0, ',', '.') . " KM" : "-" ?>
<td class="text-center"><?= ($timerecordingcar->retired) ? "Nein" : "Ja" ?></td>
</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;" class="text-center">
<a href="<?= self::getUrl("TimerecordingCar", "edit", ["id" => $timerecordingcar->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("TimerecordingCar", "delete", ["id" => $timerecordingcar->id]) ?>"
@@ -180,11 +184,12 @@
<th class="text-center">Marke</th>
<th class="text-center">Model/Typ</th>
<th class="text-center">Erstzulassung</th>
<th class="text-center">$57a Korrektur</th>
<th class="text-center">$57a</th>
<th class="text-center">Fahrtenbuch</th>
<th class="text-center">KM-Stand</th>
<th class="text-center text-nowrap">KM-Stand</th>
<th class="text-center">Aktiv</th>
<th class="edit-width-w70"></th>
<th class="edit-width-min"></th>
</tr>
<tr id="filterrow2">
<th></th>
@@ -197,6 +202,7 @@
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@@ -230,13 +236,15 @@
<td><?= $timerecordingcar->model ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->initial_approval) ? $timerecordingcar->initial_approval : "-" ?>"><?= ($timerecordingcar->initial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->override_approval) ? $timerecordingcar->override_approval : "-" ?>"><?= ($timerecordingcar->override_approval) ? date("m/Y", $timerecordingcar->override_approval) : "-" ?></td>
<td class="text-center"
data-order="<?= ($timerecordingcar->initial_approval) ? $firstApproval : "-" ?>"><?= ($timerecordingcar->initial_approval) ? $approval : "-" ?></td>
<td class="text-center"><?= ($timerecordingcar->timerecording) ? "Ja" : "Nein" ?></td>
<td class="text-center"><?= ($timerecordingcar->mileage_now) ? number_format($timerecordingcar->mileage_now, 0, ',', '.') . " KM" : "-" ?>
<td class="text-center"><?= ($timerecordingcar->retired) ? "Nein" : "Ja" ?></td>
</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;" class="text-center">
<a href="<?= self::getUrl("TimerecordingCar", "edit", ["id" => $timerecordingcar->id,"hash" => "anhaenger"]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?= self::getUrl("TimerecordingCar", "delete", ["id" => $timerecordingcar->id]) ?>"
@@ -264,12 +272,12 @@
let table, table2;
let tableInitialized = false;
// Variablen definieren, die du ggf. anpassen musst:
let hidesearchDT = [7, 9];
let hidesearchDT = [8, 10];
let pageLength = 25;
let cstmdom = "flBrtip";
let columndefs = [];
let columnfilter = [6, 8];
let columndefs = [{"orderable": false, "targets": 10}];
let columnfilter = [7, 9];
let columnoptions = '<option value=""></option><option value="Ja">Ja</option><option value="Nein">Nein</option>';
// Initialisierung für die erste Tabelle (z. B. PKW's)
@@ -278,7 +286,7 @@
if (hidesearchDT.includes(i)) {
// Kein Filter hinzufügen
} else if (columnfilter.includes(i)) {
if (i === 8) {
if (i === 9) {
$(this).html('<select id="selectsearch" style="padding: 0; height: 28px; text-align: center;" class="form-control" data-index="' + i + '"><option value=""></option><option selected="selected" value="Ja">Ja</option><option value="Nein">Nein</option></select>');
} else {
$(this).html('<select style="padding: 0; height: 28px; text-align: center;" class="form-control" data-index="' + i + '">' + columnoptions + '</select>');
@@ -352,8 +360,8 @@
if (colSearch.search) {
if (colIdx == 8) {
if (colIdx == 9) {
$('#filterrow').find("[data-index='" + colIdx + "']").val('Ja');
} else {
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
}
@@ -362,6 +370,7 @@
});
table.draw();
$('#selectsearch').change();
}
@@ -371,7 +380,7 @@
if (hidesearchDT.includes(i)) {
// Kein Filter
} else if (columnfilter.includes(i)) {
if (i === 8) {
if (i === 9) {
$(this).html('<select id="selectsearch2" style="padding: 0; height: 28px; text-align: center;" class="form-control" data-index="' + i + '"><option value=""></option><option selected="selected" value="Ja">Ja</option><option value="Nein">Nein</option></select>');
} else {
$(this).html('<select style="padding: 0; height: 28px; text-align: center;" class="form-control" data-index="' + i + '">' + columnoptions + '</select>');
@@ -443,8 +452,8 @@
if (state2) {
table2.columns().eq(0).each(function (colIdx) {
var colSearch = state2.columns[colIdx].search;
if (colIdx == 8) {
if (colIdx == 9) {
$('#filterrow').find("[data-index='" + colIdx + "']").val('Ja');
} else {
$('#filterrow2').find("[data-index='" + colIdx + "']").val(colSearch.search);
}
@@ -452,6 +461,7 @@
});
table2.draw();
$('#selectsearch2').change();
}
$(document).ready(function() {
// Überprüfen, ob ein Hash in der URL vorhanden ist und den entsprechenden Tab aktivieren