discuont updated for show

This commit is contained in:
Yan
2017-06-22 11:31:05 +06:30
parent bded56a696
commit b13b0afa6c
2 changed files with 11 additions and 10 deletions

View File

@@ -143,7 +143,10 @@
sub_total = sub_total + sale_item.price
%>
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
<% unless sale_item.price <= 0 %>
<%
# Can't check for discount
unless sale_item.price == 0
%>
<tr>
<td><%= count %></td>
<td class='item-name'><%= sale_item.product_name %></td>
@@ -151,7 +154,7 @@
<td class='item-attr'><%= sale_item.price %></td>
</tr>
<%
end
end
end
end
@@ -164,7 +167,7 @@
count += 1
sub_total = sub_total + order_item.price
unless order_item.price <= 0 %>
unless order_item.price == 0 %>
<tr>
<td><%= count %></td>
<td class='item-name'><%= order_item.item_name %></td>
@@ -188,7 +191,7 @@
</tr>
<tr>
<td class="charges-name"><strong>Discount:</strong></td>
<td class="item-attr"><strong id="order-discount">(<%= @obj_order.total_discount rescue 0%>)</strong></td>
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
</tr>
<% if @status_sale == "sale" %>
<tr>