From 93987b4341d6555f05d19e0c8994d0cf3bfe0058 Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Thu, 13 Mar 2025 21:27:48 +0100 Subject: [PATCH] Zeiterfassung Fahrzeugverwaltung neue Features: * KM-Stand History * Journal * Neue Felder --- Layout/default/TimerecordingCar/Detail.php | 169 ++++++- Layout/default/TimerecordingCar/Form.php | 472 +++++++++++------- Layout/default/TimerecordingCar/Index.php | 40 +- .../TimerecordingCarController.php | 68 ++- .../TimerecordingCarModel.php | 6 + .../TimerecordingCarJournal.php | 60 +++ .../TimerecordingCarJournalController.php | 131 +++++ .../TimerecordingCarJournalModel.php | 127 +++++ .../TimerecordingCarMileageHistory.php | 60 +++ ...merecordingCarMileageHistoryController.php | 129 +++++ .../TimerecordingCarMileageHistoryModel.php | 131 +++++ ...250304155250_timerecording_car_journal.php | 2 +- ...9_timerecording_car_add_fields_details.php | 41 ++ ...imerecording_car_journal_add_timestamp.php | 31 ++ public/assets/css/datatables-std.css | 4 + 15 files changed, 1237 insertions(+), 234 deletions(-) create mode 100644 application/TimerecordingCarJournal/TimerecordingCarJournal.php create mode 100644 application/TimerecordingCarJournal/TimerecordingCarJournalController.php create mode 100644 application/TimerecordingCarJournal/TimerecordingCarJournalModel.php create mode 100644 application/TimerecordingCarMileageHistory/TimerecordingCarMileageHistory.php create mode 100644 application/TimerecordingCarMileageHistory/TimerecordingCarMileageHistoryController.php create mode 100644 application/TimerecordingCarMileageHistory/TimerecordingCarMileageHistoryModel.php create mode 100644 db/migrations/20250311140149_timerecording_car_add_fields_details.php create mode 100644 db/migrations/20250313190342_timerecording_car_journal_add_timestamp.php diff --git a/Layout/default/TimerecordingCar/Detail.php b/Layout/default/TimerecordingCar/Detail.php index 411966afc..85f6974e4 100644 --- a/Layout/default/TimerecordingCar/Detail.php +++ b/Layout/default/TimerecordingCar/Detail.php @@ -14,7 +14,13 @@ if ($firstApproval < time()) { } $approval = date("m/Y", $firstApproval); $cartypes = TimerecordingCarModel::$carTypes; - +if ($timerecordingcar->mileage_now && $timerecordingcar->mileage_timestamp) { + $mileagetimestamp = "(" . date("d.m.Y", $timerecordingcar->mileage_timestamp) . ")"; +} elseif ($timerecordingcar->mileage_now) { + $mileagetimestamp = "(" . date("d.m.Y", $timerecordingcar->edit) . ")"; +} else { + $mileagetimestamp = ""; +} ?> @@ -24,6 +30,15 @@ $cartypes = TimerecordingCarModel::$carTypes; table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) { padding-right: 10px; } + + .show-milage-history { + cursor: pointer; + } + .fa-duotone.fa-clock-rotate-left:after, .fa-duotone.fa-history:after, .fad.fa-clock-rotate-left:after, .fad.fa-history:after { + content: "\f1da\f1da"; + color: #218200; + opacity: 0.7; + }
@@ -92,13 +107,32 @@ $cartypes = TimerecordingCarModel::$carTypes; Model/Typ model ?> + + Fahrzeugverwalter + user_id) ? $timerecordingcar->user->name : "-" ?> + + + Fahrtenbuch + timerecording) ? "Ja" : "Nein" ?> + Erste §57a nach first_approval) ? $timerecordingcar->first_approval . " Jahr(en)" : "-" ?> + - Fahrzeugverwalter - user_id) ? $timerecordingcar->user->name : "-" ?> + Erstzulassung + initial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?> + + override_approval) : ?> + + §57a Korrektur + initial_approval) ? date("m/Y", $timerecordingcar->override_approval) : "-" ?> + + + + Nächste $57a + initial_approval) ? $approval : "-" ?> @@ -109,30 +143,49 @@ $cartypes = TimerecordingCarModel::$carTypes; - - + + - - + + - override_approval) : ?> - - - - - - - + + + + + + + + + + + + + + + - + - - + + + + + + + + +
Fahrtenbuchtimerecording) ? "Ja" : "Nein" ?>Serviceintervallservice_interval) ?: "-" ?>
Erstzulassunginitial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?>Sommerreifensummer_tires) ?: "-" ?>
§57a Korrekturinitial_approval) ? date("m/Y", $timerecordingcar->override_approval) : "-" ?>
Nächste $57ainitial_approval) ? $approval : "-" ?>Winterreifenwinter_tires) ?: "-" ?>
Reifen engelagerttires_at) ?: "-" ?>
Motoröloil_type) ?: "-" ?>
Werkstätteservice_station) ?: "-" ?>
Kilometerstandmileage_now) ? $timerecordingcar->mileage_now . " KM" : "-" ?>mileage_now) ? $timerecordingcar->mileage_now . " KM" : "-" ?> ' : '' ?>
@@ -141,9 +194,10 @@ $cartypes = TimerecordingCarModel::$carTypes; - -
-
+ +
+ +
@@ -182,8 +236,30 @@ $cartypes = TimerecordingCarModel::$carTypes;
-
- + +
+
+
+
+

Journaleintrag +
+
+

+ timestamp) ?> (creator->name ?>) +
+
+
journal) ?>
+
+
+
+
+ +
+
@@ -261,14 +337,61 @@ $cartypes = TimerecordingCarModel::$carTypes; +