From 645009fa577ec07abcef2453f7546dde6bcdf51a Mon Sep 17 00:00:00 2001 From: jochemgravendeel Date: Mon, 25 Nov 2024 10:25:35 +0100 Subject: [PATCH 1/2] feat: allow receipt code to be used to BE --- .../Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php | 2 +- .../Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php index 8f2183a70..07452caa8 100644 --- a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php +++ b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php @@ -33,7 +33,7 @@ public function calculate(): void return; } - if ($this->order->shippingAddress->cc !== CountryCodes::CC_NL) { + if (! in_array($this->order->shippingAddress->cc, [CountryCodes::CC_NL, CountryCodes::CC_BE])) { $shipmentOptions->receiptCode = TriStateService::DISABLED; return; } diff --git a/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php b/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php index 686cb6245..dbdde4119 100644 --- a/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php +++ b/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php @@ -78,10 +78,10 @@ ], ], - 'disables receipt code when shipping to a non-NL country' => [ + 'disables receipt code when shipping to a non-NL or BE country' => [ [ShipmentOptions::RECEIPT_CODE => TriStateService::ENABLED], [ShipmentOptions::RECEIPT_CODE => TriStateService::DISABLED], - 'BE', + 'FR', ], 'disables signature, only recipient, large format and return when receipt code is enabled' => [ From 02cfb4341dd2649cdb46ccb4216d2ef5a072ef07 Mon Sep 17 00:00:00 2001 From: jochemgravendeel Date: Mon, 25 Nov 2024 10:25:54 +0100 Subject: [PATCH 2/2] feat: allow receipt code to be used to BE --- src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php index 07452caa8..e2a38c107 100644 --- a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php +++ b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php @@ -18,7 +18,7 @@ final class PostNLReceiptCodeCalculator extends AbstractPdkOrderOptionCalculator /** * Calculates the receipt code options for PostNL shipments. * When receipt code is enabled: - * - Shipment must be to the Netherlands + * - Shipment must be to the Netherlands or Belgium * - Receipt code will be disabled if age check is active * - Signature and only recipient will be disabled * - Large format will be disabled