test no table
This commit is contained in:
@@ -23,9 +23,8 @@ class Order < ApplicationRecord
|
||||
|
||||
def generate
|
||||
booking = nil
|
||||
|
||||
if self.new_booking
|
||||
if !self.table_id.nil?
|
||||
if self.table_id.to_i > 0
|
||||
table_id = self.table_id
|
||||
else
|
||||
table_id = nil
|
||||
@@ -43,7 +42,7 @@ class Order < ApplicationRecord
|
||||
end
|
||||
#end extra time
|
||||
|
||||
if !self.table_id.nil?
|
||||
if self.table_id.to_i > 0
|
||||
table = DiningFacility.find(self.table_id)
|
||||
table.status = "occupied"
|
||||
table.save
|
||||
@@ -324,11 +323,13 @@ class Order < ApplicationRecord
|
||||
|
||||
#send order items and send to order queue
|
||||
def send_order_broadcast(booking)
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
type = 'order'
|
||||
#Send to background job for processing
|
||||
# OrderBroadcastJob.perform_later(table,type)
|
||||
ActionCable.server.broadcast "order_channel",table: table,type:type
|
||||
if self.table_id.to_i > 0
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
type = 'order'
|
||||
#Send to background job for processing
|
||||
# OrderBroadcastJob.perform_later(table,type)
|
||||
ActionCable.server.broadcast "order_channel",table: table,type:type
|
||||
end
|
||||
end
|
||||
|
||||
#Origami: Cashier : to view order Table
|
||||
|
||||
Reference in New Issue
Block a user