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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80dfd42e0ad764fdea3a674d7a943e5167a8de3069ecab8e9d393bdefde54263
|
4
|
+
data.tar.gz: 754807fcf94349de3274f308bc9103d025650675f422ec0170644c2987ed5292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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
|
-
|
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
|