add dine-in cashier settings in lookups
This commit is contained in:
@@ -7,6 +7,7 @@ class OrderReservation < ApplicationRecord
|
||||
has_many :order_reservation_items
|
||||
has_one :delivery
|
||||
|
||||
scope :active, -> { where("created_at BETWEEN '#{DateTime.now.utc.beginning_of_day}' AND '#{DateTime.now.utc.end_of_day}'") }
|
||||
scope :latest_order, -> { order("order_reservation_id desc, created_at desc") }
|
||||
|
||||
SEND_TO_KITCHEN = "send_to_kitchen"
|
||||
@@ -218,7 +219,7 @@ class OrderReservation < ApplicationRecord
|
||||
|
||||
def self.check_order_send_to_kitchen
|
||||
today = Time.now.utc
|
||||
order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}'")
|
||||
order_reservation = OrderReservation.where("status='accepted' and requested_time > '#{today}' and expected_waiting_time < '#{today}'")
|
||||
if order_reservation.length > 0
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
ActionCable.server.broadcast "check_order_send_to_kitchen_channel",data: order_reservation
|
||||
@@ -228,7 +229,7 @@ class OrderReservation < ApplicationRecord
|
||||
|
||||
def self.check_order_ready_to_delivery
|
||||
today = Time.now.utc
|
||||
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}'")
|
||||
order_reservation = OrderReservation.where("status='send_to_kitchen' and requested_time > '#{today}' and expected_waiting_time < '#{today}'")
|
||||
if order_reservation.length > 0
|
||||
if ENV["SERVER_MODE"] == 'cloud'
|
||||
ActionCable.server.broadcast "check_order_ready_to_delivery_channel",data: order_reservation
|
||||
|
||||
Reference in New Issue
Block a user