modify call waiter

This commit is contained in:
Zin Moe
2020-07-29 16:26:35 +06:30
parent 91378c21f5
commit 143b509efe
2 changed files with 14 additions and 16 deletions

View File

@@ -1,5 +1,4 @@
class Api::CallWaitersController < ActionController::API
class Api::CallWaitersController < Api::ApiController
#List all active customers by name
def index
@table_id = params[:dining_id]
@@ -18,17 +17,17 @@ class Api::CallWaitersController < ActionController::API
# CallWaiterJob.perform_later(@table,@time)
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
else
from = ""
end
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from, shift_ids: shift_ids
end
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from, shift_ids: shift_ids
# get printer info
@shop = Shop.current_shop
unique_code = "CallWaiterPdf"
@shop = Shop.current_shop
unique_code = "CallWaiterPdf"
print_settings = PrintSetting.find_by_unique_code(unique_code)
printer = Printer::ReceiptPrinter.new(print_settings)
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_call_waiter(print_settings,@table,@time,@shop)
end
end