Skip to content

Commit 421d077

Browse files
committed
Fix el-GR isTaxID when checksum is 10
Add correct tax identifier to demonstrate issue and fix. Thanks to: Panos Papadopoulos
1 parent 0f8e597 commit 421d077

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib/isTaxID.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ function elGrCheck(tin) {
280280
for (let i = 0; i < 8; i++) {
281281
checksum += digits[i] * (2 ** (8 - i));
282282
}
283-
return checksum % 11 === digits[8];
283+
return ((checksum % 11) % 10) === digits[8];
284284
}
285285

286286
/*

test/validators.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9571,6 +9571,7 @@ describe('Validators', () => {
95719571
args: ['el-GR'],
95729572
valid: [
95739573
'758426713',
9574+
'032792320',
95749575
'054100004'],
95759576
invalid: [
95769577
'054100005',

0 commit comments

Comments
 (0)