update search data in transaction

This commit is contained in:
Aung Myo
2017-11-21 18:29:41 +06:30
parent 01bf7caeb5
commit 3041d6a368
11 changed files with 224 additions and 219 deletions

View File

@@ -20,7 +20,9 @@ class Transactions::BookingsController < ApplicationController
@bookings = 0
end
end
@receipt_no = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb
format.json { render json: @bookings }

View File

@@ -14,20 +14,21 @@ class Transactions::CreditNotesController < ApplicationController
to = params[:to]
if filter.nil? && from.nil? && to.nil? && customer.nil?
@sales = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
@credit_notes = Sale.where('payment_status = ?', Sale::SALE_STATUS_OUTSTANDING)
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(20)
@credit_notes = sale
@credit_notes = Kaminari.paginate_array(@credit_notes).page(params[:page]).per(20)
else
@sales = 0
@credit_notes = 0
end
end
puts "sssssssssssss"
puts @credit_notes.to_json
respond_to do |format|
format.html # index.html.erb
format.json { render json: @sales }
format.json { render json: @credit_notes }
end
end

View File

@@ -20,6 +20,10 @@ class Transactions::OrdersController < ApplicationController
else
@orders = []
end
@receipt_no = filter
@from = from
@to = to
respond_to do |format|
format.html # index.html.erb

View File

@@ -22,6 +22,9 @@ class Transactions::SalesController < ApplicationController
@sales = 0
end
end
@receipt_no = receipt_no
@from = from
@to = to
# if receipt_no.nil? && search_date.nil?
# @sales = Sale.where("NOT sale_status = 'void' " ).order("sale_id desc").limit(500)