Zeiterfassung neues Feature:

Features für Project 7832:
* Das Pickerldatum Zusatzfeld
* Auftrennen PKW und Anhänger
* Dokumente Upload
* Standardsortierung
* Ausgeschieden Flag mit Datum
* zusätzliche migration
This commit is contained in:
Daniel Spitzer
2025-03-10 08:04:56 +01:00
parent 6deca44063
commit 7d176779c9
12 changed files with 1587 additions and 235 deletions
+130 -62
View File
@@ -1,6 +1,10 @@
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php");
$initialApproval = date("Y-m-d H:i:s", $timerecordingcar->initial_approval);
$initialApprovalMonth = date("m", $timerecordingcar->initial_approval);
if ($timerecordingcar->override_approval) {
$overrideApproval = date("Y-m-d H:i:s", $timerecordingcar->override_approval);
$initialApprovalMonth = date("m", $timerecordingcar->override_approval);
}
$firstApproval = strtotime('+' . $timerecordingcar->first_approval . 'years', strtotime($initialApproval));
if ($firstApproval < time()) {
$firstApproval = strtotime(date("Y-$initialApprovalMonth-01", time()));
@@ -9,9 +13,13 @@ if ($firstApproval < time()) {
}
}
$approval = date("m/Y", $firstApproval);
$cartypes = TimerecordingCarModel::$carTypes;
?>
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
type="text/css"/>
<link href="<?= self::getResourcePath() ?>css/pages/TimerecordingCar/Form.css?<?= $git_merge_ts ?>" rel="stylesheet"
type="text/css"/>
<style>
table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
padding-right: 10px;
@@ -44,73 +52,132 @@ $approval = date("m/Y", $firstApproval);
<!-- end page title -->
<div class="card">
<div class="card-body mb-3">
<div class="card-body">
<div class="row">
<div class="col-12 col-lg-5 card-border">
<div>
<h4>Fahrzeug Informationen </h4>
<div class="col-12 col-lg-8 card-border pr-0 pr-lg-1">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-4">
<h4>Fahrzeug Informationen </h4>
<?php if ($timerecordingcar->retired_date): ?>
<div class="alert alert-danger font-weight-500" role="alert">
Fahrzeug ausgeschieden
am <?= date("d.m.Y", $timerecordingcar->retired_date) ?>
von <?= $timerecordingcar->editor->name ?>
</div>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col-12 col-lg-6">
<table class="table table-sm">
<tbody>
<tr>
<th class="w-30">Fahrzeugtyp</th>
<td><?= $cartypes[$timerecordingcar->type] ?></td>
</tr>
<tr>
<th class="w-30">Marke</th>
<td><?= $timerecordingcar->brand ?></td>
</tr>
<tr>
<th>Model/Typ</th>
<td><?= $timerecordingcar->model ?></td>
</tr>
<tr>
<th>Erste §57a nach</th>
<td><?= ($timerecordingcar->first_approval) ? $timerecordingcar->first_approval . " Jahr(en)" : "-" ?></td>
</tr>
<tr>
<th>Fahrzeugverwalter</th>
<td><?= ($timerecordingcar->user_id) ? $timerecordingcar->user->name : "-" ?></td>
</tr>
</tbody>
</table>
</div>
<div class="col-12 col-lg-6 card-border">
<div>
<table class="table table-sm">
<tbody>
<tr>
<th>Fahrtenbuch</th>
<td><?= ($timerecordingcar->timerecording) ? "Ja" : "Nein" ?></td>
</tr>
<tr>
<th>Erstzulassung</th>
<td><?= ($timerecordingcar->initial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?></td>
</tr>
<?php if ($timerecordingcar->override_approval) : ?>
<tr>
<th>§57a Korrektur</th>
<td><?= ($timerecordingcar->initial_approval) ? date("m/Y", $timerecordingcar->override_approval) : "-" ?></td>
</tr>
<?php endif; ?>
<tr>
<th>Nächste $57a</th>
<td><?= ($timerecordingcar->initial_approval) ? $approval : "-" ?></td>
</tr>
<tr>
<th class="w-30">Kilometerstand</th>
<td><?= ($timerecordingcar->mileage_now) ? $timerecordingcar->mileage_now . " KM" : "-" ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div>
<table class="table table-sm">
<tbody>
<tr>
<th class="w-30">Marke</th>
<td><?= $timerecordingcar->brand ?></td>
</tr>
<tr>
<th>Model/Typ</th>
<td><?= $timerecordingcar->model ?></td>
</tr>
<tr>
<th>Erste §57a nach</th>
<td><?= ($timerecordingcar->first_approval) ? $timerecordingcar->first_approval . " Jahr(en)" : "-" ?></td>
</tr>
<tr>
<th>Fahrzeugverwalter</th>
<td><?= ($timerecordingcar->user_id) ? $timerecordingcar->user->name : "-" ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="col-12 col-lg-5 card-border">
<div>
<h4>&nbsp;</h4>
<?php if ($timerecordingcarDokuments) : ?>
<div class="col-12 col-lg-4 card-border pr-0 pl-lg-1">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-12">
<h4>Dokumente </h4>
</div>
</div>
<?php foreach ($timerecordingcarDokuments as $timerecordingcarDokument) :
$filesize = $timerecordingcarDokument->file_size;
if ($filesize < 1024) {
$filesize = number_format($filesize, 2) . " B";
} elseif ($filesize < 1024 * 1024) {
$filesize = number_format($filesize / 1024, 2) . " KB";
} else {
$filesize = number_format($filesize / 1024 / 1024, 2) . " MB";
}
$uploadDate = date("d.m.y", $timerecordingcarDokument->file->create);
$mimetype = $timerecordingcarDokument->file->mimetype;
if (!array_key_exists($mimetype, $mimetypes)) {
$mimetype = "fa-file";
} else
$mimetype = $mimetypes[$mimetype];
?>
<div class="doc-main-div border-bottom mb-1"
data-name="<?= $timerecordingcarDokument->file->name ?>">
<div class="d-inline-block doc-icon-div"><i
class="fa-duotone fa-solid <?= $mimetype ?>"></i>
</div>
<div class="d-inline-block doc-content-div"
style="margin-left: -3px;"><a
href="<?= self::getUrl("File", "download", ["id" => $timerecordingcarDokument->file_id]) ?>"
target="_blank"><?= $timerecordingcarDokument->file->name ?></a>
</div>
<span class="mt-2px float-right ml-1">(<?= $uploadDate ?>)</span>
<span class="mt-2px float-right"><?= $filesize ?></span>
</div>
<?php endforeach; ?>
</div>
</div>
<div>
<table class="table table-sm">
<tbody>
<tr>
<th>Fahrtenbuch</th>
<td><?= ($timerecordingcar->timerecording) ? "Ja" : "Nein" ?></td>
</tr>
<tr>
<th>Erstzulassung</th>
<td><?= ($timerecordingcar->initial_approval) ? date("m/Y", $timerecordingcar->initial_approval) : "-" ?></td>
</tr>
<tr>
<th>Nächste $57a</th>
<td><?= ($timerecordingcar->initial_approval) ? $approval : "-" ?></td>
</tr>
<tr>
<th class="w-30">Kilometerstand</th>
<td><?= ($timerecordingcar->mileage_now) ? $timerecordingcar->mileage_now . " KM" : "-" ?></td>
</tr>
</tbody>
</table>
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
@@ -158,7 +225,8 @@ $approval = date("m/Y", $firstApproval);
<tr>
<td class="text-center"><?= $timerecording->mileage_start ?> KM</td>
<td class="text-center"><?= $timerecording->mileage_end ?> KM</td>
<td class="text-center"><?= $timerecording->mileage_end - $timerecording->mileage_start ?>KM
<td class="text-center"><?= $timerecording->mileage_end - $timerecording->mileage_start ?>
KM
<td class="text-center"><?= $timerecording->user->name ?></td>
<td data-order="<?= $timerecording->start ?>"
class="text-center"><?= date("d.m.Y", $timerecording->start) ?></td>