15 Commits

13 changed files with 1755 additions and 49 deletions

View File

@@ -324,13 +324,13 @@ $Epi = new Epirent();
<th scope="col">Kunde</th>
<th scope="col">Event</th>
<?php
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){
<?php
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoEndOnCheckin){
echo '<th scope="col">';
}
if(ShowCheckoutTimeOnCheckout){
echo "Dispo-Start";
echo "Checkout-Start";
}
if(ShowVorbereitungTimeOnCheckout){
if(ShowCheckoutTimeOnCheckout){echo "<br>";}
@@ -344,7 +344,11 @@ $Epi = new Epirent();
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout){echo "<br>";}
echo "Liefern";
}
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){
if(ShowDispoStartOnCheckout){
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){echo "<br>";}
echo "Auftrag Start";
}
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoStartOnCheckout){
echo '</th>';
}
@@ -376,7 +380,7 @@ $Epi = new Epirent();
}
if(ShowCheckInTimeOnCheckin){
echo "Dispo-Ende";
echo "CheckIn";
}
if(ShowNachbereitungTimeOnCheckin){
if(ShowCheckInTimeOnCheckin){echo "<br>";}
@@ -390,7 +394,11 @@ $Epi = new Epirent();
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin){echo "<br>";}
echo "Rückliefern";
}
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin){
if(ShowDispoEndOnCheckin){
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin | ShowReDeliveryTimeOnCheckin){echo "<br>";}
echo "Auftrag Ende";
}
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin || ShowDispoEndOnCheckin){
echo '</th>';
}

View File

@@ -289,12 +289,12 @@ $Epi = new Epirent();
<th scope="col">Kunde</th>
<th scope="col">Event</th>
<?php
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoEndOnCheckin){
echo '<th scope="col">';
}
if(ShowCheckoutTimeOnCheckout){
echo "Dispo-Start";
echo "Checkout-Start";
}
if(ShowVorbereitungTimeOnCheckout){
if(ShowCheckoutTimeOnCheckout){echo "<br>";}
@@ -308,7 +308,11 @@ $Epi = new Epirent();
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout){echo "<br>";}
echo "Liefern";
}
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){
if(ShowDispoStartOnCheckout){
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout){echo "<br>";}
echo "Auftrag Start";
}
if(ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout||ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoStartOnCheckout){
echo '</th>';
}
@@ -342,7 +346,7 @@ $Epi = new Epirent();
}
if(ShowCheckInTimeOnCheckin){
echo "Dispo-Ende";
echo "CheckIn";
}
if(ShowNachbereitungTimeOnCheckin){
if(ShowCheckInTimeOnCheckin){echo "<br>";}
@@ -356,7 +360,11 @@ $Epi = new Epirent();
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin){echo "<br>";}
echo "Rückliefern";
}
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin){
if(ShowDispoEndOnCheckin){
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin | ShowReDeliveryTimeOnCheckin){echo "<br>";}
echo "Auftrag Ende";
}
if(ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin||ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin || ShowDispoEndOnCheckin){
echo '</th>';
}

View File

