update move table with order queue station

This commit is contained in:
Aung Myo
2018-09-07 17:35:22 +06:30
parent aec7966dd0
commit aecccffa1e
2 changed files with 124 additions and 97 deletions

View File

@@ -86,9 +86,11 @@ class Origami::MovetableController < BaseOrigamiController
booking.booking_orders.each do |booking_order|
order = Order.find(booking_order.order_id)
if order.status == 'new'
order.order_items.each do |order_item|
order_items.push(order_item)
end
oqs = OrderQueueStation.new
oqs.process_order(order, change_from, order.source, 'move',change_to,current_user.name)
# order.order_items.each do |order_item|
# order_items.push(order_item)
# end
end
end
end
@@ -96,28 +98,28 @@ class Origami::MovetableController < BaseOrigamiController
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# get printer info
@from = (DiningFacility.find(change_from)).name
@to = (DiningFacility.find(change_to)).name
@type = (DiningFacility.find(change_to)).type
@moved_by = @current_user.name
@date = DateTime.now
@shop = Shop.first
unique_code = "MoveTablePdf"
pdf_no = PrintSetting.where(:unique_code => unique_code).count
#print_settings = PrintSetting.find_by_unique_code(unique_code)
printer_array = []
printer_array = PrintSetting.where(:unique_code => unique_code)
# if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
# # get printer info
# @from = (DiningFacility.find(change_from)).name
# @to = (DiningFacility.find(change_to)).name
# @type = (DiningFacility.find(change_to)).type
# @moved_by = @current_user.name
# @date = DateTime.now
# @shop = Shop.first
# unique_code = "MoveTablePdf"
# pdf_no = PrintSetting.where(:unique_code => unique_code).count
# #print_settings = PrintSetting.find_by_unique_code(unique_code)
# printer_array = []
# printer_array = PrintSetting.where(:unique_code => unique_code)
for i in 0..pdf_no
if i != pdf_no
print_settings = printer_array[i]
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items)
end
end
end
# for i in 0..pdf_no
# if i != pdf_no
# print_settings = printer_array[i]
# printer = Printer::ReceiptPrinter.new(print_settings)
# printer.print_move_table(print_settings,@to,@from ,@shop,@date,@type,@moved_by,order_items)
# end
# end
# end
type = 'move'
from = getCloudDomain #get sub domain in cloud mode