v1.4.5: Feature: CheckIn CheckOut Sortierung jetzt über Config lösbar
This commit is contained in:
@@ -29,6 +29,34 @@ $result = $Epi->requestEpiApi('/v1/packingnote/open?isco=False&cl=' . Epirent_Ma
|
||||
$data_output = json_decode($result)->payload;
|
||||
|
||||
|
||||
if (SortCheckIn == 2) {
|
||||
|
||||
|
||||
|
||||
// Prüfen, ob $data_output ein Array ist
|
||||
if (is_array($data_output)) {
|
||||
usort($data_output, function ($a, $b) {
|
||||
// Konvertiere time_start von Millisekunden in Sekunden
|
||||
$timeStartA = $a->time_end / 1000; // Zeit in Sekunden
|
||||
$timeStartB = $b->time_end / 1000;
|
||||
|
||||
// Kombiniere date_start mit time_start
|
||||
$datetimeA = strtotime($a->date_end) + $timeStartA;
|
||||
$datetimeB = strtotime($b->date_end) + $timeStartB;
|
||||
|
||||
// Vergleich für die Sortierung
|
||||
return $datetimeA <=> $datetimeB;
|
||||
});
|
||||
|
||||
// Sortierte Daten ausgeben oder weiterverarbeiten
|
||||
// print_r($data_output);
|
||||
} else {
|
||||
echo "Daten konnten nicht verarbeitet werden.";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($data_output as $packingjob) {
|
||||
|
||||
|
||||
@@ -96,16 +124,16 @@ foreach ($data_output as $packingjob) {
|
||||
|
||||
|
||||
|
||||
if ($orderdetail_output->amount_open_checkin==0) {
|
||||
if ($packingjob->is_all_in ==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: '.(($orderdetail_output->amount_checkout - $orderdetail_output->amount_open_checkin)/$orderdetail_output->amount_checkout) *100 .'%" aria-valuenow="' . ($orderdetail_output->amount_checkout - $orderdetail_output->amount_open_checkin) . '" aria-valuemin="0" aria-valuemax="' . $orderdetail_output->amount_checkout . '"></div></div>';
|
||||
echo '<div class="progress"><div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" style="width: '.(( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) / ($packingjob->pieces_sum_total - $packingjob ->is_all_out)) *100 .'%" aria-valuenow="' .( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) . '" aria-valuemin="0" aria-valuemax="' . ($packingjob->pieces_sum_total - $packingjob ->is_all_out). '"></div></div>';
|
||||
|
||||
echo "<span class='badge badge-info'>";
|
||||
}
|
||||
|
||||
echo ($orderdetail_output->amount_checkout - $orderdetail_output->amount_open_checkin) . "/" . $orderdetail_output->amount_checkout;
|
||||
echo ( $packingjob->pieces_sum_total - abs($packingjob->is_all_out) - abs($packingjob->is_all_in)) . "/" . ($packingjob->pieces_sum_total - $packingjob ->is_all_out) . " (" . $packingjob->pieces_sum_total.")";
|
||||
echo "</span><td>";
|
||||
|
||||
echo "</tr>";
|
||||
|
||||
Reference in New Issue
Block a user