Skip to content

Commit 0d1d3b9

Browse files
warredrWarre Dreesen
andauthored
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 <[email protected]>
1 parent 3feabbd commit 0d1d3b9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/vies-dotnet-api/Validators/BEVatValidator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
namespace Padi.Vies.Validators;
2020

2121
/// <summary>
22-
///
22+
///
2323
/// </summary>
2424
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
2525
public sealed class BeVatValidator : VatValidatorAbstract
@@ -34,14 +34,14 @@ public BeVatValidator()
3434
this.Regex = _regex;
3535
CountryCode = COUNTRY_CODE;
3636
}
37-
37+
3838
protected override VatValidationResult OnValidate(string vat)
3939
{
40-
if (vat.Length == 10 && vat[0] != '0')
40+
if (vat.Length == 10 && vat[0] != '0' && vat[0] != '1')
4141
{
42-
return VatValidationResult.Failed("First character of 10 digit numbers should be 0.");
42+
return VatValidationResult.Failed("First character of 10 digit numbers should be 0 or 1.");
4343
}
44-
44+
4545
if (vat.Length == 9)
4646
{
4747
vat = vat.PadLeft(10, '0');
@@ -54,4 +54,4 @@ protected override VatValidationResult OnValidate(string vat)
5454
? VatValidationResult.Failed("Invalid BE vat: checkValue.")
5555
: VatValidationResult.Success();
5656
}
57-
}
57+
}

0 commit comments

Comments
 (0)