oddb2xml 1.5.3 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ === 1.5.4 / 08.07.2013
2
+
3
+ * Update to import VAT from zurrose transfer.dat
4
+
1
5
  === 1.5.3 / 08.07.2013
2
6
 
3
7
  * Add -p option for zurrose transfer.dat
@@ -543,6 +543,10 @@ module Oddb2xml
543
543
  if no8
544
544
  ppac = ((_ppac = @packs[no8.intern] and !_ppac[:is_tier]) ? _ppac : nil)
545
545
  end
546
+ price = nil
547
+ if !@prices.empty? && de_idx[:ean] && @prices[de_idx[:ean]]
548
+ price = @prices[de_idx[:ean]] # zurrose
549
+ end
546
550
  xml.ART('DT' => '') {
547
551
  xml.PHAR de_idx[:pharmacode] unless de_idx[:pharmacode].empty?
548
552
  #xml.GRPCD
@@ -559,7 +563,10 @@ module Oddb2xml
559
563
  #xml.HOSPCD
560
564
  #xml.CLINCD
561
565
  #xml.ARTTYP
562
- #xml.VAT
566
+ if price
567
+ xml.VAT price[:vat]
568
+ end
569
+
563
570
  if de_idx
564
571
  xml.SALECD(de_idx[:status].empty? ? 'N' : de_idx[:status])
565
572
  end
@@ -646,12 +653,11 @@ module Oddb2xml
646
653
  #xml.LINENO
647
654
  #xml.NOUNITS
648
655
  #}
649
- if !@prices.empty? && de_idx[:ean] && \
650
- price = @prices[de_idx[:ean]] # zurrose
656
+ if price # zurrose
651
657
  xml.ARTPRI {
652
658
  xml.VDAT datetime
653
659
  xml.PTYP "ZURROSE"
654
- xml.PRICE price
660
+ xml.PRICE price[:price]
655
661
  }
656
662
  elsif pac
657
663
  pac[:prices].each_pair do |key, price|
@@ -114,7 +114,7 @@ module Oddb2xml
114
114
  class ZurroseDownloader < Downloader
115
115
  include DownloadMethod
116
116
  def download
117
- @url ||= 'http://zurrose.com/fileadmin/main/lib/download.php?file=/fileadmin/user_upload/downloads/DOS/IGM01_ohne_MwSt/Vollstamm/transfer.dat'
117
+ @url ||= 'http://zurrose.com/fileadmin/main/lib/download.php?file=/fileadmin/user_upload/downloads/ProduktUpdate/IGM11_mit_MwSt/Vollstamm/transfer.dat'
118
118
  download_as('oddb2xml_zurrose_transfer.dat', 'r:iso-8859-1:utf-8')
119
119
  end
120
120
  end
@@ -414,10 +414,11 @@ module Oddb2xml
414
414
  def to_hash
415
415
  data = {}
416
416
  while line = @io.gets
417
- next unless line =~ /(7680\d{9})\r\n$/
418
- ean = $1.to_s
419
- price = line[60,6].gsub(/(\d{2})$/, "." + $1.to_s).to_f.round(2).to_s
420
- data[ean] = price
417
+ next unless line =~ /(7680\d{9})(\d{1})\r\n$/
418
+ data[$1.to_s] = {
419
+ :vat => $2.to_s,
420
+ :price => line[60,6].gsub(/(\d{2})$/, "." + $1.to_s).to_f.round(2).to_s
421
+ }
421
422
  end
422
423
  data
423
424
  end
@@ -1,3 +1,3 @@
1
1
  module Oddb2xml
2
- VERSION = "1.5.3"
2
+ VERSION = "1.5.4"
3
3
  end
@@ -230,7 +230,7 @@ module ServerMockHelper
230
230
  end
231
231
  def setup_zurrose_server_mock
232
232
  # dat
233
- stub_dat_url = 'http://zurrose.com/fileadmin/main/lib/download.php?file=/fileadmin/user_upload/downloads/DOS/IGM01_ohne_MwSt/Vollstamm/transfer.dat'
233
+ stub_dat_url = 'http://zurrose.com/fileadmin/main/lib/download.php?file=/fileadmin/user_upload/downloads/ProduktUpdate/IGM11_mit_MwSt/Vollstamm/transfer.dat'
234
234
  stub_response = File.read(File.expand_path('../data/zurrose_transfer.dat', __FILE__))
235
235
  stub_request(:get, stub_dat_url).
236
236
  with(:headers => {
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oddb2xml
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 3
10
- version: 1.5.3
9
+ - 4
10
+ version: 1.5.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Yasuhiro Asaka, Zeno R.R. Davatz