27-05-2026 DHL Modul v2.1 / Optimierung tracking

This commit is contained in:
Kevin Adametz 2026-05-27 18:51:23 +02:00
parent 036595be94
commit 2bdc9ada3c
33 changed files with 2367 additions and 2086 deletions

View file

@ -179,7 +179,7 @@ class DhlShipmentController extends Controller
return '<span class="text-muted">N/A</span>';
})
->addColumn('customer', function ($shipment) {
return $shipment->firstname.' '.$shipment->lastname;
return e(trim($shipment->firstname.' '.$shipment->lastname));
})
->editColumn('dhl_shipment_no', function ($shipment) {
return $shipment->dhl_shipment_no ? '<code class="text-success">'.e($shipment->dhl_shipment_no).'</code>' : '<span class="text-muted">-</span>';
@ -573,11 +573,13 @@ class DhlShipmentController extends Controller
private function getBillingAddressForReturn($shippingUser, array $recipient): array
{
if (! $shippingUser) {
Log::warning('[DHL Controller] No shipping user found, using recipient data', [
'recipient' => $recipient,
Log::warning('[DHL Controller] No shipping user found, using recipient country only', [
'order_recipient_country' => $recipient['country'] ?? null,
]);
// Fallback: use recipient data but without Packstation fields
// Fallback: use recipient data but without Packstation fields.
// We keep ISO-2 country codes here so that ReturnsService /
// DhlProductResolver can normalize / validate them consistently.
return [
'name' => trim(($recipient['firstname'] ?? '').' '.($recipient['lastname'] ?? '')),
'name2' => $recipient['company'] ?? '',
@ -585,7 +587,7 @@ class DhlShipmentController extends Controller
'houseNumber' => '',
'postalCode' => $recipient['postalCode'] ?? '',
'city' => $recipient['city'] ?? '',
'country' => $recipient['country'] ?? 'DEU',
'country' => $recipient['country'] ?? DhlProductResolver::DOMESTIC_COUNTRY,
'email' => $recipient['email'] ?? '',
'phone' => $recipient['phone'] ?? '',
];
@ -609,7 +611,7 @@ class DhlShipmentController extends Controller
'houseNumber' => $houseNumber,
'postalCode' => $shippingUser->billing_zipcode ?? '',
'city' => $shippingUser->billing_city ?? '',
'country' => $shippingUser->billing_country?->code ?? 'DEU',
'country' => $shippingUser->billing_country?->code ?? DhlProductResolver::DOMESTIC_COUNTRY,
'email' => $shippingUser->billing_email ?? '',
'phone' => $shippingUser->billing_phone ?? '',
];
@ -665,7 +667,7 @@ class DhlShipmentController extends Controller
'houseNumber' => $recipient['houseNumber'] ?? '',
'postalCode' => $recipient['postalCode'] ?? '',
'city' => $recipient['city'] ?? '',
'country' => $recipient['country'] ?? 'DEU',
'country' => $recipient['country'] ?? DhlProductResolver::DOMESTIC_COUNTRY,
'email' => $recipient['email'] ?? '',
'phone' => $recipient['phone'] ?? '',
];
@ -688,7 +690,7 @@ class DhlShipmentController extends Controller
'houseNumber' => $dhlConfig['sender']['house_number'] ?? '2',
'postalCode' => $dhlConfig['sender']['postalCode'] ?? '87755',
'city' => $dhlConfig['sender']['city'] ?? 'Kirchhaslach',
'country' => $dhlConfig['sender']['country'] ?? 'DEU',
'country' => $dhlConfig['sender']['country'] ?? DhlProductResolver::DOMESTIC_COUNTRY,
'email' => $dhlConfig['sender']['email'] ?? 'versand@mivita.care',
'phone' => $dhlConfig['sender']['phone'] ?? '+49 123 456789',
],