customer name filter

This commit is contained in:
Thein Lin Kyaw
2020-07-19 19:31:14 +06:30
parent 3f97f30c36
commit ced6a09095
12 changed files with 224 additions and 141 deletions

View File

@@ -1,16 +1,17 @@
class Reports::CreditPaymentController < BaseReportController
class Reports::CreditPaymentController < BaseReportController
authorize_resource :class => false
def index
@filter_for_credit = [['All',''],['Paid','paid'],['Unpaid','unpaid']]
@sources = [["All",''], ["Cashier","cashier"],["Quick Service","quick_service"],["Online Order","doemal_order"]]
from, to = get_date_range_from_params
customer_filter = params[:customer]
@shift_sale_range = Sale.get_by_shift_sale_by_item(from,to,Sale::SALE_STATUS_COMPLETED)
@shift = ''
if params[:shift_name].to_i != 0
shift_sale = ShiftSale.find(params[:shift_name])
if to.blank?
if to.blank?
@shift = ShiftSale.where('shift_started_at = ? and shift_closed_at is NULL ',shift_sale.shift_started_at)
else
@@ -20,8 +21,8 @@ authorize_resource :class => false
@filter = params[:filter_check]
@order_source = params[:order_source]
@sale_data = Sale.get_by_shift_sale_credit_payment(@shift_sale_range,@shift,from,to,@filter,@order_source)
@sale_data = Sale.get_by_shift_sale_credit_payment(@shift_sale_range,@shift,from,to,@filter,customer_filter,@order_source)
@from = from
@to = to
@@ -58,10 +59,10 @@ authorize_resource :class => false
end
out = {:status => 'ok', :message => date_arr}
respond_to do |format|
format.json { render json: out }
end
end
end
end