Skip to content

Commit

Permalink
fix: French VAT checksum failing for leading zero
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonBalthazar committed Jun 3, 2024
1 parent 0d07ecd commit 0e53e14
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fr/tva.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ const impl: Validator = {
if (strings.isdigits(check)) {
const sum = (12 + 3 * (parseInt(back, 10) % 97)) % 97;

if (String(sum) !== check) {
const stringSum = String(sum).padStart(2, '0');
if (stringSum !== check) {
return { isValid: false, error: new exceptions.InvalidChecksum() };
}
} else {
Expand Down

0 comments on commit 0e53e14

Please sign in to comment.