Skip to content

Commit

Permalink
Fix problem zero at the beginning of pharmacode
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasuhiro Asaka committed Jun 10, 2013
1 parent 24e6725 commit bc41b23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/oddb2xml/extractor.rb
Expand Up @@ -176,6 +176,9 @@ def to_hash
item[:company_ean] = (gln = comp.at_xpath('.//GLN')) ? gln.text : ''
end
unless item[:pharmacode].empty?
if item[:pharmacode].length != 7 # restore zero at the beginnig
item[:pharmacode] = ("%07i" % item[:pharmacode])
end
unless data[item[:pharmacode]] # pharmacode => GTINs
data[item[:pharmacode]] = []
end
Expand Down

0 comments on commit bc41b23

Please sign in to comment.