Read NFC
This commit is contained in:
@@ -9,7 +9,7 @@ class Transactions::BookingsController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@bookings = Booking.where("shop_code=?",@shop.shop_code).order("sale_id desc")
|
||||
@bookings = Booking.order("sale_id desc")
|
||||
@bookings = Kaminari.paginate_array(@bookings).page(params[:page]).per(20)
|
||||
else
|
||||
booking = Booking.search(filter,from,to)
|
||||
|
||||
@@ -13,11 +13,11 @@ class Transactions::OrderReservationsController < ApplicationController
|
||||
if from.nil? && to.nil?
|
||||
@order_reservations = OrderReservation.select("order_reservations.*, deliveries.provider, deliveries.delivery_fee")
|
||||
.joins(" JOIN deliveries on deliveries.order_reservation_id = order_reservations.order_reservation_id")
|
||||
.where("NOT order_reservation_status='new' and order_reservations.shop_code='#{@shop.shop_code}'")
|
||||
.where("NOT order_reservation_status='new'")
|
||||
.order("order_reservation_id desc")
|
||||
@order_reservations = Kaminari.paginate_array(@order_reservations).page(params[:page]).per(20)
|
||||
else
|
||||
order_reservation = OrderReservation.search(filter,from,to).where("order_reservations.shop_code='#{@shop.shop_code}'")
|
||||
order_reservation = OrderReservation.search(filter,from,to)
|
||||
if order_reservation.length > 0
|
||||
@order_reservations = order_reservation
|
||||
@order_reservations = Kaminari.paginate_array(@order_reservations).page(params[:page]).per(20)
|
||||
|
||||
@@ -9,9 +9,9 @@ class Transactions::OrdersController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
orders = Order.where("shop_code='#{@shop.shop_code}'").order("order_id desc")
|
||||
orders = Order.order("order_id desc")
|
||||
else
|
||||
orders = Order.search(filter,from,to).where("orders.shop_code='#{@shop.shop_code}'")
|
||||
orders = Order.search(filter,from,to)
|
||||
end
|
||||
|
||||
if !orders.nil?
|
||||
|
||||
@@ -89,7 +89,7 @@ class Transactions::SalesController < ApplicationController
|
||||
# GET /transactions/sales/1
|
||||
# GET /transactions/sales/1.json
|
||||
def show
|
||||
@membership = MembershipSetting.find_by_shop_code(@shop.shop_code)
|
||||
@membership = MembershipSetting.all
|
||||
@payment_methods = PaymentMethodSetting.where("is_active='1'")
|
||||
@sale = Sale.find(params[:id])
|
||||
|
||||
|
||||
@@ -11,10 +11,10 @@ class Transactions::ShiftSalesController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@shift_sales = ShiftSale.where("shop_code='#{@shop.shop_code}'").order("id desc")
|
||||
@shift_sales = ShiftSale.order("id desc")
|
||||
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
|
||||
else
|
||||
shift_sale = ShiftSale.search(filter,from,to).where("shift_sales.shop_code='#{@shop.shop_code}'")
|
||||
shift_sale = ShiftSale.search(filter,from,to)
|
||||
if shift_sale.count > 0
|
||||
@shift_sales = shift_sale
|
||||
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
|
||||
|
||||
@@ -6,9 +6,9 @@ class Transactions::SurveysController < ApplicationController
|
||||
to = params[:to]
|
||||
|
||||
if filter.nil? && from.nil? && to.nil?
|
||||
@surveys = Survey.where("shop_code='#{@shop.shop_code}'")
|
||||
@surveys = Survey.all
|
||||
else
|
||||
@surveys = Survey.search(filter,from,to).where("shop_code='#{@shop.shop_code}'")
|
||||
@surveys = Survey.search(filter,from,to)
|
||||
end
|
||||
|
||||
@filter = filter
|
||||
|
||||
Reference in New Issue
Block a user