smerp-quotation-engine 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/smerp/quotation/engine/quotation_item.rb +3 -8
- data/app/views/smerp/quotation/engine/quotation_products/_quotation_product.html.erb +1 -0
- data/app/views/smerp/quotation/engine/quotation_products/index.html.erb +5 -2
- 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: 9e61a0dda0cb4774c99cafc4a276be0eba4d1e854a5c6096eafe77c839643823
|
4
|
+
data.tar.gz: 598500f078db3e24a9140c4381c12da5ed6e20e653d3e6257fddeb654ca64d71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ae8b2cfb3cc8e9d04a5d642e939fb7f3378c924c71300bf8ca270cce35330dfef2b8caeb8424d96cbaac5350abb96b67d7ba9c5f8a4502902506d4abc66d18b
|
7
|
+
data.tar.gz: 5b2f2e6940e8dec5d3b9ec2a0fa0582c520a48fa48bad0467f5af7d5fced93b2c8418c40add6d40645d8b1c8df3653dab37ef7d80103850d8a4273edeed2a0b6
|
@@ -12,12 +12,9 @@ module Smerp::Quotation::Engine
|
|
12
12
|
|
13
13
|
validates_presence_of :name
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# This method shall be activated by parent's
|
19
|
-
# before_save hook
|
20
|
-
def update_total
|
15
|
+
before_validation :map_product_item
|
16
|
+
|
17
|
+
def map_product_item
|
21
18
|
|
22
19
|
if not self.quotation_product_id.nil?
|
23
20
|
prod = QuotationProduct.find(self.quotation_product_id)
|
@@ -26,8 +23,6 @@ module Smerp::Quotation::Engine
|
|
26
23
|
self.unit = prod.unit if is_empty?(self.unit)
|
27
24
|
end
|
28
25
|
|
29
|
-
# call parent update_total
|
30
|
-
super
|
31
26
|
end
|
32
27
|
|
33
28
|
end
|
@@ -5,13 +5,16 @@
|
|
5
5
|
<div id="quotation_products">
|
6
6
|
<table class="table">
|
7
7
|
<tr>
|
8
|
+
<th width="18px"></th>
|
8
9
|
<th>Name</th>
|
9
10
|
<th>Category</th>
|
10
11
|
<th>Status</th>
|
11
12
|
</tr>
|
12
|
-
|
13
|
+
|
14
|
+
<% cnt = 1 %>
|
13
15
|
<% @quotation_products.each do |quotation_product| %>
|
14
|
-
<%= render quotation_product %>
|
16
|
+
<%= render quotation_product, cnt: cnt %>
|
17
|
+
<% cnt += 1 %>
|
15
18
|
<% end %>
|
16
19
|
</table>
|
17
20
|
</div>
|