check req bil

This commit is contained in:
phyusin
2018-08-08 09:48:21 +06:30
parent 5b1374b3ee
commit a0f81af75b
3 changed files with 22 additions and 20 deletions

View File

@@ -45,22 +45,7 @@ class Api::BillController < Api::ApiController
@sale_id = booking.sale_id
@sale_data = Sale.find_by_sale_id(@sale_id)
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, booking, table)
end
end
end
elsif (params[:order_id])
order = Order.find(params[:order_id])
@sale = Sale.new
@@ -75,6 +60,22 @@ class Api::BillController < Api::ApiController
# @sale_data.shift_sale_id = shift_by_terminal.id
# @sale_data.save
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, check_booking, table)
end
end
Promotion.promo_activate(@sale)
#BillBroadcastJob.perform_later(table)