Skip to content

Commit

Permalink
Applying fix #35 on 1.0 branch
Browse files Browse the repository at this point in the history
A fix for 2.0 branch was provided by @krzaczek, which is now patched on 1.0 branch
  • Loading branch information
DragonBe committed Sep 13, 2017
1 parent fbf98b0 commit cb1abc4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Vies/Validator/ValidatorBG.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public function validate($vatNumber)
$checkval = $this->sumWeights($weights, $vatNumber);

$checkval = ($checkval % 11) == 10 ? 0 : ($checkval % 11);
} else {
$checkval = $checkval % 11;
}

if ($checkval != $checksum) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Vies/ValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function vatNumberProvider()
return [
'AT' => ['U10223006', ['U1022300', 'A10223006', 'U10223005']],
'BE' => ['776091951', ['0776091952', '07760919']],
'BG' => ['301004503', ['10100450', '301004502']],
'BG' => [['204514061', '301004503'], ['10100450', '301004502']],
'CY' => ['00532445O', ['005324451', '0053244511', '12000139V', '72000139V']],
'CZ' => [['46505334', '7103192745', '640903926', '395601439', '630903928'],
['4650533', '96505334', '46505333', '7103192743', '1903192745', '7133192745', '395632439', '396301439', '545601439', '640903927', '7103322745']],
Expand Down

0 comments on commit cb1abc4

Please sign in to comment.