From a058eff2ec8f19f652fa0eb39943b7f8437e7f47 Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Tue, 24 Jul 2018 13:59:59 +0630 Subject: [PATCH 1/3] Edit sale item report --- app/models/sale.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index d66fbeca..a63d4cd9 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -880,7 +880,7 @@ end def self.get_item_query(type) if type == "revenue" || type.nil? - sale_type = "i.status IS NULL and i.qty >0 " + sale_type = "i.qty != 0 " elsif type == "all" sale_type = "" elsif type == "discount" From 2bdbade48b5a36d309ac39f60608a522bf9a56a4 Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 24 Jul 2018 14:12:11 +0630 Subject: [PATCH 2/3] sale item query --- app/models/sale.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 699a2a19..c2a6e6bc 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -878,10 +878,9 @@ def self.get_by_shift_sale_by_item(from,to,status) end def self.get_item_query(type) - - if type == "revenue" || type.nil? - sale_type = "i.qty != 0 " - elsif type == "all" + if type == "revenue" + sale_type = "i.qty > 0 and status IS NULL" + elsif type == "all" || type.nil? sale_type = "" elsif type == "discount" sale_type = "i.status = 'Discount'" From 28b87430c0e834daf906a349dacee39df9f7ef02 Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 24 Jul 2018 15:48:52 +0630 Subject: [PATCH 3/3] check waste and spiol btn show hide --- app/views/origami/payments/show.html.erb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index fec0adda..6cb85113 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -401,26 +401,34 @@ <% if current_login_employee.role == "cashier" %> - <% if @other_payment <= 0 && @sale_payment.nil? %> + <% if @other_payment < 0 && @sale_payment.nil? %> <%if @sale_data.total_discount == 0 %> FOC <% end %> <%end %> <% if @sale_payment.nil? %> Void - Waste - Spoile + <% if @other_payment < 0 %> + <%if @sale_data.total_discount == 0 %> + Waste + Spoile + <% end %> + <% end %> <% end %> <% else %> - <% if @other_payment <= 0 && @sale_payment.nil?%> + <% if @other_payment < 0 && @sale_payment.nil?%> <%if @sale_data.total_discount == 0 %> - + <% if @other_payment < 0 %> + <%if @sale_data.total_discount == 0 %> + + + <% end %> + <% end %> <% end %> <% end %>