From 516224ee4341a890af128e1a877f8f725bc870a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E8=81=AA?= Date: Mon, 28 Feb 2022 11:54:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E6=9C=89=E6=AC=A7=E6=B4=B2=E5=9B=BD?= =?UTF-8?q?=E5=AE=B6=E5=A2=9E=E5=8A=A0IOSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/CourierbutlerPlatform.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/platforms/CourierbutlerPlatform.php b/src/platforms/CourierbutlerPlatform.php index 630e957..cea742b 100644 --- a/src/platforms/CourierbutlerPlatform.php +++ b/src/platforms/CourierbutlerPlatform.php @@ -188,6 +188,15 @@ protected function formatOrder(Order $orderClass): array "invoice_material" => $good->enMaterial, ]; } + $extraService = []; + if (in_array($orderClass->recipient->countryCode, [ + "AT", "BE", "BG", "CY", "HR", "CZ", "DK", "EE", "FI", "FR", "DE", "GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "RO", "SK", "SI", "ES", "SE" + ])) { + $extraService = [[ + "extra_servicecode" => "IO", + "extra_servicevalue" => $orderClass->taxesNumber + ]]; + } return [ 'reference_no' => $orderClass->customerOrderNo, @@ -228,10 +237,7 @@ protected function formatOrder(Order $orderClass): array // "consignee_tariff" => $orderClass->taxesNumber, ], "invoice" => $invoice, - "extra_service" => [[ - "extra_servicecode" => "IO", - "extra_servicevalue" => $orderClass->taxesNumber - ]] + "extra_service" => $extraService, ]; } }