@@ -1,6 +1,6 @@
# EPIWebview
- **aktuellste stable Version:** 1.5.0
- **aktuellste stable Version:** 1.9.0
- **Lizenz:** Creative Commons Attribution-NonCommercial-ShareAlike 4.0 (CC BY-NC-SA 4.0). Einsehbar unter: (LICENSE.MD)
- **Kompatibilität:** Erweiterung für **Epirent** und **CrewBrain**
@@ -17,7 +17,7 @@ Die Anwendung ist speziell für den Einsatz in Lagerprozessen entwickelt.
- **Check-In / Check-Out Übersicht**: Lagermonitor
- **Integration mit Epirent API**: Vollständig kompatibel mit bestehenden Epirent-Systemen.
- **Integration mit Crewbrain**: Anzeige einer Aufgabenliste aus CrewBrain
- **Integration mit Crewbrain**: Anzeige einer Aufgabenliste aus CrewBraingit
---
@@ -25,7 +25,8 @@ Die Anwendung ist speziell für den Einsatz in Lagerprozessen entwickelt.
## Systemanforderungen
- **Server:** PHP ≥ 8.1, Apache oder Nginx
- **Server:** PHP ≥ 8.2, Apache oder Nginx
- Achtung !!: Für die Return of Invest Funktion oder den Warengruppencheck / Imagechecks sollten in der php.ini die max_execution_time und die maximale Dateigröße deutlich nach oben korrigiert werden. Die ROI Funktion kann gut und gerne 20 Minuten laden!
- **Client:** Aktueller Browser (Chrome, Edge, Firefox, Safari)
- **Datenquelle:** Bestehende Epirent-Installation mit aktivierter API sowie optional CrewBrain
@@ -36,7 +37,20 @@ Die Anwendung ist speziell für den Einsatz in Lagerprozessen entwickelt.
1. Repository klonen oder Dateien ins Webverzeichnis kopieren:
```bash
git clone http://srvgitea01.vtm.zone:3000/epi/EpiWebview
2. Dashboard Aufrufen und auf die Config-Seite wechseln, notwendige Einstellungen vornehmen.
2. Config-Seite unter /dist/editconfig.php aufrufen, notwendige Einstellungen vornehmen -> Speichern. Wichtig! Verzeichnis muss für Webserver beschreibbar sein!
3. Alternativ: example.config.php nach config.php kopieren! (example.config.php darf nicht gelöscht werden!)
---
## Update
1. Repository klonen oder Dateien ins Webverzeichnis kopieren, dabei alte Dateien löschen (bis auf config.php):
```bash
git clone http://srvgitea01.vtm.zone:3000/epi/EpiWebview
2. Einmalig die Config-Seite aufrufen und speichern drücken. Dadurch werden geupdatete Config-Felder übernommen
## Changelog
Verschoben in Releases (Git)
---

1324
dist/ROI.php vendored Normal file

File diff suppressed because it is too large Load Diff

128
dist/groupofgoodscheck.php vendored Normal file
View File

@@ -0,0 +1,128 @@
<?php
require('../config.php');
require('../EpiApi.php');
require_once __DIR__ . '/../vendor/autoload.php';
date_default_timezone_set('Europe/Berlin');
$Epi = new Epirent();
$productList = json_decode($Epi->requestEpiApi('/v1/product/all?ia=true&ir=true&cl=' . Epirent_Mandant))->payload;
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Imagecheck - EpiWebview</title>
<!-- Styles -->
<link href="css/styles.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
<!-- JS -->
<script src="js/jquery-3.5.1.min.js"></script>
<script src="https://kit.fontawesome.com/93d71de8bc.js" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js"></script>
<style>
.opacity-50 {
opacity: .5;
}
.card .h2,
.card .display-4 {
font-weight: 700;
}
.kpi-updated {
font-size: .82rem;
opacity: .85;
}
</style>
<script>
$(function() {
$('#layoutSidenav_nav').load('../sources/getSidenav.php');
$('#footerholder').load('../sources/getFooter.php');
});
</script>
</head>
<body class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="index.php">Epi Webview</a>
<button class="btn btn-link btn-sm order-1 order-lg-0" id="sidebarToggle"><i class="fas fa-bars"></i></button>
</nav>
<div id="layoutSidenav">
<div id="layoutSidenav_nav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid">
<h1 class="mt-4">Warengruppenprüfung</h1>
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<div><i class="fas fa-table mr-1"></i> Zeigt welche Artikel keine Warengruppe haben</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="dataTable" class="table table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th>PN</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<?php
foreach ($productList as $product) {
if( count($product->group_of_goods) == 0 || $product->group_of_goods ==null){
echo "<tr>";
echo "<td>" . htmlspecialchars($product->primary_key) . "</td>";
echo "<td>" . htmlspecialchars($product->product_no) . "</td>";
echo "<td>" . htmlspecialchars($product->name) . "</td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<div id="footerholder"></div>
</div>
</div>
<!-- Bootstrap Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$('#dataTable').DataTable({
"pageLength": 25,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.20/i18n/German.json"
}
});
});
</script>
</body>
</html>

