change total card query
This commit is contained in:
@@ -951,7 +951,7 @@ end
|
|||||||
# .joins("join sale_payments on sale_id = sales.sale_id")
|
# .joins("join sale_payments on sale_id = sales.sale_id")
|
||||||
# .group("sales.sale_id")
|
# .group("sales.sale_id")
|
||||||
|
|
||||||
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb"',today)
|
query = Sale.where('sales.sale_status = "completed" and DATE_FORMAT(sales.receipt_date,"%Y-%m-%d") = ? and (sp.payment_method = "mpu" or sp.payment_method = "visa" or sp.payment_method = "master" or sp.payment_method = "jcb")',today)
|
||||||
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
.joins("JOIN sale_payments sp ON sp.sale_id = sales.sale_id")
|
||||||
.sum("sp.payment_amount")
|
.sum("sp.payment_amount")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user