update booking today and yesterday
This commit is contained in:
@@ -15,23 +15,9 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
@status_sale = ""
|
||||
@sale_array = Array.new
|
||||
|
||||
# if !bookings.nil?
|
||||
# bookings.each do | booking |
|
||||
# if booking.sale_id.nil? && booking.booking_status != 'moved'
|
||||
# booking_array.push(booking)
|
||||
# end
|
||||
@dining_booking = @dining.bookings.active.where("DATE_FORMAT(created_at,'%Y-%m-%d') = '#{DateTime.now.strftime('%Y-%m-%d')}' OR DATE_FORMAT(created_at,'%Y-%m-%d') = '#{Date.today.prev_day}' ")
|
||||
|
||||
# booking.booking_orders.each do |booking_order|
|
||||
# order = Order.find(booking_order.order_id)
|
||||
# if order.status == 'new'
|
||||
# order.order_items.each do |order_item|
|
||||
# order_items.push(order_item)
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
@dining.bookings.each do |booking|
|
||||
@dining_booking.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
if booking.booking_status != 'moved'
|
||||
@@ -81,8 +67,11 @@ class Origami::MovetableController < BaseOrigamiController
|
||||
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
change_from = params[:change_from] #original
|
||||
|
||||
# bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
|
||||
bookings = Booking.where("((DATE_FORMAT(created_at,'%Y-%m-%d') = '#{DateTime.now.strftime('%Y-%m-%d')}' OR DATE_FORMAT(created_at,'%Y-%m-%d') = '#{Date.today.prev_day}')) AND dining_facility_id='#{change_from}'")
|
||||
|
||||
booking_array = Array.new
|
||||
order_items = Array.new
|
||||
|
||||
Reference in New Issue
Block a user