128
dist/imagecheck.php vendored Normal file
View File

@@ -0,0 +1,128 @@
<?php
require('../config.php');
require('../EpiApi.php');
require_once __DIR__ . '/../vendor/autoload.php';
date_default_timezone_set('Europe/Berlin');
$Epi = new Epirent();
$productList = json_decode($Epi->requestEpiApi('/v1/product/all?ia=true&ir=true&cl=' . Epirent_Mandant))->payload;
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Imagecheck - EpiWebview</title>
<!-- Styles -->
<link href="css/styles.css" rel="stylesheet" />
<link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
<!-- JS -->
<script src="js/jquery-3.5.1.min.js"></script>
<script src="https://kit.fontawesome.com/93d71de8bc.js" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.20/js/dataTables.bootstrap4.min.js"></script>
<style>
.opacity-50 {
opacity: .5;
}
.card .h2,
.card .display-4 {
font-weight: 700;
}
.kpi-updated {
font-size: .82rem;
opacity: .85;
}
</style>
<script>
$(function() {
$('#layoutSidenav_nav').load('../sources/getSidenav.php');
$('#footerholder').load('../sources/getFooter.php');
});
</script>
</head>
<body class="sb-nav-fixed">
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
<a class="navbar-brand" href="index.php">Epi Webview</a>
<button class="btn btn-link btn-sm order-1 order-lg-0" id="sidebarToggle"><i class="fas fa-bars"></i></button>
</nav>
<div id="layoutSidenav">
<div id="layoutSidenav_nav"></div>
<div id="layoutSidenav_content">
<main>
<div class="container-fluid">
<h1 class="mt-4">Imagecheck</h1>
<div class="card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<div><i class="fas fa-table mr-1"></i> Zeigt welche Artikel keine Bilder haben</div>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="dataTable" class="table table-bordered" width="100%" cellspacing="0">
<thead>
<tr>
<th>#</th>
<th>PN</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<?php
foreach ($productList as $product) {
$hasImages=(json_decode($Epi->requestEpiApi('/v1/product/image/'.$product->primary_key.'?cl=' . Epirent_Mandant))->payload_length);
if( $hasImages == 0 || $hasImages ==null){
echo "<tr>";
echo "<td>" . htmlspecialchars($product->primary_key) . "</td>";
echo "<td>" . htmlspecialchars($product->product_no) . "</td>";
echo "<td>" . htmlspecialchars($product->name) . "</td>";
echo "</tr>";
}
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</main>
<div id="footerholder"></div>
</div>
</div>
<!-- Bootstrap Bundle -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$('#dataTable').DataTable({
"pageLength": 25,
"language": {
"url": "//cdn.datatables.net/plug-ins/1.10.20/i18n/German.json"
}
});
});
</script>
</body>
</html>

7
dist/insurance.php vendored
View File

