conflict data
This commit is contained in:
@@ -46,7 +46,8 @@ class Api::BillController < Api::ApiController
|
||||
|
||||
Promotion.promo_activate(@sale)
|
||||
|
||||
BillBroadcastJob.perform_later(table)
|
||||
#BillBroadcastJob.perform_later(table)
|
||||
ActionCable.server.broadcast "bill_channel",table: table
|
||||
else
|
||||
@status = false
|
||||
@error_message = "No Current Open Shift"
|
||||
|
||||
@@ -5,7 +5,8 @@ class Api::CallWaitersController < ActionController::API
|
||||
@table_id = params[:dining_id]
|
||||
@time = params[:time]
|
||||
@table = DiningFacility.find(@table_id)
|
||||
CallWaiterJob.perform_later(@table,@time)
|
||||
# CallWaiterJob.perform_later(@table,@time)
|
||||
ActionCable.server.broadcast "call_waiter_channel",table: @table,time:@time
|
||||
|
||||
# get printer info
|
||||
@shop = Shop::ShopDetail
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Oqs::HomeController < BaseOqsController
|
||||
def index
|
||||
|
||||
@queue_stations = OrderQueueStation.all
|
||||
|
||||
|
||||
# Query for OQS with delivery status false
|
||||
# @queue_items_details = queue_items_query(false)
|
||||
@@ -11,6 +11,8 @@ class Oqs::HomeController < BaseOqsController
|
||||
|
||||
@filter = params[:filter]
|
||||
|
||||
@queue_stations = queue_items_count_query(false,@filter)
|
||||
|
||||
@queue_completed_item = completed_order(@filter)
|
||||
if !@queue_completed_item.empty?
|
||||
@queue_completed_item.each do |queue_item|
|
||||
@@ -26,12 +28,12 @@ class Oqs::HomeController < BaseOqsController
|
||||
end
|
||||
end
|
||||
|
||||
if !@filter.nil?
|
||||
@count = queue_items_count_query(false,@filter)
|
||||
# if !@filter.nil?
|
||||
# @count = queue_items_count_query(false,@filter)
|
||||
# @count.each do |count|
|
||||
|
||||
# end
|
||||
end
|
||||
# end
|
||||
|
||||
# @queue_stations_items=Array.new
|
||||
|
||||
@@ -99,7 +101,6 @@ class Oqs::HomeController < BaseOqsController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
render :json => items.to_json
|
||||
end
|
||||
|
||||
@@ -194,18 +195,38 @@ class Oqs::HomeController < BaseOqsController
|
||||
# completed_order = AssignedOrderItem.group(:order_id).where('delivery_status=true');
|
||||
end
|
||||
|
||||
# def queue_items_count_query(status,filter)
|
||||
# query = AssignedOrderItem.select("count(odt.item_code) as total,oqs.id as station_id")
|
||||
# .joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
# left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
# left join order_items as odt ON odt.item_instance_code = assigned_order_items.instance_code AND odt.order_id = assigned_order_items.order_id
|
||||
# left join customers as cus ON cus.customer_id = od.customer_id
|
||||
# left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
# left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
# left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
# .where("assigned_order_items.delivery_status = #{status} AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
# query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
# .group("oqs.id")
|
||||
|
||||
# end
|
||||
|
||||
def queue_items_count_query(status,filter)
|
||||
query = AssignedOrderItem.select("count(odt.item_code) as total,oqs.id as station_id")
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
left join order_items as odt ON odt.item_instance_code = assigned_order_items.instance_code AND odt.order_id = assigned_order_items.order_id
|
||||
query = OrderQueueStation.select("order_queue_stations.is_active as is_active,
|
||||
order_queue_stations.id as station_id,
|
||||
order_queue_stations.station_name as station_name,
|
||||
order_queue_stations.auto_print as auto_print,
|
||||
order_queue_stations.id as id,
|
||||
count(odt.item_code) as total")
|
||||
.joins(" left join assigned_order_items as aoi on aoi.order_queue_station_id= order_queue_stations.id
|
||||
left join orders as od ON od.order_id = aoi.order_id
|
||||
left join order_items as odt ON odt.item_instance_code = aoi.instance_code AND odt.order_id = aoi.order_id
|
||||
left join customers as cus ON cus.customer_id = od.customer_id
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join booking_orders as bo on bo.order_id = aoi.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = #{status} AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
.where("aoi.delivery_status = #{status} AND aoi.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.group("oqs.id")
|
||||
.group("order_queue_stations.id")
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user