change oqs print
This commit is contained in:
@@ -21,34 +21,60 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
booking = Booking.find_by_dining_facility_id(dining.id)
|
booking = Booking.find_by_dining_facility_id(dining.id)
|
||||||
|
|
||||||
#Assign OQS id to order Items
|
#Assign OQS id to order Items
|
||||||
oqs_stations.each do |oqs|
|
# oqs_stations.each do |oqs|
|
||||||
is_auto_printed = false
|
# is_auto_printed = false
|
||||||
oqs_order_items = []
|
# oqs_order_items = []
|
||||||
#Get List of items -
|
# #Get List of items -
|
||||||
pq_items = JSON.parse(oqs.processing_items)
|
# pq_items = JSON.parse(oqs.processing_items)
|
||||||
|
|
||||||
#Loop through the processing items
|
# #Loop through the processing items
|
||||||
pq_items.each do |pq_item|
|
# pq_items.each do |pq_item|
|
||||||
#Processing through the looping items
|
# #Processing through the looping items
|
||||||
order_items.each do |order_item|
|
# order_items.each do |order_item|
|
||||||
if (pq_item == order_item.item_code)
|
# if (pq_item == order_item.item_code)
|
||||||
# if oqs.id == oqpbz.order_queue_station_id
|
# # if oqs.id == oqpbz.order_queue_station_id
|
||||||
# #Same Order_items can appear in two location.
|
# # #Same Order_items can appear in two location.
|
||||||
# AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
# # AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
# else
|
# # else
|
||||||
|
|
||||||
|
# if (order_item.price != 0)
|
||||||
|
# AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
|
# oqs_order_items.push(order_item)
|
||||||
|
# end
|
||||||
|
# # end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
|
||||||
if (order_item.price != 0)
|
|
||||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
|
||||||
oqs_order_items.push(order_item)
|
|
||||||
end
|
|
||||||
# end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Auto Printing
|
|
||||||
# ToDo per item per printer
|
# ToDo per item per printer
|
||||||
|
|
||||||
OrderQueueProcessByZone.where("zone_id=#{dining.zone_id}").find_each do |oqpbz|
|
OrderQueueProcessByZone.where("zone_id=#{dining.zone_id}").find_each do |oqpbz|
|
||||||
if oqs.id == oqpbz.order_queue_station_id
|
oqs = OrderQueueStation.find(oqpbz.order_queue_station_id)
|
||||||
|
is_auto_printed = false
|
||||||
|
oqs_order_items = []
|
||||||
|
|
||||||
|
if oqs.is_active
|
||||||
|
#Get List of items -
|
||||||
|
pq_items = JSON.parse(oqs.processing_items)
|
||||||
|
#Loop through the processing items
|
||||||
|
pq_items.each do |pq_item|
|
||||||
|
#Processing through the looping items
|
||||||
|
order_items.each do |order_item|
|
||||||
|
if (pq_item == order_item.item_code)
|
||||||
|
# if oqs.id == oqpbz.order_queue_station_id
|
||||||
|
# #Same Order_items can appear in two location.
|
||||||
|
# AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
|
# else
|
||||||
|
|
||||||
|
if (order_item.price != 0)
|
||||||
|
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
|
oqs_order_items.push(order_item)
|
||||||
|
end
|
||||||
|
# end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if oqs.auto_print
|
if oqs.auto_print
|
||||||
if oqs_order_items.length > 0
|
if oqs_order_items.length > 0
|
||||||
print_slip(oqs, order, oqs_order_items)
|
print_slip(oqs, order, oqs_order_items)
|
||||||
@@ -56,8 +82,17 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
# if oqs.id == oqpbz.order_queue_station_id
|
||||||
|
# # Auto Printing
|
||||||
|
# if oqs.auto_print
|
||||||
|
# if oqs_order_items.length > 0
|
||||||
|
# print_slip(oqs, order, oqs_order_items)
|
||||||
|
# is_auto_printed = true
|
||||||
|
# end
|
||||||
|
# end
|
||||||
|
# end
|
||||||
end
|
end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user