121 lines
4.7 KiB
PHP
121 lines
4.7 KiB
PHP
<?php
|
|
|
|
require('../config.php');
|
|
require('../EpiApi.php');
|
|
|
|
use chillerlan\QRCode\{
|
|
QRCode,
|
|
QROptions
|
|
};
|
|
|
|
require('../vendor/autoload.php');
|
|
|
|
$options = new QROptions([
|
|
'imageBase64' => false,
|
|
'qrCodeHeight' => 75,
|
|
'qrCodeWidth' => 75,
|
|
'version' => -1,
|
|
'quietzoneSize' => 1
|
|
]);
|
|
|
|
|
|
$Epi = new Epirent();
|
|
|
|
|
|
$result = $Epi->requestEpiApi('/v1/packingnote/open?isci=False&cl=' . Epirent_Mandant);
|
|
|
|
$data_output = json_decode($result)->payload;
|
|
|
|
|
|
|
|
|
|
foreach ($data_output as $packingjob) {
|
|
|
|
|
|
|
|
|
|
if ($packingjob->is_archived != true) {
|
|
|
|
//get OrderDetails
|
|
$result = $Epi->requestEpiApi('/v1/order/' . $packingjob->order_pk . '?cl=' . Epirent_Mandant);
|
|
|
|
$orderdetail_output = json_decode($result)->payload[0];
|
|
|
|
$VorbereitungsTimeDetail;
|
|
|
|
foreach ($orderdetail_output->order_schedule as $scheduledetail) {
|
|
|
|
if ($scheduledetail->name == Vorbereitungs_Zeitvariable) {
|
|
$VorbereitungsTimeDetail = $scheduledetail;
|
|
}
|
|
}
|
|
//End Of get Order Details
|
|
|
|
if (CheckOut_UseDispoStartForRowMarking || ($VorbereitungsTimeDetail->date_start == null)) {
|
|
$date = new DateTime($packingjob->date_start);
|
|
} else {
|
|
$date = new DateTime($VorbereitungsTimeDetail->date_start);
|
|
}
|
|
|
|
$date->setTime(0, 0, 0);
|
|
$today = new DateTime();
|
|
$today->setTime(0, 0, 0);
|
|
|
|
$todayFilter = new DateTime();
|
|
$todayFilter->setTime(0, 0, 0);
|
|
if (CheckOut_FutureDays == -1 || $date <= ($todayFilter->modify('+' . CheckOut_FutureDays . ' day'))) {
|
|
//prüfe, ob entweder unbegrenzte (-1) Anzeige Aktiv ist, oder das Datum kleiner oder Gleich heute + Zukunftsspanne ist
|
|
if ($date == $today) {
|
|
|
|
echo "<tr class='text-dark bg-warning'>";
|
|
} else if ($date < $today) {
|
|
echo "<tr class=' bg-danger'>";
|
|
} else {
|
|
echo "<tr>";
|
|
}
|
|
|
|
if (Enable_QR_Code_CheckOut) {
|
|
echo "<td>" . '<div style="width: 5vb;">' . (new QRCode($options))->render($packingjob->packingnote_no) . "</div></td>";
|
|
} else {
|
|
echo "<td>" . $packingjob->packingnote_no . "</td>";
|
|
}
|
|
echo "<td>" . $packingjob->contact->name . "</td>";
|
|
echo "<td>" . $packingjob->event . "</td>";
|
|
if ($VorbereitungsTimeDetail->date_start != null) {
|
|
echo "<td><small>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</small><br><i>" . date_format(new \DateTime($VorbereitungsTimeDetail->date_start), 'd.m.Y') . " " . getTimeFromSeconds($VorbereitungsTimeDetail->time_start) . "</i></td>";
|
|
} else {
|
|
echo "<td>" . date_format(new \DateTime($packingjob->date_start), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_start) . "</td>";
|
|
}
|
|
if ($VorbereitungsTimeDetail->date_end != null) {
|
|
echo "<td><small>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</small><br><i>" . date_format(new \DateTime($VorbereitungsTimeDetail->date_end), 'd.m.Y') . " " . getTimeFromSeconds($VorbereitungsTimeDetail->time_end) . "</i></td>";
|
|
} else {
|
|
echo "<td>" . date_format(new \DateTime($packingjob->date_end), 'd.m.Y') . " " . getTimeFromSeconds($packingjob->time_end) . "</td>";
|
|
}
|
|
echo "<td>";
|
|
|
|
if ($packingjob->is_all_out == 0) {
|
|
echo "<span class='badge badge-success'>";
|
|
} else {
|
|
echo '<div class="progress"><div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: '.(($packingjob->ps_parameters->result->total_pieces - abs($packingjob->is_all_out))/$packingjob->ps_parameters->result->total_pieces)*100 .'%" aria-valuenow="' . ($packingjob->ps_parameters->result->total_pieces - abs($packingjob->is_all_out)) . '" aria-valuemin="0" aria-valuemax="' . $packingjob->ps_parameters->result->total_pieces . '"></div></div>';
|
|
|
|
echo "<span class='badge badge-info'>";
|
|
}
|
|
echo ($packingjob->ps_parameters->result->total_pieces - abs($packingjob->is_all_out)) . "/" . $packingjob->ps_parameters->result->total_pieces;
|
|
echo "</span><td>";
|
|
echo "</tr>";
|
|
}
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
?>
|