shop code filter for all reports and transactions
This commit is contained in:
@@ -9,11 +9,11 @@ class Transactions::OrdersController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
orders = Order.order("order_id desc")
|
||||
orders = Order.where("shop_code='#{@shop.shop_code}'").order("order_id desc")
|
||||
else
|
||||
orders = Order.search(filter,from,to)
|
||||
end
|
||||
|
||||
orders = Order.search(filter,from,to).where("orders.shop_code='#{@shop.shop_code}'")
|
||||
end
|
||||
|
||||
if !orders.nil?
|
||||
@orders = Kaminari.paginate_array(orders).page(params[:page]).per(20)
|
||||
else
|
||||
@@ -23,14 +23,14 @@ class Transactions::OrdersController < ApplicationController
|
||||
@receipt_no = filter
|
||||
@from = from
|
||||
@to = to
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.json { render json: @orders }
|
||||
# format.csv { send_data OrdersCsvExport.generate }
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
|
||||
@order = Order.find(params[:id])
|
||||
|
||||
Reference in New Issue
Block a user