smerp-quotation-engine 0.4.5 → 0.4.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/smerp/quotation/engine/quotations_controller.rb +13 -2
- data/app/models/smerp/quotation/engine/quotation.rb +1 -1
- data/app/models/smerp/quotation/engine/quotation_item.rb +3 -1
- data/app/models/smerp/quotation/engine/quotation_product.rb +1 -1
- data/lib/smerp/quotation/engine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 293054db3d6713f61e254c15a54ec202288e03643f86b7818393d8addf60d03a
|
4
|
+
data.tar.gz: 876e16fef179ffe760eb9ae63cf6009470dfd73220a0fa1fd7c5a7e46928fd8d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3e7f583435ca89f9725967990e89e63601561060d346c665b92820c0d290a681c3e255ff7c6e398dfe61d50f3b0a3c0a5a2440080984a58e74fc5e78e214884
|
7
|
+
data.tar.gz: 40a5d757d215c41cdf211be0d2695cfc9231dbb41ac47a36ee2c2dcef28fa6748d440fa56af888910f74367442e4f2d3f6cb9fdcf97de2da8890af087b2ab4ca
|
@@ -206,7 +206,8 @@ module Smerp::Quotation::Engine
|
|
206
206
|
end
|
207
207
|
|
208
208
|
def download_excel
|
209
|
-
|
209
|
+
|
210
|
+
p @quotation
|
210
211
|
exp = Smerp::Exporter::Excel::Exporter.instance
|
211
212
|
exp.start_cell(8,0)
|
212
213
|
|
@@ -228,6 +229,9 @@ module Smerp::Quotation::Engine
|
|
228
229
|
seq = 1
|
229
230
|
level = 0
|
230
231
|
@quotation.quotation_items.where(["parent_id is null"]).order(:position).each do |i|
|
232
|
+
|
233
|
+
next if not i.quotation_product_id.nil? and i.quotation_product.quotation_product_category_id == 1
|
234
|
+
|
231
235
|
patch = " " * level
|
232
236
|
name = [""]
|
233
237
|
name << patch
|
@@ -265,6 +269,13 @@ module Smerp::Quotation::Engine
|
|
265
269
|
def recurse_items(item, sheet, level)
|
266
270
|
seq = 1
|
267
271
|
item.children.each do |c|
|
272
|
+
|
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
|
278
|
+
|
268
279
|
patch = " " * level
|
269
280
|
name = [""]
|
270
281
|
name << patch
|
@@ -280,7 +291,7 @@ module Smerp::Quotation::Engine
|
|
280
291
|
private
|
281
292
|
# Use callbacks to share common setup or constraints between actions.
|
282
293
|
def set_quotation
|
283
|
-
@quotation = Quotation.find(params[:id])
|
294
|
+
@quotation = Smerp::Quotation::Engine::Quotation.find(params[:id])
|
284
295
|
end
|
285
296
|
|
286
297
|
# Only allow a list of trusted parameters through.
|
@@ -8,6 +8,8 @@ module Smerp::Quotation::Engine
|
|
8
8
|
|
9
9
|
acts_as_list
|
10
10
|
|
11
|
+
acts_as_tree
|
12
|
+
|
11
13
|
attr_accessor :sel_qi, :quantum
|
12
14
|
|
13
15
|
belongs_to :quotation_product, optional: true
|
@@ -16,7 +18,7 @@ module Smerp::Quotation::Engine
|
|
16
18
|
|
17
19
|
before_validation :map_product_item
|
18
20
|
|
19
|
-
belongs_to :quotation
|
21
|
+
belongs_to :quotation, class_name: "Smerp::Quotation::Engine::Quotation"
|
20
22
|
|
21
23
|
def map_product_item
|
22
24
|
|
@@ -21,7 +21,7 @@ module Smerp::Quotation::Engine
|
|
21
21
|
|
22
22
|
belongs_to :quotation_product_category
|
23
23
|
|
24
|
-
has_many :quotation_items
|
24
|
+
has_many :quotation_items, class_name: "Smerp::Quotation::Engine::QuotationItem"
|
25
25
|
|
26
26
|
def QuotationProduct.active_products(cat = nil)
|
27
27
|
if cat.nil?
|