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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95bb9df5480ff6caed99262bd25c01f5294495fa
4
- data.tar.gz: 1898c6f44136e99b25fda49015121c75e258536f
3
+ metadata.gz: 509fc49dd58770c80b653a8978b68fcc409c0805
4
+ data.tar.gz: 4b0a696b35073a886f6ce95306ccc06d26c2bb6f
5
5
  SHA512:
6
- metadata.gz: d45c865e1cc9e052a55bd8904d1cfd7a371e231c8f6815b7cdd52230545b316e58f30b7bb93cb4d480ae70680c6df20fc4ec5778dcf3fe21af88ecc593aff202
7
- data.tar.gz: d707982da74212b859464803df9f7a96140fa38d409f52a0aa3fd59e32a0c9f8cb5d9ac2007d1609c19c9938b0005e83ca9daca711f30386e7e809e738f43e01
6
+ metadata.gz: c0591becd04827df23cb0e7f0099db759d3ce8298b0aa9fa79811359f27fb88c5fe8b22d7693af6e1ca1311fcd2ed7b1db8d7d2d69f7971a6c5b1e6b0950b4c1
7
+ data.tar.gz: 121df3abf31245a43270eace8db52c00ea77a127c027e23b15692fa35ba8b2ab3d75a3f6582a3824cdd81bb194a9a7aeb80c3c2a120bbe13b43be63f4c14ed6e
@@ -1,3 +1,9 @@
1
+ === 2.3.1 / 12.06.2017
2
+
3
+ * Fix inject_order for xmlconv
4
+ * Fix starting bin/bbmb_admin
5
+ * Load :postproc_dir and :plugin_dir if defined in config
6
+
1
7
  === 2.3.0 / 07.06.2017
2
8
 
3
9
  * Use by default only the etc/config.yml inside the current working directory
File without changes
@@ -3,7 +3,19 @@
3
3
 
4
4
  require 'drb'
5
5
  require 'bbmb'
6
- $: << File.expand_path('../lib', File.dirname(__FILE__))
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -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
- @app.inject_order(customer_id, products, infos, opts)
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)
File without changes
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.3.0'
2
+ VERSION = '2.3.1'
3
3
  end
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.0
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-07 00:00:00.000000000 Z
11
+ date: 2017-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: odba