Skip to content

Commit

Permalink
Merge pull request #6 from victor-cruz/master
Browse files Browse the repository at this point in the history
fixed bug on cif validation
  • Loading branch information
javiertoledo committed Mar 25, 2016
2 parents ba9ecf0 + a4151a2 commit 01e2cc2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/spanish_vat_validators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ def validate_cif(v)
[1,3,5,7].collect do |cont|
xxx = (2 * texto[cont,1].to_i).to_s + "0"
impares += xxx[0,1].to_i + xxx[1,1].to_i
pares += texto[cont+1,1].to_i
end

xxx = (2 * texto[8,1].to_i).to_s + "0"
impares += xxx[0,1].to_i + xxx[1,1].to_i
[2,4,6].collect do |cont|
pares += texto[cont,1].to_i
end

suma = (pares + impares).to_s
unumero = suma.last.to_i
Expand Down
2 changes: 1 addition & 1 deletion lib/spanish_vat_validators/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SpanishVatValidators
VERSION = "0.0.4"
VERSION = "0.0.5"
end

0 comments on commit 01e2cc2

Please sign in to comment.