api for cashier app

This commit is contained in:
phyusin
2018-10-12 15:18:23 +06:30
parent 549a655bad
commit 11b4bdc804
11 changed files with 258 additions and 27 deletions

View File

@@ -72,19 +72,21 @@ class Origami::RequestBillsController < ApplicationController
#check checkInOut pdf print
check_booking = Booking.find_by_sale_id(@sale_id)
checkout_time = Lookup.collection_of('checkout_time')
terminal = DiningFacility.find_by_id(check_booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if !check_booking.dining_facility_id.nil?
terminal = DiningFacility.find_by_id(check_booking.dining_facility_id)
cashier_terminal = CashierTerminal.find_by_id(terminal.zone_id)
if (!checkout_time.empty?) && (ENV["SERVER_MODE"] != "cloud") #no print in cloud server
unique_code = "CheckInOutPdf"
printer = PrintSetting.find_by_unique_code(unique_code)
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)
# print when complete click
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, cashier_terminal, check_booking, table)
end
if !printer.nil?
order_queue_printer.print_check_in_out(printer, cashier_terminal, check_booking, table)
end
end
end
end
else