smerp-quotation-engine 0.2.0 → 0.2.2

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: '078b0b00dc1fa24d1c265ed3e8376f747db91b6664358915686ea7eaea2e4404'
4
- data.tar.gz: cdc5d36de1c87ce2a2a916b0573e4d34b1966110d224a6b40352a8906e54f351
3
+ metadata.gz: f71b4dd4f66d6b3a84d08becf612915e07c73d559b9b45b1739474e78670d48e
4
+ data.tar.gz: 808298fcebe1eea7dc2cc7820b34ce7ee68db717a76f3b948c1430def58cfe20
5
5
  SHA512:
6
- metadata.gz: 2e5d50a0b5d0b0c0d819cd86b6bc42077260394cb84e8dbb9a8c43cd0088f68a34b41d8c27611da9ef5dd9f699b54149a887b2b3131b7a6a314db19e1f0223cf
7
- data.tar.gz: 6b3f0dba38911e1d852e3dc40b388e92438c247931be0eeff4f532d6d8a4dc9c36f3cf899d33cde71190827e00ea8ec950f7a59b4ce6ca6150cdca39da5ce2fd
6
+ metadata.gz: 8d43e99812253d2be32facd3e28a76b299074258db6574a54ff83cad2b772491854d88f3dc57579409834140adc7ddbc84dc00d92e986d5dd5ba43a0eb8aaae7
7
+ data.tar.gz: 2cc26d8e261f27eb6f09fd8ddd30367df751b4395f038c1653fe61bb6b72e506d4c18da81d25a5ac73cecf4ad2259cb5b38d63cbeff11189e874f9c4f53c1fab
@@ -66,7 +66,7 @@ module Smerp::Quotation::Engine
66
66
 
67
67
  # DELETE /quotation_items/1
68
68
  def destroy
69
- q = @quotation_item.quotation.clone
69
+ q = @quotation_item.quotation
70
70
  @quotation_item.destroy
71
71
 
72
72
  redirect_to quotation_url(q), notice: "Quotation item was successfully destroyed."
@@ -25,7 +25,8 @@ module Smerp::Quotation::Engine
25
25
  @quotation_product = QuotationProduct.new(quotation_product_params)
26
26
 
27
27
  if @quotation_product.save
28
- redirect_to @quotation_product, notice: "Quotation product was successfully created."
28
+ #redirect_to @quotation_product, notice: "Quotation product was successfully created."
29
+ redirect_to quotation_products_path, notice: "Quotation product was successfully created."
29
30
  else
30
31
  render :new, status: :unprocessable_entity
31
32
  end
@@ -1,6 +1,7 @@
1
1
  <div id="<%= dom_id quotation_product %>">
2
2
 
3
3
  <tr>
4
+ <td><%= cnt %>.</td>
4
5
  <td><%= link_to quotation_product.name, quotation_product %></td>
5
6
  <td><%= quotation_product.quotation_product_category.name %></td>
6
7
  <td><%= quotation_product.state.titleize %></td>
@@ -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>
@@ -35,12 +35,15 @@
35
35
  <% end %>
36
36
  </div>
37
37
  </td>
38
+
39
+ <% consolDest = quotation_item.is_consolidation_destination_item? %>
40
+ <% consolSrc = quotation_item.is_consolidation_source_item? %>
38
41
 
39
42
  <td class="text-end">
40
43
 
41
- <% if quotation_item.is_consolidation_destination_item? %>
44
+ <% if consolDest %>
42
45
  <%= currency(quotation_item.consolidated_line_total) %>
43
- <% elsif quotation_item.is_consolidation_source_item? %>
46
+ <% elsif consolSrc %>
44
47
  <%= currency(quotation_item.balance_after_distribution[:balance_amount]) %> *
45
48
  <% else %>
46
49
  <%= currency(quotation_item.line_total) %>
@@ -68,26 +71,26 @@
68
71
  </td>
69
72
 
70
73
  <td class="text-end">
71
- <% if not quotation_item.is_consolidation_source_item? %>
74
+ <% if not consolSrc %>
72
75
  <%= link_to currency(quotation_item.discount), "#dist#{quotation_item.id}", "data-bs-toggle" => "collapse", "aria-expanded" => "false", "aria-controls" => "dist#{quotation_item.id}", role: "button" %>
73
76
  <% end %>
74
77
  </td>
75
78
 
76
79
  <td>
77
- <% if not quotation_item.is_consolidation_source_item? %>
80
+ <% if not consolSrc %>
78
81
  (<%= quotation_item.discount.percent_of(quotation_item.line_total,2) %>%)
79
82
  <% end %>
80
83
  </td>
81
84
 
82
85
  <td class="text-end">
83
- <% if not quotation_item.is_consolidation_source_item? %>
86
+ <% if not consolSrc %>
84
87
  <%= currency(quotation_item.line_total_after_discount) %>
85
88
  <% end %>
86
89
  </td>
87
90
 
88
91
  <td class="text-end">
89
92
 
90
- <% if not quotation_item.is_consolidation_source_item? %>
93
+ <% if not consolSrc %>
91
94
  <%= link_to currency(quotation_item.tax), "#tax#{quotation_item.id}", "data-bs-toggle" => "collapse", "aria-expanded" => "false", "aria-controls" => "tax#{quotation_item.id}", role: "button" %>
92
95
  <div class="collapse" id="tax<%= quotation_item.id %>">
93
96
  <%= form_for(:quotation_item, url: apply_tax_quotation_item_path(quotation_item), method: :post) do |f| %>
@@ -111,13 +114,13 @@
111
114
  </td>
112
115
 
113
116
  <td>
114
- <% if not quotation_item.is_consolidation_source_item? %>
117
+ <% if not consolSrc %>
115
118
  <%= link_to image_tag('taxfree.png', size: "22x22"), remove_tax_quotation_item_path(quotation_item), data: { turbo_method: "post" } %>
116
119
  <% end %>
117
120
  </td>
118
121
 
119
122
  <td class="text-end">
120
- <% if not quotation_item.is_consolidation_source_item? %>
123
+ <% if not consolSrc %>
121
124
  <%= currency(quotation_item.line_total_with_tax) %>
122
125
  <% end %>
123
126
  </td>
@@ -129,7 +132,7 @@
129
132
  </tr>
130
133
 
131
134
 
132
- <% if quotation_item.is_consolidation_destination_item? %>
135
+ <% if consolDest %>
133
136
 
134
137
  <tr style="background-color: <%= level_marker(level) %>">
135
138
  <td class="text-end" style="font-style: italic"><%= quotation_item.name %> (Existing Value)</td>
@@ -1,7 +1,7 @@
1
1
  module Smerp
2
2
  module Quotation
3
3
  module Engine
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smerp-quotation-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-03 00:00:00.000000000 Z
11
+ date: 2022-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails