delete shop scope in model

This commit is contained in:
Zin Moe
2020-01-13 18:41:37 +06:30
parent a3edbb07fd
commit 270c2a821e
20 changed files with 25 additions and 29 deletions

View File

@@ -791,7 +791,7 @@ def self.daily_sales_list(from,to)
SUM(case when (sale_payments.payment_method='giftvoucher') then sale_payments.payment_amount else 0 end) as giftvoucher_amount,
SUM(case when (sale_payments.payment_method='foc') then sale_payments.payment_amount else 0 end) as foc_amount")
.along_with_sale_payments_except_void_between(from, to)
.where("(sale_status = ? OR sale_status = ?) AND sales.receipt_date between ? AND ? ", 'completed', 'void', from, to).shop
.where("(sale_status = ? OR sale_status = ?) AND sales.receipt_date between ? AND ? ", 'completed', 'void', from, to)
.group("sale_id").to_sql
daily_total = connection.select_all("SELECT