smerp-quotation-engine 0.2.1 → 0.2.3

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: 2c5fb38d83a4caac8b3251dc2aebcecf5aea0d255dea1719df5ed2fccf0a846a
4
- data.tar.gz: ebbf3ffbe92b9ef197ebf223c36e04a5c78d7132ae793c8b9884b837199f8b02
3
+ metadata.gz: e68a4952af18e9ffec00956f56cb0beaf544c8ed4783a1d2400eb69a9220e5f1
4
+ data.tar.gz: 2a1118364f1bf7805682a2a3c3bb7bb7b19d73991fe2c0947a64e1fdadc35e4a
5
5
  SHA512:
6
- metadata.gz: 89ee2cd9161ff3123e06a71e16131cc05f6413e8491458557a7f2d3c6144159514b4228736dd2ffd0dd35fe61ae5909a0b94a18b330811bbb4928de99051d384
7
- data.tar.gz: 2c93dbb0d79aeda5773c25847eb5637d93beb41b0642331fc4cd00d5cdefbe66ff3436f843666d48e95a7b8985cedd7bd40cc6aeb8d39b6fe31ba53b9b9ebce8
6
+ metadata.gz: 1430c6d5fabc1c1dd0bcd229c50e1242161725b0cbf758a89116b8076097356eb7e1520d4258d5e147b87ce6a7415e1eb39e100443675081fdc7119aec08b48a
7
+ data.tar.gz: b4a38634a219d77c1e6240fc9cafd6d6265905e0de2237648f36e0b65982623d156ca22ee785654c526fb7b08d90c45468974a89bb9dbb9886b1406a617db884
@@ -18,10 +18,17 @@
18
18
  <% end %>
19
19
 
20
20
  <table class="table">
21
- <% if not @parent.nil? %>
22
- <tr style="background-color: #8EFEC1">
23
- <th>Parent Item : </th>
24
- <td colspan="6"><%= @parent.name %></td>
21
+ <% if quotation_item.new_record? %>
22
+ <% if not @parent.nil? %>
23
+ <tr style="background-color: #8EFEC1">
24
+ <th>Parent Item : </th>
25
+ <td colspan="4"><%= @parent.name %></td>
26
+ </tr>
27
+ <% end %>
28
+ <% else %>
29
+ <tr>
30
+ <th>Parent : </th>
31
+ <td colspan="4"><%= form.select :parent_id, quotation_item.quotation.quotation_items.where(["id != ?", quotation_item.id]).order(:name).collect { |e| [e.name, e.id] }.unshift([" - ", nil]), {}, class: "form-control" %></td>
25
32
  </tr>
26
33
  <% end %>
27
34
 
@@ -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.1"
4
+ VERSION = "0.2.3"
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.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian