Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow new VAT numbers in Belgium #21

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/vies-dotnet-api/Validators/BEVatValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ limitations under the License.
namespace Padi.Vies.Validators;

/// <summary>
///
///
/// </summary>
[SuppressMessage("Microsoft.Performance", "CA1812:AvoidUninstantiatedInternalClasses")]
public sealed class BeVatValidator : VatValidatorAbstract
Expand All @@ -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.");
warredr marked this conversation as resolved.
Show resolved Hide resolved
}

if (vat.Length == 9)
{
vat = vat.PadLeft(10, '0');
Expand All @@ -54,4 +54,4 @@ protected override VatValidationResult OnValidate(string vat)
? VatValidationResult.Failed("Invalid BE vat: checkValue.")
: VatValidationResult.Success();
}
}
}