update filter order
This commit is contained in:
@@ -42,10 +42,6 @@ class Origami::ShiftsController < BaseOrigamiController
|
||||
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
|
||||
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
|
||||
|
||||
|
||||
puts "sssssssssss"
|
||||
puts @total_amount_by_account.to_json
|
||||
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
|
||||
@@ -3,18 +3,17 @@ class Transactions::OrdersController < ApplicationController
|
||||
def index
|
||||
|
||||
filter = params[:filter]
|
||||
count = params[:count]
|
||||
from = params[:from]
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? || from.nil? || to.nil?
|
||||
if filter.nil? && from.nil? && to.nil? && count.nil?
|
||||
orders = Order.order("order_id desc")
|
||||
puts "ssssss"
|
||||
else
|
||||
orders = Order.search(filter,from,to)
|
||||
# if order.count > 0
|
||||
# orders = order
|
||||
# else
|
||||
# orders = Order.order("order_id desc")
|
||||
# end
|
||||
orders = Order.search(filter,from,to,count)
|
||||
puts "aaaaa"
|
||||
|
||||
end
|
||||
|
||||
if !orders.nil?
|
||||
@@ -22,6 +21,7 @@ class Transactions::OrdersController < ApplicationController
|
||||
else
|
||||
@orders = []
|
||||
end
|
||||
puts @orders.to_json
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @orders }
|
||||
|
||||
Reference in New Issue
Block a user