update customer validation messages

This commit is contained in:
Aung Myo
2017-07-28 18:08:11 +06:30
parent 98c04f21d8
commit 78d383f5ec
3 changed files with 15 additions and 8 deletions

View File

@@ -666,7 +666,13 @@ end
.joins("INNER JOIN shift_sales sh ON sh.id = sales.shift_sale_id")
.where("sales.sale_status = 'void' and (sh.shift_started_at between ? and ?
OR sh.shift_closed_at between ? and ? )", from ,to, from, to)
if shift.present?
query = query.where("sales.sale_status = 'void' and s.shift_sale_id in (?)",shift.to_a)
else
query = query.where("payment_method='creditnote' and s.sale_status = 'completed' and s.receipt_date between ? and ? ",from,to)
end
out = {:items => account}
sale_arr.push(out)
return sale_arr