multiple zone with cashier terminal call waiter noti
This commit is contained in:
@@ -5,13 +5,23 @@ class Api::CallWaitersController < ActionController::API
|
||||
@table_id = params[:dining_id]
|
||||
@time = params[:time]
|
||||
@table = DiningFacility.find(@table_id)
|
||||
shift_ids = []
|
||||
#for multiple zone with terminal
|
||||
multiple_zone = CashierTerminalByZone.where("zone_id = #{@table.zone_id}")
|
||||
multiple_zone.each do |zone|
|
||||
shift = ShiftSale.where("shift_started_at is not null and shift_closed_at is null and cashier_terminal_id = #{zone.cashier_terminal_id}").first
|
||||
if !shift.nil?
|
||||
shift_ids.push(shift.id)
|
||||
end
|
||||
end
|
||||
|
||||
# CallWaiterJob.perform_later(@table,@time)
|
||||
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
|
||||
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time,from: from, shift_ids: shift_ids
|
||||
# get printer info
|
||||
@shop = Shop.first
|
||||
unique_code = "CallWaiterPdf"
|
||||
|
||||
@@ -11,8 +11,8 @@ class Origami::HomeController < BaseOrigamiController
|
||||
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@shop = shop_detail
|
||||
@occupied_table = DiningFacility.where("status='occupied'").count;
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@occupied_table = DiningFacility.where("status='occupied'").count
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
end
|
||||
|
||||
# origami table detail
|
||||
@@ -24,6 +24,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
|
||||
@status_order = ""
|
||||
@status_sale = ""
|
||||
|
||||
@@ -4,7 +4,7 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@rooms = Room.unscoped.all.active.order('status desc')
|
||||
@complete = Sale.completed_sale("cashier")
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
# @shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
@webview = false
|
||||
if check_mobile
|
||||
@webview = true
|
||||
@@ -23,7 +23,8 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@orders = Order.includes("sale_orders").where("DATE_FORMAT(date,'%Y-%m-%d') = ? and status != 'billed' and source != 'quick_service'",DateTime.now.strftime('%Y-%m-%d')).order('date desc')
|
||||
@customers = Customer.pluck("customer_id, name")
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
|
||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||
|
||||
@status_order = ""
|
||||
@status_sale = ""
|
||||
@sale_array = Array.new
|
||||
|
||||
Reference in New Issue
Block a user