From 0d1d3b981bb0f8a147f5da2fa497e1dc0216abbf Mon Sep 17 00:00:00 2001 From: Warre Dreesen <32429751+warredr@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:24:16 +0100 Subject: [PATCH] Allow new VAT numbers in Belgium (#21) * fix: allow new belgium vat numbers * fix: changed validation message for BE validation --------- Co-authored-by: Warre Dreesen --- src/vies-dotnet-api/Validators/BEVatValidator.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vies-dotnet-api/Validators/BEVatValidator.cs b/src/vies-dotnet-api/Validators/BEVatValidator.cs index 10e6675..db6a539 100644 --- a/src/vies-dotnet-api/Validators/BEVatValidator.cs +++ b/src/vies-dotnet-api/Validators/BEVatValidator.cs @@ -19,7 +19,7 @@ limitations under the License. namespace Padi.Vies.Validators; /// -/// +/// /// [SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")] public sealed class BeVatValidator : VatValidatorAbstract @@ -34,14 +34,14 @@ public BeVatValidator() this.Regex = _regex; CountryCode = COUNTRY_CODE; } - + protected override VatValidationResult OnValidate(string vat) { - if (vat.Length == 10 && vat[0] != '0') + if (vat.Length == 10 && vat[0] != '0' && vat[0] != '1') { - return VatValidationResult.Failed("First character of 10 digit numbers should be 0."); + return VatValidationResult.Failed("First character of 10 digit numbers should be 0 or 1."); } - + if (vat.Length == 9) { vat = vat.PadLeft(10, '0'); @@ -54,4 +54,4 @@ protected override VatValidationResult OnValidate(string vat) ? VatValidationResult.Failed("Invalid BE vat: checkValue.") : VatValidationResult.Success(); } -} \ No newline at end of file +}