From 61142b7244de3a3c889bbdd432354311f3efe139 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 25 Jan 2018 17:34:13 +0630 Subject: [PATCH] add void in sale item again --- app/models/sale.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/sale.rb b/app/models/sale.rb index 58dbfa50..aa28344e 100755 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -740,7 +740,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status) SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") - .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_status!='void' and sale_payments.payment_amount != 0 ", shift.to_a) + .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_payments.payment_amount != 0 ", shift.to_a) sale_cash.each do |s_c| total_cash_amount += s_c.cash_amount.to_f total_card_amount += s_c.card_amount.to_f @@ -760,7 +760,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status) SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") - .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_status!='void' and sale_payments.payment_amount != 0 ", shift_sale_range.to_a) + .where("sales.shift_sale_id in (?) and sale_status = 'completed' and sale_payments.payment_amount != 0 ", shift_sale_range.to_a) sale_cash.each do |s_c| total_cash_amount += s_c.cash_amount.to_f total_card_amount += s_c.card_amount.to_f @@ -780,7 +780,7 @@ def self.get_by_shift_items(shift_sale_range, shift, from, to, status) SUM(case when (sale_payments.payment_method='creditnote') then (sale_payments.payment_amount) else 0 end) as credit_amount, SUM(case when (sale_payments.payment_method='foc') then (sale_payments.payment_amount) else 0 end) as foc_amount") .joins("join sale_payments on sale_payments.sale_id = sales.sale_id") - .where("sales.receipt_date between ? and ? and sale_status = 'completed' and sale_status!='void' and sale_payments.payment_amount != 0 ", from,to) + .where("sales.receipt_date between ? and ? and sale_status = 'completed' and sale_payments.payment_amount != 0 ", from,to) sale_cash.each do |s_c| total_cash_amount += s_c.cash_amount.to_f total_card_amount += s_c.card_amount.to_f