Delect Lookup for check in out

This commit is contained in:
San Wai Lwin
2018-06-19 10:48:56 +06:30
parent 0da0484707
commit 555ff6e684
6 changed files with 41 additions and 118 deletions

View File

@@ -83,28 +83,19 @@ class Api::CheckInProcessController < Api::ApiController
end
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
check_in_out_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
printer = PrintSetting.all
unique_code="CheckInOutPdf"
if !check_in_out_pdf.empty?
if !printer.empty?
printer.each do |printer_setting|
if printer_setting.unique_code == 'CheckInOutPdf'
unique_code="CheckInOutPdf"
end
end
end
end
printer = PrintSetting.find_by_unique_code("CheckInOutPdf")
unique_code = "CheckInOutPdf"
booking = Booking.find_by_booking_id(booking.booking_id)
table = DiningFacility.find(params[:dining_id])
# print when complete click
print_settings = PrintSetting.find_by_unique_code(unique_code)
order_queue_printer = Printer::OrderQueuePrinter.new(print_settings)
order_queue_printer.print_check_in_out(print_settings, booking, table)
from = getCloudDomain #get sub domain in cloud mode
end
order_queue_printer = Printer::OrderQueuePrinter.new(printer)
if !printer.nil?
order_queue_printer.print_check_in_out(printer, booking, table)
end
end
else
render :json => { :status => true }
end
@@ -145,16 +136,6 @@ class Api::CheckInProcessController < Api::ApiController
end
end
#get cloud domain
def getCloudDomain
from = ""
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
end
return from
end
private
def check_in_process_params
params.permit(:dining_id,:booking_id,:time)