Pull from master

This commit is contained in:
San Wai Lwin
2018-05-22 13:26:23 +06:30
parent 574f320dfd
commit f1733d9f06
71 changed files with 1151 additions and 726 deletions

View File

@@ -47,9 +47,12 @@ class Api::BillController < Api::ApiController
Promotion.promo_activate(@sale)
#BillBroadcastJob.perform_later(table)
#if ENV["SERVER_MODE"] != 'cloud'
ActionCable.server.broadcast "bill_channel",table: table
#end
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
from = ""
end
ActionCable.server.broadcast "bill_channel",table: table, from: from
else
@status = false
@error_message = "No Current Open Shift"

View File

@@ -6,9 +6,12 @@ class Api::CallWaitersController < ActionController::API
@time = params[:time]
@table = DiningFacility.find(@table_id)
# CallWaiterJob.perform_later(@table,@time)
#if ENV["SERVER_MODE"] != 'cloud'
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time
#end
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
from = ""
end
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from
# get printer info
@shop = Shop.first
unique_code = "CallWaiterPdf"

View File

@@ -6,7 +6,16 @@ class Api::CheckInProcessController < Api::ApiController
booking = dining_facility.get_current_checkout_booking
if !booking.nil?
DiningFacility.check_in_booking(params[:dining_id])
# DiningFacility.check_in_booking(params[:dining_id])
table = DiningFacility.find(params[:dining_id])
#Send to background job for processing
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
from = ""
end
ActionCable.server.broadcast "check_in_booking_channel",table: table,from:from
check_in_time = booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")
check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M")

View File

@@ -73,7 +73,12 @@ class Api::OrderReserve::OrderReservationController < Api::ApiController
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is successfully created!" }
order_reservation = OrderReservation.get_pending_orders #find(order_reservation_id)
ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
from = ""
end
ActionCable.server.broadcast "order_reservation_channel",data: order_reservation,shop_code: shop_code,from:from
else
result = { :status => true, :order_reservation_id => order_reservation_id, :message => "Order reservation is already existed!" }
end