Merge pull request #162 from exciler/trackingstatus

Tracking Status from Sendcloud fixes
This commit is contained in:
OpenXE-ERP 2024-11-05 14:38:36 +01:00 committed by GitHub
commit 968a8fb6ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -138,6 +138,7 @@ class SendCloudApi
case 'shipment-on-route':
case 'driver-on-route':
$highest = ShipmentStatus::EnRoute;
break;
case 'delivered': return ShipmentStatus::Delivered;
}
}

View File

@ -27,7 +27,7 @@ $shipments = $db->fetchGroup($shipments_sql);
foreach ($shipments as $module => $vps) {
list($moduleId, $moduleName) = explode(';', $module,2);
$module = $app->erp->LoadVersandModul($moduleName, $moduleName);
$module = $app->erp->LoadVersandModul($moduleName, intval($moduleId));
foreach ($vps as $vp) {
$status = match ($module->GetShipmentStatus($vp['tracking'])) {
@ -38,6 +38,6 @@ foreach ($shipments as $module => $vps) {
};
if ($status === null || $status === $vp['status']) continue;
$db->perform('UPDATE versandpakete SET status = :status WHERE id = :id',
[':status' => $status, ':id' => $vp['id']]);
['status' => $status, 'id' => $vp['id']]);
}
}