change customer UI and header css

This commit is contained in:
phyusin
2018-09-13 11:58:57 +06:30
parent ffca0af445
commit 57adb09162
9 changed files with 995 additions and 542 deletions

View File

@@ -876,8 +876,10 @@ class SalePayment < ApplicationRecord
.joins("INNER JOIN customers c ON c.customer_id = s.customer_id")
.joins("INNER JOIN sale_orders so ON so.sale_id = s.sale_id")
.joins("INNER JOIN orders o ON o.order_id = so.order_id")
if params[:type] == "cashier"
if params[:type].nil?
query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}")
elsif params[:type] == "cashier"
query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' AND o.source='#{params[:type]}' OR o.source='emenu' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}")
else
query = query.where("(CASE WHEN (s.grand_total + s.amount_changed)=(select SUM(payment_amount) FROM sale_payments WHERE sale_id=s.sale_id AND payment_method!='creditnote') THEN NULL ELSE payment_method='creditnote' AND o.source='#{params[:type]}' END) and s.sale_status = 'completed' and s.payment_status='paid' #{receipt_no} #{customer}")