bbmb 2.2.8 → 2.2.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fad1f8b5aca9d7f1c1b904f0079b7ff0ef3d9016
4
- data.tar.gz: 57549268ac39f0626347809270c0afe2658ba4e1
3
+ metadata.gz: a2d183b03706d8559019ff4dc090b85e23a9b2a8
4
+ data.tar.gz: 077a75bd3d642ece584a5e422b570ad6c296b466
5
5
  SHA512:
6
- metadata.gz: 47f3672ce1568dce96c3adc9cd7b98605df10c66c542afbbe0fa55fe0811e9131be54851824300aec1737a06c40c53533897f9c754858c76e131f236aa98bec9
7
- data.tar.gz: 65848a84b803cd7d7f836c8060b31f2643eea4d36458265d9b73d877f6cf8c88ba7bf9a6b8a247ae644e20e73630ac5de9014f6d5843adaa810a74c152ad726a
6
+ metadata.gz: 97c91fb51fbabebd497ea2504831c913103dc84c122962ebea6b4549c8cc33f6670ed98b2be15fb071355b19698e976190cea871801b58f589eed11ec74d0e85
7
+ data.tar.gz: 68a820b5779f418636da8384352c5b0a9dabe96512544568a71063bf1db99995e04078c84be6b5e0171c938aa51f2b032ebeffea35f2190c7cf83933bc006694
@@ -1,3 +1,7 @@
1
+ === 2.2.9 / 01.06.2017
2
+
3
+ * Work around order without customer and no positions
4
+
1
5
  === 2.2.8 / 30.05.2017
2
6
 
3
7
  * Add Customer set_email_without_yus for importer
@@ -172,7 +172,7 @@ class Order
172
172
  "521:PCE", "540:2", "541:%s" % @commit_time.strftime('%Y%m%d')]
173
173
  end
174
174
  def order_id
175
- sprintf "%s-%s", @customer.customer_id, @commit_id
175
+ sprintf "%s-%s" ,@customer ? @customer.customer_id : 'no_customer', @commit_id
176
176
  end
177
177
  def position(product)
178
178
  @positions.find { |pos| pos.product == product }
@@ -207,7 +207,8 @@ class Order
207
207
  end
208
208
  def total
209
209
  delete_invalid_positions
210
- @positions.inject(@shipping) { |memo, pos| pos.total + memo }
210
+ res = @positions.inject(@shipping) { |memo, pos| pos.total + memo }
211
+ res || Util::Money.new(0)
211
212
  end
212
213
  def total_incl_vat
213
214
  if rate = BBMB.config.vat_rate
@@ -64,6 +64,7 @@ module BBMB
64
64
  raise Yus::YusError
65
65
  end
66
66
  def run_invoicer
67
+ run_only_once_at_startup = false
67
68
  @invoicer ||= Thread.new {
68
69
  Thread.current.abort_on_exception = true
69
70
  loop {
@@ -73,10 +74,11 @@ module BBMB
73
74
  now = Time.now
74
75
  at = Time.local(day.year, day.month)
75
76
  secs = at - now
76
- msg = "run_invoicer sleeping %.2f seconds (or more than %d days)" % [ secs, secs/3600/24 ]
77
- SBSM.debug(msg)
78
- sleep(secs)
77
+ SBSM.debug("run_invoicer sleeping %.2f seconds. run_only_once_at_startup #{run_only_once_at_startup}" % secs)
78
+ if run_only_once_at_startup then puts "Skipped sleeping #{secs}" else sleep(secs) end
79
+ SBSM.debug("invoice starting")
79
80
  invoice(start...at)
81
+ SBSM.debug("invoice finished")
80
82
  }
81
83
  }
82
84
  end
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.2.8'
2
+ VERSION = '2.2.9'
3
3
  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.2.8
4
+ version: 2.2.9
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-05-31 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: odba