smerp-quotation-engine 0.4.6 → 0.4.7

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
  SHA256:
3
- metadata.gz: 293054db3d6713f61e254c15a54ec202288e03643f86b7818393d8addf60d03a
4
- data.tar.gz: 876e16fef179ffe760eb9ae63cf6009470dfd73220a0fa1fd7c5a7e46928fd8d
3
+ metadata.gz: 80dfd42e0ad764fdea3a674d7a943e5167a8de3069ecab8e9d393bdefde54263
4
+ data.tar.gz: 754807fcf94349de3274f308bc9103d025650675f422ec0170644c2987ed5292
5
5
  SHA512:
6
- metadata.gz: e3e7f583435ca89f9725967990e89e63601561060d346c665b92820c0d290a681c3e255ff7c6e398dfe61d50f3b0a3c0a5a2440080984a58e74fc5e78e214884
7
- data.tar.gz: 40a5d757d215c41cdf211be0d2695cfc9231dbb41ac47a36ee2c2dcef28fa6748d440fa56af888910f74367442e4f2d3f6cb9fdcf97de2da8890af087b2ab4ca
6
+ metadata.gz: 77624ae54dce3df21f39221c297e39d5d55de45e5bc50c312015c602168d25c7cfe5fd8090acb56b935f756ea7ff5a790f5210c94070139bfe7affa1b58cf0e3
7
+ data.tar.gz: 3498b282903c2d4025c80bdd7fca00ac86759531c220d08357cbd3380d5bbf35adb6978c4c572a4003ffcb15c754c1d2fa8e25376a19286e8c5aef20272bb69a
@@ -230,7 +230,7 @@ module Smerp::Quotation::Engine
230
230
  level = 0
231
231
  @quotation.quotation_items.where(["parent_id is null"]).order(:position).each do |i|
232
232
 
233
- next if not i.quotation_product_id.nil? and i.quotation_product.quotation_product_category_id == 1
233
+ next if not i.quotation_product.nil? and i.quotation_product.quotation_product_category_id == 1
234
234
 
235
235
  patch = " " * level
236
236
  name = [""]
@@ -238,7 +238,11 @@ module Smerp::Quotation::Engine
238
238
  name << "#{helpers.level_seq_conv(level, seq)}. "
239
239
  name << i.name
240
240
 
241
- s.insert_row [name.join, i.quantity, i.unit, i.unit_price, i.line_total]
241
+ if i.children.length > 0 and not i.children[0].quotation_product.nil? and i.children[0].quotation_product.quotation_product_category_id == 1
242
+ s.insert_row [name.join, i.quantity, i.unit, i.unit_price, i.line_total]
243
+ else
244
+ s.insert_row [name.join, "","","",""]
245
+ end
242
246
  s.col_style(4, currencyStyle)
243
247
  s.col_style(5, currencyStyle)
244
248
 
@@ -270,19 +274,21 @@ module Smerp::Quotation::Engine
270
274
  seq = 1
271
275
  item.children.each do |c|
272
276
 
273
- p c.inspect
274
- p c.quotation_product_id
275
- p c.quotation_product.inspect
276
-
277
- next if not c.quotation_product_id.nil? and c.quotation_product.quotation_product_category_id == 1
277
+ next if not c.quotation_product.nil? and c.quotation_product.quotation_product_category_id == 1
278
278
 
279
279
  patch = " " * level
280
280
  name = [""]
281
281
  name << patch
282
282
  name << "#{helpers.level_seq_conv(level, seq)}. "
283
283
  name << c.name
284
+
285
+ if c.children.length > 0 and not c.children[0].quotation_product.nil? and c.children[0].quotation_product.quotation_product_category_id == 1
286
+ sheet.insert_row [name.join, c.quantity, c.unit, c.unit_price, c.line_total]
287
+ else
288
+ sheet.insert_row [name.join,"","","",""]
289
+ end
284
290
 
285
- sheet.insert_row [name.join, c.quantity, c.unit, c.unit_price, c.line_total]
291
+ #sheet.insert_row [name.join, c.quantity, c.unit, c.unit_price, c.line_total]
286
292
  recurse_items(c, sheet, level+1) if c.children.length > 0
287
293
  seq += 1
288
294
  end
@@ -1,7 +1,7 @@
1
1
  module Smerp
2
2
  module Quotation
3
3
  module Engine
4
- VERSION = "0.4.6"
4
+ VERSION = "0.4.7"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smerp-quotation-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian