bbmb 2.3.0 → 2.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.txt +6 -0
- data/bbmb.gemspec +0 -0
- data/bin/bbmb_admin +13 -1
- data/lib/bbmb/config.rb +0 -0
- data/lib/bbmb/html/state/current_order.rb +0 -0
- data/lib/bbmb/html/state/customer.rb +0 -0
- data/lib/bbmb/html/state/favorites.rb +0 -0
- data/lib/bbmb/html/state/global.rb +0 -0
- data/lib/bbmb/html/state/init.rb +0 -0
- data/lib/bbmb/html/state/login.rb +0 -0
- data/lib/bbmb/html/state/viral/admin.rb +0 -0
- data/lib/bbmb/html/state/viral/customer.rb +0 -0
- data/lib/bbmb/html/util/validator.rb +0 -0
- data/lib/bbmb/html/view/head.rb +0 -0
- data/lib/bbmb/html/view/show_pass.rb +0 -0
- data/lib/bbmb/model/customer.rb +0 -0
- data/lib/bbmb/model/order.rb +0 -0
- data/lib/bbmb/persistence/odba/model/customer.rb +0 -0
- data/lib/bbmb/util/app.rb +0 -0
- data/lib/bbmb/util/server.rb +42 -1
- data/lib/bbmb/util/updater.rb +0 -0
- data/lib/bbmb/version.rb +1 -1
- data/test/model/test_customer.rb +0 -0
- data/test/util/test_polling_manager.rb +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 509fc49dd58770c80b653a8978b68fcc409c0805
|
4
|
+
data.tar.gz: 4b0a696b35073a886f6ce95306ccc06d26c2bb6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0591becd04827df23cb0e7f0099db759d3ce8298b0aa9fa79811359f27fb88c5fe8b22d7693af6e1ca1311fcd2ed7b1db8d7d2d69f7971a6c5b1e6b0950b4c1
|
7
|
+
data.tar.gz: 121df3abf31245a43270eace8db52c00ea77a127c027e23b15692fa35ba8b2ab3d75a3f6582a3824cdd81bb194a9a7aeb80c3c2a120bbe13b43be63f4c14ed6e
|
data/History.txt
CHANGED
data/bbmb.gemspec
CHANGED
File without changes
|
data/bin/bbmb_admin
CHANGED
@@ -3,7 +3,19 @@
|
|
3
3
|
|
4
4
|
require 'drb'
|
5
5
|
require 'bbmb'
|
6
|
-
|
6
|
+
require 'bbmb/config'
|
7
|
+
lib_dir = File.join(Dir.pwd, 'lib')
|
8
|
+
$: << lib_dir
|
9
|
+
[:postproc_dir, :plugin_dir].each do |add_to_required|
|
10
|
+
if BBMB.config.respond_to?(add_to_required)
|
11
|
+
dir = eval("BBMB.config.#{add_to_required}")
|
12
|
+
files = Dir.glob(File.join(dir, '*.rb'))
|
13
|
+
puts "Loading #{files}"
|
14
|
+
files.each do | file|
|
15
|
+
require file
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
7
19
|
require 'bbmb/util/app'
|
8
20
|
require 'readline'
|
9
21
|
include Readline
|
data/lib/bbmb/config.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/bbmb/html/state/init.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/bbmb/html/view/head.rb
CHANGED
File without changes
|
File without changes
|
data/lib/bbmb/model/customer.rb
CHANGED
File without changes
|
data/lib/bbmb/model/order.rb
CHANGED
File without changes
|
File without changes
|
data/lib/bbmb/util/app.rb
CHANGED
File without changes
|
data/lib/bbmb/util/server.rb
CHANGED
@@ -43,7 +43,48 @@ module BBMB
|
|
43
43
|
Mail.notify_error(e)
|
44
44
|
end
|
45
45
|
def inject_order(customer_id, products, infos, opts={})
|
46
|
-
|
46
|
+
customer = Model::Customer.find_by_customer_id(customer_id) \
|
47
|
+
|| Model::Customer.find_by_ean13(customer_id)
|
48
|
+
needed_create = false
|
49
|
+
unless customer
|
50
|
+
if idtype = opts[:create_missing_customer] && !customer_id.empty?
|
51
|
+
customer = Model::Customer.new(customer_id)
|
52
|
+
if idtype.to_s == 'ean13'
|
53
|
+
customer.ean13 = customer_id
|
54
|
+
end
|
55
|
+
BBMB.persistence.save(customer)
|
56
|
+
needed_create = true
|
57
|
+
else
|
58
|
+
raise "Unknown Customer #{customer_id}"
|
59
|
+
end
|
60
|
+
end
|
61
|
+
order = Model::Order.new(customer)
|
62
|
+
products.each { |info|
|
63
|
+
if(product = Model::Product.find_by_pcode(info[:pcode]) \
|
64
|
+
|| Model::Product.find_by_ean13(info[:ean13]) \
|
65
|
+
|| Model::Product.find_by_article_number(info[:article_number]))
|
66
|
+
order.add(info[:quantity], product)
|
67
|
+
[:article_number, :backorder].each do |key|
|
68
|
+
info.store key, product.send(key)
|
69
|
+
end
|
70
|
+
info.store :description, product.description.de
|
71
|
+
info[:deliverable] = info[:quantity]
|
72
|
+
else
|
73
|
+
info[:deliverable] = 0
|
74
|
+
end
|
75
|
+
}
|
76
|
+
infos.each { |key, value|
|
77
|
+
order.send("#{key}=", value)
|
78
|
+
}
|
79
|
+
customer.inject_order(order)
|
80
|
+
if opts[:deliver]
|
81
|
+
@app.send_order order, customer
|
82
|
+
end
|
83
|
+
if needed_create
|
84
|
+
BBMB::Util::Mail.notify_inject_error(order, opts)
|
85
|
+
end
|
86
|
+
SBSM.info "inject_order #{order.order_id} for customer_id #{customer_id} done at #{Time.now}"
|
87
|
+
{ :order_id => order.order_id, :products => products }
|
47
88
|
end
|
48
89
|
def rename_user(customer_id, old_name, new_name)
|
49
90
|
return if old_name.eql?(new_name)
|
data/lib/bbmb/util/updater.rb
CHANGED
File without changes
|
data/lib/bbmb/version.rb
CHANGED
data/test/model/test_customer.rb
CHANGED
File without changes
|
File without changes
|
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.1
|
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-06-
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: odba
|