@@ -76,7 +76,13 @@ foreach ($filteredProductArray as $filteredProduct) {
$stockRes = $Epi->requestEpiApi('/v1/stock/filter?ppk=' . $insuredProduct->primary_key . '&cl=' . Epirent_Mandant);
$deviceStockObjectArray = json_decode($stockRes)->payload ?? [];
//Sortiere alle Geräte aus die "Nicht Versichert" im Status stehen haben
foreach ($deviceStockObjectArray as $device) {
if($device->condition=="Nicht Versichert"){
continue;
}
//Sortiere jetzt die Geräte aus, die Nicht aussortiert wurden
if(!$device->is_sorted_out){
$rows[] = [
'pk' => $insuredProduct->product_no,
'name' => $insuredProduct->name,
@@ -88,6 +94,7 @@ foreach ($filteredProductArray as $filteredProduct) {
'purchase_price'=> (float)($device->purchase_price ?? 0.0),
'owner' => (string)($device->owner ?? ''),
];
}
}
}

5
dist/labelprint.php vendored
View File

@@ -6,7 +6,7 @@ require_once __DIR__ . '/../vendor/autoload.php';
date_default_timezone_set('Europe/Berlin');
$Epi = new Epirent();
$productList = json_decode($Epi->requestEpiApi('/v1/product/all?cl=' . Epirent_Mandant))->payload;
$productList = json_decode($Epi->requestEpiApi('/v1/product/all?ia=true&ir=true&cl=' . Epirent_Mandant))->payload;
?>
<!DOCTYPE html>
@@ -85,6 +85,9 @@ $productList = json_decode($Epi->requestEpiApi('/v1/product/all?cl=' . Epirent_M
<tbody>
<?php
foreach ($productList as $product) {
if (!$product->is_rent & $product->is_sale){
continue;
}
echo "<tr>";
echo "<td>" . htmlspecialchars($product->primary_key) . "</td>";
echo "<td>" . htmlspecialchars($product->product_no) . "</td>";

View File

@@ -26,17 +26,19 @@ define('EnableScrollingCheckOut', true); //Aktiviert das automatische Scrollen d
define('EnableScrollingCheckIn', true); //Aktiviert das automatische Scrollen der CheckIn Liste
define('EnableScrollingAufgaben', true); //Aktiviert das automatische Scrollen der Aufgabenliste
// @note: -------------------- CheckOutRowMarkSource: Konfig Zusände --------------------
// @note: 1 = $packingjob->date_start (Dispo Start)
// @note: 1 = $packingjob->date_start (Packjob Start)
// @note: 2 = $VorbereitungsTimeDetail->date_start (Vorbereitung Start)
// @note: 3 = $PackingNoteDetail->date_packing (Packen Zeit)
// @note: 4 = $PackingNoteDetail->date_delivery (Delivery Zeit)
// @note: 5 = $order->date_start (Dispo Start Zeit)
define('CheckOutRowMarkSource', 4);
// @note: -------------------- CheckInRowMarkSource: Konfig Zusände --------------------
// @note: 1 = $packingjob->date_end (Dispo Ende)
// @note: 1 = $packingjob->date_end (Packjob Ende)
// @note: 2 = $NachbereitungssTimeDetail->date_start (Nachbereitung Start)
// @note: 3 = $RePackagingTimeDetail->date_start (Rückpacken Zeit AUS AUFTRAG)
// @note: 4 = $PackingNoteDetail->date_redelivery (ReDelivery Zeit)
// @note: 5 = $order->date_end (Dispo End Zeit)
define('CheckInRowMarkSource', 4);
define('CheckIn_UseDispoEndForRowMarking', false); //else: Use Same Variable as "Rueckpacken Zeitvariable" | Konfiguration, welche Zeit für die Zeilenmarkierung beim Check In Verwendet werden soll
@@ -45,12 +47,15 @@ define('ShowCheckoutTimeOnCheckout', true); //Zeigt die Checkout Zeit im Checkou
define('ShowVorbereitungTimeOnCheckout', true); //Zeigt die Vorbereitungs Zeitvariable im Checkout
define('ShowPackagingTimeOnCheckout', true); //Zeigt die Packenzeit im Checkout
define('ShowDeliveryTimeOnCheckout', true); //Zeigt die Lieferzeit im Checkout
define('ShowDispoStartOnCheckout', true); //Zeigt die DispoStart im Checkout
define('ShowTimesOnCheckout', true); //Aktiviert das anzeigen der Uhrzeit im Checkout
// @hr
define('ShowCheckInTimeOnCheckin', true); //Zeigt die CheckIn Zeit im CheckIn
define('ShowNachbereitungTimeOnCheckin', true); //Zeigt die Nachbereitungs Zeitvariable im CheckIn
define('ShowRePackagingTimeOnCheckin', true); //Zeigt die Rückpackzeit im Checkin <br><b>Achtung: Zeit nur Im Auftrag festlegbar</b>
define('ShowReDeliveryTimeOnCheckin', true); //Zeigt die geplante Rücklieferung im Checkin
define('ShowDispoEndOnCheckin', true); //Zeigt die DispoEnd Zeit im CheckIn
define('ShowTimesOnCheckin', true); //Aktiviert das anzeigen der Uhrzeit im CheckIn
// @section: Epirent-Spezifische Einstellungen - Shipping
@@ -61,6 +66,15 @@ define('DHLContainsText', 'DHL'); //Text, der in der Versandart enthalten sein m
define('LKWContainsText', 'LKW'); //Text, der in der Versandart enthalten sein muss (enthält), damit diese als eigener LKW erkannt wird.
define('TransporterContainsText', 'Sprinter'); //Text, der in der Versandart enthalten sein muss (enthält), damit diese als eigener Transporter erkannt wird.
define('PKWContainsText', 'PKW'); //Text, der in der Versandart enthalten sein muss (enthält), damit diese als eigener PKW erkannt wird.
// @hr
// @note: Informationen zu den Icons: Die Icons basieren auf FontAwesome und bestehen aus drei Teilen: Sammlung (fa-solid), Icon (fa-truck) und Größe (fa-lg). Weitere Informationen bitte der FA-Doku entnehmen
define('KurierIcon', 'fa-solid fa-hand-holding-dollar fa-lg');
define('SpeditionIcon', 'fa-solid fa-truck fa-lg');
define('DHLIcon', 'fa-brands fa-dhl fa-2xl');
define('LKWIcon', 'fa-solid fa-truck fa-lg');
define('TransporterIcon', 'fa-solid fa-van-shuttle fa-lg');
define('PKWIcon', 'fa-solid fa-car fa-lg');
define('SelbstabholerIcon', 'fa-solid fa-person-walking fa-lg');
define('UseShippingStatus', true); //Nutzt den Packscheinstatus als Shipping Status. Hierdurch können die Icons unter verschiedenen Vorraussetzungen Grün werden, wenn der Versand organisiert wurde
define('ShippingOutOrganizedStatus', 'Hinversand OK'); //Packschein Status (EpirentDropdown) der Gematcht werden muss, dass der Hinversand Organisiert / Bestellt wurde

View File

@@ -48,6 +48,7 @@ function resolveRowMarkDateCheckIn(
case 2: $candidate = dt($NachbereitungsTimeDetail->date_start ?? null); break;
case 3: $candidate = dt($RePackagingTimeDetail->date_start ?? null); break;
case 4: $candidate = dt($PackingNoteDetail->date_redelivery ?? null); break;
case 5: $candidate = dt($DispoTimeDetail->date_end ?? null); break;
default: $candidate = null; break;
}
if (!$candidate) {
@@ -88,6 +89,7 @@ foreach ($data_output as $packingjob) {
// Zeit-Slots aus dem Schedule
$NachbereitungsTimeDetail = null;
$RePackagingTimeDetail = null;
$DispoTimeDetail = null;
if ($orderdetail_output && !empty($orderdetail_output->order_schedule)) {
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
if ($scheduledetail->name == Nachbereitung_Zeitvariable) {
@@ -96,6 +98,9 @@ foreach ($data_output as $packingjob) {
if ($scheduledetail->name == Rückpacken_Zeitvariable) {
$RePackagingTimeDetail = $scheduledetail;
}
if ($scheduledetail->name == "Dispo") {
$DispoTimeDetail = $scheduledetail;
}
}
}

View File

@@ -59,6 +59,7 @@ function resolveRowMarkDateCheckIn(
$NachbereitungsTimeDetail,
$RePackagingTimeDetail,
$PackingNoteDetail,
$DispoTimeDetail,
int $source
): ?DateTimeImmutable {
$candidate = null;
@@ -67,6 +68,8 @@ function resolveRowMarkDateCheckIn(
case 2: $candidate = dt($NachbereitungsTimeDetail->date_start ?? null); break;
case 3: $candidate = dt($RePackagingTimeDetail->date_start ?? null); break;
case 4: $candidate = dt($PackingNoteDetail->date_redelivery ?? null); break;
case 5: $candidate = dt($DispoTimeDetail->date_end ?? null); break;
default: $candidate = null; break;
}
if (!$candidate) {
@@ -121,7 +124,7 @@ foreach ($data_output as $packingjob) {
// Zeit-Slots aus dem Schedule
$NachbereitungsTimeDetail = null;
$RePackagingTimeDetail = null;
$DispoTimeDetail = null;
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
if ($scheduledetail->name == Nachbereitung_Zeitvariable) {
$NachbereitungsTimeDetail = $scheduledetail;
@@ -129,6 +132,9 @@ foreach ($data_output as $packingjob) {
if ($scheduledetail->name == Rückpacken_Zeitvariable) {
$RePackagingTimeDetail = $scheduledetail;
}
if ($scheduledetail->name == "Dispo") {
$DispoTimeDetail = $scheduledetail;
}
}
// --- Row-Marking bestimmen (konfigurierbar, analog Checkout) ---
@@ -146,6 +152,7 @@ foreach ($data_output as $packingjob) {
$NachbereitungsTimeDetail,
$RePackagingTimeDetail,
$PackingNoteDetail,
$DispoTimeDetail,
$source
);
@@ -163,7 +170,7 @@ foreach ($data_output as $packingjob) {
echo "<td>" . $packingjob->event . "</td>";
// Zeitspalte öffnen, wenn mindestens eine Anzeige aktiv ist
if (ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin || ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin) {
if (ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin || ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin || ShowDispoEndOnCheckin) {
echo "<td>";
}
@@ -190,7 +197,13 @@ foreach ($data_output as $packingjob) {
echoMarkedTimeLine($PackingNoteDetail->date_redelivery, (int)$PackingNoteDetail->time_redelivery, $today, ShowTimesOnCheckin);
}
if (ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin || ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin) {
// Dispo Ende
if (ShowDispoEndOnCheckin && $DispoTimeDetail && $DispoTimeDetail->date_end != null) {
if (ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin || ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin) echo "<br>";
echoMarkedTimeLine($DispoTimeDetail->date_end, (int)$DispoTimeDetail->time_end, $today, ShowTimesOnCheckin);
}
if (ShowCheckInTimeOnCheckin || ShowNachbereitungTimeOnCheckin || ShowRePackagingTimeOnCheckin || ShowReDeliveryTimeOnCheckin || ShowDispoEndOnCheckin) {
echo "</td>";
}
@@ -218,25 +231,25 @@ foreach ($data_output as $packingjob) {
}
if ($PackingNoteDetail->is_self_redeliver) {
echo '<i class="fa-solid fa-person-walking fa-lg"></i>';
echo '<i class="'.SelbstabholerIcon.'"></i>';
} else {
if (preg_match('/' . KurierContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-solid fa-hand-holding-dollar fa-lg"></i>';
echo '<i class="'.KurierIcon.'"></i>';
}
if (preg_match('/' . SpeditionContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-solid fa-truck fa-lg"></i>';
echo '<i class="'.SpeditionIcon.'"></i>';
}
if (preg_match('/' . DHLContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-brands fa-dhl fa-2xl"></i>';
echo '<i class="'.DHLIcon.'"></i>';
}
if (preg_match('/' . LKWContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-truck fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.LKWIcon.'"></i>';
}
if (preg_match('/' . TransporterContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-van-shuttle fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.TransporterIcon.'"></i>';
}
if (preg_match('/' . PKWContainsText . '/i', $PackingNoteDetail->shipping_in)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-car fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.PKWIcon.'"></i>';
}
}
echo "</td>";
@@ -250,10 +263,21 @@ foreach ($data_output as $packingjob) {
}
}
function getTimeFromSeconds(string $timestring) {
$hours = floor($timestring / 3600);
$mins = floor($timestring / 60 % 60);
$secs = floor($timestring % 60);
$timeFormat = sprintf('%02d:%02d', $hours, $mins);
return $timeFormat;
function getTimeFromSeconds($seconds): string {
if ($seconds === null || $seconds === '') {
return '';
}
// robust normalisieren: String/Float -> Float -> gerundet -> Int
$seconds = (int) round((float) $seconds);
if ($seconds < 0) {
$seconds = 0; // oder: return ''; je nach gewünschtem Verhalten
}
// reine Integer-Arithmetik, keine impliziten float->int Casts
$hours = intdiv($seconds, 3600);
$mins = intdiv($seconds % 3600, 60);
return sprintf('%02d:%02d', $hours, $mins);
}

View File

@@ -39,7 +39,7 @@ function dayStart(DateTimeImmutable $d): DateTimeImmutable {
return $d->setTime(0, 0, 0);
}
function resolveRowMarkDate($packingjob, $VorbereitungsTimeDetail, $PackingNoteDetail, int $source): ?DateTimeImmutable {
function resolveRowMarkDate($packingjob, $VorbereitungsTimeDetail, $PackingNoteDetail, $DispoTimeDetail, int $source): ?DateTimeImmutable {
$candidate = null;
switch ($source) {
case 1: $candidate = dt($packingjob->date_start ?? null);
@@ -50,6 +50,8 @@ function resolveRowMarkDate($packingjob, $VorbereitungsTimeDetail, $PackingNoteD
break;
case 4: $candidate = dt($PackingNoteDetail->date_delivery ?? null);
break;
case 5: $candidate = dt($DispoTimeDetail->date_start ?? null);
break;
default: $candidate = null;
break;
}
@@ -131,11 +133,15 @@ if (
}
$VorbereitungsTimeDetail = null;
$DispoTimeDetail = null;
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
if ($scheduledetail->name == Vorbereitungs_Zeitvariable) {
$VorbereitungsTimeDetail = $scheduledetail;
}
if($scheduledetail->name == "Dispo"){
$DispoTimeDetail = $scheduledetail;
}
}
// --- Row-Marking Datum bestimmen (konfigurierbar) ---
@@ -146,7 +152,7 @@ if (
$limit = $todayFilter->modify('+' . (int) CheckOut_FutureDays . ' day');
}
$markDate = resolveRowMarkDate($packingjob, $VorbereitungsTimeDetail, $PackingNoteDetail, (int) CheckOutRowMarkSource);
$markDate = resolveRowMarkDate($packingjob, $VorbereitungsTimeDetail, $PackingNoteDetail, $DispoTimeDetail, (int) CheckOutRowMarkSource);
if (CheckOut_FutureDays == -1 || ($markDate && $markDate <= $limit)) {
$trClass = rowClassForDate($markDate, $today);
@@ -165,7 +171,7 @@ if (
echo "<td>" . $packingjob->contact->name . "</td>";
echo "<td>" . $packingjob->event . "</td>";
if (ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout || ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout) { echo "<td>";}
if (ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout || ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoStartOnCheckout) { echo "<td>";}
if (ShowCheckoutTimeOnCheckout && $packingjob->date_start != null) {
@@ -206,9 +212,14 @@ if (
}
echoMarkedTimeLine($PackingNoteDetail->date_delivery, (int) $PackingNoteDetail->time_delivery, $today, ShowTimesOnCheckout);
}
if (ShowDispoStartOnCheckout && $DispoTimeDetail->date_start && $DispoTimeDetail->time_start != null) {
if (ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout || ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout) {
echo "<br>";
}
echoMarkedTimeLine($DispoTimeDetail->date_start, (int) $DispoTimeDetail->time_start, $today, ShowTimesOnCheckout);
}
if (ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout || ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout) {
if (ShowCheckoutTimeOnCheckout || ShowVorbereitungTimeOnCheckout || ShowPackagingTimeOnCheckout || ShowDeliveryTimeOnCheckout || ShowDispoStartOnCheckout) {
echo "</td>";
}
@@ -236,25 +247,25 @@ if (
}
if ($PackingNoteDetail->is_self_pickup) {
echo '<i class="fa-solid fa-person-walking fa-lg"></i>';
echo '<i class="'.SelbstabholerIcon.'"></i>';
} else {
if (preg_match('/' . KurierContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-solid fa-hand-holding-dollar fa-lg"></i>';
echo '<i class="'.KurierIcon.'"></i>';
}
if (preg_match('/' . SpeditionContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-solid fa-truck fa-lg"></i>';
echo '<i class="'.SpeditionIcon.'"></i>';
}
if (preg_match('/' . DHLContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-brands fa-dhl fa-2xl"></i>';
echo '<i class="'.DHLIcon.'"></i>';
}
if (preg_match('/' . LKWContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-truck fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.LKWIcon.'"></i>';
}
if (preg_match('/' . TransporterContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-van-shuttle fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.TransporterIcon.'"></i>';
}
if (preg_match('/' . PKWContainsText . '/i', $PackingNoteDetail->shipping_out)) {
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="fa-solid fa-car fa-lg"></i>';
echo '<i class="fa-solid fa-industry fa-lg"></i><i class="'.PKWIcon.'"></i>';
}
}
echo "</td>";
@@ -284,15 +295,35 @@ function echoMarkedTimeLine(?string $dateStr, ?int $timeSeconds, DateTimeImmutab
echo $cls ? "</span>" : "";
}
/*
function getTimeFromSeconds(string $timestring) {
$hours = floor($timestring / 3600);
$mins = floor($timestring / 60 % 60);
$secs = floor($timestring % 60);
$mins = floor(round($timestring / 60 % 60));
$secs = floor(round($timestring % 60));
$timeFormat = sprintf('%02d:%02d', $hours, $mins);
return $timeFormat;
}*/
function getTimeFromSeconds($seconds): string {
if ($seconds === null || $seconds === '') {
return '';
}
// robust normalisieren: String/Float -> Float -> gerundet -> Int
$seconds = (int) round((float) $seconds);
if ($seconds < 0) {
$seconds = 0; // oder: return ''; je nach gewünschtem Verhalten
}
// reine Integer-Arithmetik, keine impliziten float->int Casts
$hours = intdiv($seconds, 3600);
$mins = intdiv($seconds % 3600, 60);
return sprintf('%02d:%02d', $hours, $mins);
}
?>

View File

@@ -19,7 +19,19 @@
<div class="sb-nav-link-icon"><i class="fas fa-tags"></i></div>
Labelprint
</a>
<a class="nav-link" href=imagecheck.php>
<div class="sb-nav-link-icon"><i class="fas fa-image"></i></div>
Imagecheck
</a>
<a class="nav-link" href=groupofgoodscheck.php>
<div class="sb-nav-link-icon"><i class="fas fa-layer-group"></i></div>
Warengruppencheck
</a>
<a class="nav-link" href=ROI.php>
<div class="sb-nav-link-icon"><i class="fas fa-comment-dollar"></i></div>
Return-Of-Invest
</a>
<div class="sb-sidenav-menu-heading">Addons</div>
<a class="nav-link" target="_blank" href="../Packmonitor.php">
<div class="sb-nav-link-icon"><i class="fas fa-box-open"></i></div>