update transaction
This commit is contained in:
@@ -4,7 +4,22 @@ class Transactions::BookingsController < ApplicationController
|
||||
|
||||
def index
|
||||
|
||||
@bookings = Booking.all.order("booking_id desc")
|
||||
filter = params[:filter]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@bookings = Booking.all.order("sale_id desc")
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
|
||||
else
|
||||
sale = Sale.search(filter,from,to)
|
||||
if sale.count > 0
|
||||
@bookings = sale
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(2)
|
||||
else
|
||||
@bookings = 0
|
||||
end
|
||||
end
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
|
||||
Reference in New Issue
Block a user