You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed an error on the checksum validation of BG VAT Numbers, take for example BG202320104. It works on the VIES VAT number validation
website:
But on the library it fails when calling public static VatValidationResult IsValid(string vat)
Internally in BgVatValidator the checksum returns 9 instead of 11 or 10 and then it fails:
private static VatValidationResult Validate9DigitVat(ReadOnlySpan<char> vatSpan)
{
var sum = vatSpan.Sum(MultipliersPhysicalPerson);
var checkDigit = sum % 11;
if (checkDigit == 10)
{
sum = 0;
for (var index = 0; index < 8; index++)
{
sum += vatSpan[index].ToInt() * (index + 3);
}
checkDigit = sum % 11;
if (checkDigit == 10)
{
checkDigit = 0;
}
}
Thanks
The text was updated successfully, but these errors were encountered:
Hi there,
I noticed an error on the checksum validation of BG VAT Numbers, take for example BG202320104. It works on the VIES VAT number validation

website:
But on the library it fails when calling
public static VatValidationResult IsValid(string vat)
Internally in
BgVatValidator
the checksum returns 9 instead of 11 or 10 and then it fails:Thanks
The text was updated successfully, but these errors were encountered: