From 09598b57b559c6af72eef2e844f238f6a63a2e7d Mon Sep 17 00:00:00 2001 From: Nathan Utama Date: Tue, 31 Oct 2023 12:09:00 +0100 Subject: [PATCH] Fix BE VAT validation --- src/IsoCodes/Vat.php | 2 +- tests/IsoCodes/Tests/VatTest.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/IsoCodes/Vat.php b/src/IsoCodes/Vat.php index d4753df..cf6753f 100644 --- a/src/IsoCodes/Vat.php +++ b/src/IsoCodes/Vat.php @@ -20,7 +20,7 @@ class Vat implements IsoCodeInterface */ public static $patterns = [ 'AT' => 'U[A-Z\d]{8}', - 'BE' => '0\d{9}', + 'BE' => '(0|1)\d{9}', 'BG' => '\d{9,10}', 'CY' => '\d{8}[A-Z]', 'CZ' => '\d{8,10}', diff --git a/tests/IsoCodes/Tests/VatTest.php b/tests/IsoCodes/Tests/VatTest.php index 6680053..0274fa6 100644 --- a/tests/IsoCodes/Tests/VatTest.php +++ b/tests/IsoCodes/Tests/VatTest.php @@ -20,6 +20,7 @@ public function getValidValues() ['EL123456789'], ['PT123456789'], ['BE0123456789'], + ['BE1234567890'], ['PL1234567890'], ['SK1234567890'], ['ATU12345678'], @@ -82,7 +83,7 @@ public function getInvalidValues() ['EL123456'], ['PT12345'], ['BE123456789'], - ['BE1234567890'], + ['BE2234567890'], ['BE1234'], ['PL123'], ['SK12'],