update filter in sale and order and creditnote
This commit is contained in:
@@ -5,9 +5,25 @@ class Transactions::CreditNotesController < ApplicationController
|
||||
# GET /transactions/sales.json
|
||||
def index
|
||||
|
||||
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||
|
||||
|
||||
@customers = Customer.all
|
||||
|
||||
filter = params[:filter]
|
||||
customer = params[:customer]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil? && customer.nil?
|
||||
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
|
||||
puts "cccccccccccc"
|
||||
else
|
||||
sale = Sale.search_credit_sales(customer,filter,from,to)
|
||||
if sale.count > 0
|
||||
@sales = sale
|
||||
@sales = Kaminari.paginate_array(@sales).page(params[:page]).per(50)
|
||||
else
|
||||
@sales = 0
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
|
||||
Reference in New Issue
Block a user