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 +4 -4
- data/History.txt +4 -0
- data/lib/bbmb/model/order.rb +3 -2
- data/lib/bbmb/util/server.rb +5 -3
- data/lib/bbmb/version.rb +1 -1
- 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: a2d183b03706d8559019ff4dc090b85e23a9b2a8
|
4
|
+
data.tar.gz: 077a75bd3d642ece584a5e422b570ad6c296b466
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97c91fb51fbabebd497ea2504831c913103dc84c122962ebea6b4549c8cc33f6670ed98b2be15fb071355b19698e976190cea871801b58f589eed11ec74d0e85
|
7
|
+
data.tar.gz: 68a820b5779f418636da8384352c5b0a9dabe96512544568a71063bf1db99995e04078c84be6b5e0171c938aa51f2b032ebeffea35f2190c7cf83933bc006694
|
data/History.txt
CHANGED
data/lib/bbmb/model/order.rb
CHANGED
@@ -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"
|
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
|
data/lib/bbmb/util/server.rb
CHANGED
@@ -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
|
-
|
77
|
-
|
78
|
-
|
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
|
data/lib/bbmb/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: odba
|