From 1985a69cfa113d358c4132dc29db09ea9b2f9666 Mon Sep 17 00:00:00 2001 From: Andreas Palm Date: Sun, 21 Jul 2024 21:53:25 +0200 Subject: [PATCH] Tracking Status from Sendcloud fixes --- classes/Carrier/SendCloud/SendCloudApi.php | 1 + cronjobs/shipment_tracking.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/Carrier/SendCloud/SendCloudApi.php b/classes/Carrier/SendCloud/SendCloudApi.php index be52229e..df9425e1 100644 --- a/classes/Carrier/SendCloud/SendCloudApi.php +++ b/classes/Carrier/SendCloud/SendCloudApi.php @@ -138,6 +138,7 @@ class SendCloudApi case 'shipment-on-route': case 'driver-on-route': $highest = ShipmentStatus::EnRoute; + break; case 'delivered': return ShipmentStatus::Delivered; } } diff --git a/cronjobs/shipment_tracking.php b/cronjobs/shipment_tracking.php index 5fc99cf1..0a41a011 100644 --- a/cronjobs/shipment_tracking.php +++ b/cronjobs/shipment_tracking.php @@ -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']]); } }