bbmb 2.3.2 → 2.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +5 -0
- data/lib/bbmb/html/state/current_order.rb +0 -0
- data/lib/bbmb/persistence/odba/model/customer.rb +0 -0
- data/lib/bbmb/util/server.rb +13 -8
- data/lib/bbmb/util/transfer_dat.rb +10 -4
- data/lib/bbmb/version.rb +1 -1
- data/test/util/test_server.rb +1 -1
- data/test/util/test_transfer_dat.rb +10 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ff9459b32c6df0de3e361c40cab590525be4e23
|
4
|
+
data.tar.gz: dca078b97bb5d78f8e0eccf46d9936c3145eb617
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594ade1264d92c1996750076cfbef881c13679daccad97a8ebd630754521bace73435ffb335d3b9e2558ecf738c616c46fff66c990f1283a24c9b5afba565152
|
7
|
+
data.tar.gz: 3a0907bcfd4a9d80096ea3f29f29b3dafb0b53ea23e46b1adab850e41896bdffca6d7573c3eae54c018e8722831907030895edde530b361f433f07667148fea7
|
data/History.txt
CHANGED
File without changes
|
File without changes
|
data/lib/bbmb/util/server.rb
CHANGED
@@ -59,23 +59,28 @@ module BBMB
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
order = Model::Order.new(customer)
|
62
|
-
products.each
|
63
|
-
|
62
|
+
products.each do |info|
|
63
|
+
product = Model::Product.find_by_pcode(info[:pcode]) \
|
64
64
|
|| Model::Product.find_by_ean13(info[:ean13]) \
|
65
|
-
|| Model::Product.find_by_article_number(info[:article_number])
|
65
|
+
|| Model::Product.find_by_article_number(info[:article_number])
|
66
|
+
if info[:pcode] || product
|
67
|
+
unless product
|
68
|
+
product = Model::Product.new(info[:pcode])
|
69
|
+
product.description.de = "pharmacode #{info[:pcode]}"
|
70
|
+
product.odba_store
|
71
|
+
end
|
66
72
|
order.add(info[:quantity], product)
|
67
73
|
[:article_number, :backorder].each do |key|
|
68
74
|
info.store key, product.send(key)
|
69
75
|
end
|
70
|
-
|
76
|
+
|
77
|
+
info.store :description, product.description.de
|
71
78
|
info[:deliverable] = info[:quantity]
|
72
79
|
else
|
73
80
|
info[:deliverable] = 0
|
74
81
|
end
|
75
|
-
|
76
|
-
infos.each { |key, value|
|
77
|
-
order.send("#{key}=", value)
|
78
|
-
}
|
82
|
+
end
|
83
|
+
infos.each { |key, value| order.send("#{key}=", value) }
|
79
84
|
customer.inject_order(order)
|
80
85
|
if opts[:deliver]
|
81
86
|
@app.send_order order, customer
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
# TransferDat -- bbmb -- 31.10.2002 -- hwyss@ywesee.com
|
2
|
+
# TransferDat -- bbmb -- 31.10.2002 -- hwyss@ywesee.com
|
3
3
|
|
4
4
|
require 'bbmb/model/order'
|
5
5
|
|
@@ -7,9 +7,15 @@ module BBMB
|
|
7
7
|
module Util
|
8
8
|
module TransferDat
|
9
9
|
def TransferDat.parse(io)
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
begin
|
11
|
+
io.rewind
|
12
|
+
data = io.read
|
13
|
+
lines = data.split(/[\r\n]+/)
|
14
|
+
rescue ArgumentError => error
|
15
|
+
raise error unless io.is_a?(File)
|
16
|
+
lines = File.open(io, external_encoding: Encoding::ISO_8859_1).read.split(/[\r\n]+/)
|
17
|
+
end
|
18
|
+
lines.collect { |line|
|
13
19
|
if(parsed = parse_line(line))
|
14
20
|
yield parsed
|
15
21
|
end
|
data/lib/bbmb/version.rb
CHANGED
data/test/util/test_server.rb
CHANGED
@@ -43,6 +43,16 @@ class TestTransferDat < Minitest::Test
|
|
43
43
|
end
|
44
44
|
assert_equal(2, count)
|
45
45
|
end
|
46
|
+
def test_parse_iso_8859
|
47
|
+
data_dir = File.expand_path(File.join(__FILE__, '../../data'))
|
48
|
+
src = File.open(File.join(data_dir, 'transfer_leima_iso_8859-1.dat'))
|
49
|
+
count = 0
|
50
|
+
TransferDat.parse(src) do |info|
|
51
|
+
assert_instance_of(Model::Order::Info, info)
|
52
|
+
count += 1
|
53
|
+
end
|
54
|
+
assert_equal(92, count)
|
55
|
+
end
|
46
56
|
end
|
47
57
|
end
|
48
58
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bbmb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaomi Hatakeyama, Zeno R.R. Davatz, Niklaus Giger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: odba
|
@@ -426,6 +426,7 @@ files:
|
|
426
426
|
- lib/bbmb/util/updater.rb
|
427
427
|
- lib/bbmb/version.rb
|
428
428
|
- readme.md
|
429
|
+
- test/data/transfer_leima_iso_8859-1.dat
|
429
430
|
- test/data/ydim.yml
|
430
431
|
- test/examples/sandoz.xundart@bbmb.ch.20110524001038.928592
|
431
432
|
- test/examples/simple_email.txt
|
@@ -470,6 +471,7 @@ signing_key:
|
|
470
471
|
specification_version: 4
|
471
472
|
summary: browser based orders of medical drugs
|
472
473
|
test_files:
|
474
|
+
- test/data/transfer_leima_iso_8859-1.dat
|
473
475
|
- test/data/ydim.yml
|
474
476
|
- test/examples/sandoz.xundart@bbmb.ch.20110524001038.928592
|
475
477
|
- test/examples/simple_email.txt
|