From 834df19e037ed0cfbc8c152fdd1d12082d083342 Mon Sep 17 00:00:00 2001 From: Thein Lin Kyaw Date: Fri, 8 Nov 2019 09:58:52 +0630 Subject: [PATCH] use precision for rounding adj in receipt report. bug fixes for discount. --- app/views/origami/discounts/index.html.erb | 200 ++++++++++---------- app/views/reports/receipt_no/index.html.erb | 25 +-- 2 files changed, 116 insertions(+), 109 deletions(-) diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index 86cf26c7..abeeb442 100755 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -44,24 +44,22 @@
-
- - - - - - +
+ +
ItemsQTY
+ + + + - - + + <% sub_total = 0 %> <% @sale_data.sale_items.each do |sale_item| %> - <% - sub_total += sale_item.qty*sale_item.unit_price - if sale_item.price != 0 && sale_item.status != "void" && sale_item.status != "foc" - %> - > + <% sub_total += sale_item.qty * sale_item.unit_price %> + <% if sale_item.price > 0 && sale_item.status.blank? %> + > - <% - end - end - %> - -
ItemsQTY Price
@@ -74,14 +72,26 @@ <%=(sale_item.qty*sale_item.unit_price)%>
-
-
+ <% elsif sale_item.price < 0 && sale_item.status == "Discount" %> + > + + + + <%=sale_item.product_name%>@<%=sale_item.unit_price%> + + + <%=sale_item.qty.abs%> + + + <%=(sale_item.qty*sale_item.unit_price)%> + + + <% end %> + <% end %> + + + +