smerp-quotation-engine 0.4.7 → 0.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05b80e61795dce1c13c534da8e1fed5bcd593945fd3aa32eeaac20b3e8d7ddb2
|
4
|
+
data.tar.gz: 466a2bccf412552224e76d0e9a8720895c0bead48e0eb1b3bfc496072a4ed4e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5c2cfe7241b6c628d0a9c654265689df89cbeb4faae4d0b9eadc2836605429d8ff974d35eb045639cbe41fb8b69cd3f1312df0244d8662d630b3f53965fc97
|
7
|
+
data.tar.gz: 326e364f37a98cf8abb433a8bfc90680fba26e292ed73e1925dad9fa82cad1a34a846de1bde4c4adae31c1209f05c6035a7e17ff280e9c1abcb19367c195ff9b
|
@@ -3,6 +3,8 @@ require 'smerp/quotation'
|
|
3
3
|
|
4
4
|
require 'smerp/exporter/excel'
|
5
5
|
|
6
|
+
require 'axlsx'
|
7
|
+
|
6
8
|
module Smerp::Quotation::Engine
|
7
9
|
class QuotationsController < ApplicationController
|
8
10
|
before_action :set_quotation, only: %i[ show edit update destroy extended_calculators new_extended_calculator create_calculator edit_extended_calculator update_extended_calculator delete_extended_calculator new_product_item resources_allocation_summary filter download_excel ]
|
@@ -232,7 +234,7 @@ module Smerp::Quotation::Engine
|
|
232
234
|
|
233
235
|
next if not i.quotation_product.nil? and i.quotation_product.quotation_product_category_id == 1
|
234
236
|
|
235
|
-
patch = "
|
237
|
+
patch = " " * level
|
236
238
|
name = [""]
|
237
239
|
name << patch
|
238
240
|
name << "#{helpers.level_seq_conv(level, seq)}. "
|
@@ -266,7 +268,7 @@ module Smerp::Quotation::Engine
|
|
266
268
|
output = "#{@quotation.id}.xlsx"
|
267
269
|
exp.save_to(output)
|
268
270
|
|
269
|
-
send_data(File.read(File.join(Rails.root, output)), type: 'application/octet-stream', disposition: "attachment")
|
271
|
+
send_data(File.read(File.join(Rails.root, output)), type: 'application/octet-stream', disposition: "attachment", filename: output)
|
270
272
|
|
271
273
|
end
|
272
274
|
|
@@ -276,16 +278,21 @@ module Smerp::Quotation::Engine
|
|
276
278
|
|
277
279
|
next if not c.quotation_product.nil? and c.quotation_product.quotation_product_category_id == 1
|
278
280
|
|
279
|
-
patch = "
|
281
|
+
patch = " " * level
|
280
282
|
name = [""]
|
281
283
|
name << patch
|
282
284
|
name << "#{helpers.level_seq_conv(level, seq)}. "
|
283
285
|
name << c.name
|
286
|
+
|
287
|
+
txtName = Axlsx::RichText.new
|
288
|
+
txtName.add_run(name.join)
|
284
289
|
|
285
290
|
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]
|
291
|
+
#sheet.insert_row [name.join, c.quantity, c.unit, c.unit_price, c.line_total]
|
292
|
+
sheet.insert_row [txtName, c.quantity, c.unit, c.unit_price, c.line_total]
|
287
293
|
else
|
288
|
-
sheet.insert_row [name.join,"","","",""]
|
294
|
+
#sheet.insert_row [name.join,"","","",""]
|
295
|
+
sheet.insert_row [txtName,"","","",""]
|
289
296
|
end
|
290
297
|
|
291
298
|
#sheet.insert_row [name.join, c.quantity, c.unit, c.unit_price, c.line_total]
|
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.
|
4
|
+
version: 0.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 0.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: axlsx
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.1.0.pre
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.1.0.pre
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: devops_assist
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|