update filter order

This commit is contained in:
Aung Myo
2017-08-09 11:54:19 +06:30
parent 644b94764e
commit 729daeba7b
6 changed files with 154 additions and 22 deletions

View File

@@ -414,7 +414,7 @@ class Sale < ApplicationRecord
.where("DATE_FORMAT(receipt_date,'%d-%m-%Y') >= ?" + " AND DATE_FORMAT(receipt_date,'%d-%m-%Y') <= ? and sp.payment_method = 'creditnote' #{keyword} #{custo}", from,to)
else
sale = Sale.all.joins("JOIN sale_payments sp on sp.sale_id = sales.sale_id")
.where("sp.payment_method =? #{keyword} #{custo}",'creditnote')
.where("sp.payment_method ='creditnote' #{keyword} #{custo}")
end