bbmb 2.2.2 → 2.2.3

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: 41dc6c1f01a081082be4b1fd376e41b1faa8be13
4
- data.tar.gz: f5398f218f446f20d18795888f830b0569db1460
3
+ metadata.gz: 539253d09b62765c28bc81f550e1831fd5d6fade
4
+ data.tar.gz: 54e3f3a803f0b54ec32c1fd2bc111f2f07ed5e63
5
5
  SHA512:
6
- metadata.gz: c86e7a2e7dc6918767f3d8c2d7954b38b5e38b24a4d44efd9ed8cb5d894beb808d00cb922a3fca18e7c79b8ff7c0527e322a62a20b031eaf151a944caea7c709
7
- data.tar.gz: 8386ea2ab6179c50f185d6ff9f6220af27edfa559de024bb9bca8c862d90106c9fcd257a090d7765333ed55284ba9c4c5e9d8a108c1170b58b2552cc45079ba9
6
+ metadata.gz: 5b56bf4ea3c9fc2f19eca1eeea3db51ca2faee383fe63f79fc0940c0e7531c8b090d7b7368be64d14b177fd3363c9868d9e3a6e4383b5700117de2374d5b6f6a
7
+ data.tar.gz: 2bc9a62ea60ec95ee4141921c4aeb75fae09fd12a275e453404471eac7b0a6d4a205ad2b2d49e42677cf3b4bbc892dd4c214614a8429bdf32ce2ee9911367147
@@ -1,4 +1,11 @@
1
- === 2.2.1 / upcoming
1
+ === 2.2.3 / 22.05.2017
2
+
3
+ * Delete in Schnellbestellung all positions with an invalid product
4
+ * Fixed nil access when displaying an order with invalid positions
5
+ * Fixed login problem because of invalid current_order
6
+ * Updated to sbsm 1.4.1 to be able to use the async method
7
+
8
+ === 2.2.2 / 17.05.2017
2
9
 
3
10
  * Remove bin/bbmbd. It is replaced by config.ru to start the rack process
4
11
  * Made bin/bbmb_admin work again
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.add_dependency "ydbd-pg", '>= 0.5.2'
22
22
  spec.add_dependency "ydbi", '>= 0.5.3'
23
23
  spec.add_dependency "json"
24
- spec.add_dependency "sbsm", '>= 1.4.0'
24
+ spec.add_dependency "sbsm", '>= 1.4.1'
25
25
  spec.add_dependency "htmlgrid"
26
26
  spec.add_dependency "ydim", '>= 0.5.1'
27
27
  spec.add_dependency "syck"
@@ -12,6 +12,8 @@ class Favorites < Global
12
12
  VIEW = View::Favorites
13
13
  def init
14
14
  @model = _customer.favorites
15
+ @model.positions.delete_if { |position| position.product.nil? }
16
+ @model
15
17
  end
16
18
  end
17
19
  end
@@ -87,6 +87,7 @@ class Order
87
87
  info
88
88
  end
89
89
  def calculate_effective_prices
90
+ delete_invalid_positions
90
91
  @positions.each { |pos|
91
92
  pos.price_effective = price_effective(pos)
92
93
  }
@@ -121,6 +122,7 @@ class Order
121
122
  add(quantity, product)
122
123
  end
123
124
  def item_count
125
+ delete_invalid_positions
124
126
  @positions.inject(0) { |memo, pos| memo + pos.quantity }
125
127
  end
126
128
  def i2_body
@@ -204,15 +206,7 @@ class Order
204
206
  twin
205
207
  end
206
208
  def total
207
- @positions.delete_if do |pos|
208
- begin
209
- pos.total
210
- false
211
- rescue => error
212
- SBSM.info "Deleting an invalid position from order #{order_id}"
213
- true
214
- end
215
- end
209
+ delete_invalid_positions
216
210
  @positions.inject(@shipping) { |memo, pos| pos.total + memo }
217
211
  end
218
212
  def total_incl_vat
@@ -259,6 +253,17 @@ class Order
259
253
  def _formatted_comment(replacement=';')
260
254
  @comment.to_s.gsub(/[\r\n]+/, replacement)[0,60] if @comment
261
255
  end
256
+ def delete_invalid_positions
257
+ @positions.delete_if do |pos|
258
+ begin
259
+ pos.total
260
+ false
261
+ rescue => error
262
+ SBSM.info "Deleting an invalid position from order #{order_id}"
263
+ true
264
+ end
265
+ end
266
+ end
262
267
  end
263
268
  end
264
269
  end
@@ -18,6 +18,10 @@ module BBMB
18
18
  __old_current_order__
19
19
  odba_store
20
20
  end
21
+ if @current_order.is_a?(NilClass)
22
+ @current_order = BBMB::Model::Order.new(self)
23
+ odba_store
24
+ end
21
25
  @current_order
22
26
  end
23
27
  alias :__old_commit_order__ :commit_order!
@@ -1,3 +1,3 @@
1
1
  module BBMB
2
- VERSION = '2.2.2'
2
+ VERSION = '2.2.3'
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.2
4
+ version: 2.2.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-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: odba
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.4.0
75
+ version: 1.4.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.4.0
82
+ version: 1.4.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: htmlgrid
85
85
  requirement: !ruby/object:Gem::Requirement