Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into r-1804001-01

This commit is contained in:
Aung Myo
2018-04-20 09:25:22 +06:30
3 changed files with 48 additions and 40 deletions

View File

@@ -184,7 +184,11 @@ puts items_arr.to_json
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee) @status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
# for second display # for second display
if ENV["SERVER_MODE"] != 'cloud'
ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale" ActionCable.server.broadcast "second_display_channel",data: @sale,status:"sale"
end
result = {:status=> @status, :data => @sale } result = {:status=> @status, :data => @sale }
render :json => result.to_json render :json => result.to_json
end end

View File

@@ -13,9 +13,10 @@ class Origami::SecondDisplayController < BaseOrigamiController
else else
tax_profiles = nil tax_profiles = nil
end end
if ENV["SERVER_MODE"] != 'cloud'
ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status] ActionCable.server.broadcast "second_display_view_channel",data: params[:data],tax_profiles: tax_profiles,status:params[:status]
end end
end
#Shop Name in Navbor #Shop Name in Navbor
helper_method :shop_detail helper_method :shop_detail
def shop_detail def shop_detail

View File

@@ -334,13 +334,15 @@ class Order < ApplicationRecord
end end
end end
end end
end
assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id) assign_order = AssignedOrderItem.assigned_order_item_by_job(self.id)
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
end
#Process order items and send to order queue #Process order items and send to order queue
def self.pay_process_order_queue(id,table_id) def self.pay_process_order_queue(id,table_id)
if ENV["SERVER_MODE"] != 'cloud'
sidekiq = Lookup.find_by_lookup_type("sidekiq") sidekiq = Lookup.find_by_lookup_type("sidekiq")
if !sidekiq.nil? if !sidekiq.nil?
OrderQueueProcessorJob.perform_later(id, table_id) OrderQueueProcessorJob.perform_later(id, table_id)
@@ -354,6 +356,7 @@ class Order < ApplicationRecord
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
end end
end end
end
def check_cup_status(status) def check_cup_status(status)
if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running" if status.include? "Active: active (running)" || "Active: active (exited)" #"Cup Server is already running"