Skip to content

Commit

Permalink
fixed bug on cif validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Cruz committed Jan 27, 2016
1 parent ba9ecf0 commit a4151a2
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 a4151a2

Please sign in to comment.