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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe098615d1e76739d450befbe4674338e82ed8af23e12d978b65d0366b343c08
4
- data.tar.gz: 16b4fe60c3dac241446f83947d31cd6628f3b2025b17c646fc88699de32c6287
3
+ metadata.gz: 293054db3d6713f61e254c15a54ec202288e03643f86b7818393d8addf60d03a
4
+ data.tar.gz: 876e16fef179ffe760eb9ae63cf6009470dfd73220a0fa1fd7c5a7e46928fd8d
5
5
  SHA512:
6
- metadata.gz: 3e903694f6e4edb0f0bf7920926fa7d927ea71a3cad4ae5132836d0050e8e958d64200abadba146c9012e6aae2c2288ac5f3afb71c83dd4ff8e8cbb92083ada1
7
- data.tar.gz: e56d521bfa05b37f3e3da10a0d060f3d86c4cc254b77255e6be20932e1fa9c4756961ace7cb427ecba3e646b8e4e7540d05a8b55ab792b9adb81b632e87ce357
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.
@@ -7,7 +7,7 @@ module Smerp::Quotation::Engine
7
7
 
8
8
  validates_presence_of :name
9
9
 
10
- has_many :quotation_items
10
+ has_many :quotation_items, class_name: "Smerp::Quotation::Engine::QuotationItem"
11
11
 
12
12
  def quotation_items_allocated_resources
13
13
 
@@ -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?
@@ -1,7 +1,7 @@
1
1
  module Smerp
2
2
  module Quotation
3
3
  module Engine
4
- VERSION = "0.4.5"
4
+ VERSION = "0.4.6"
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.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian