Add Check in out pdf

This commit is contained in:
San Wai Lwin
2018-06-18 16:05:54 +06:30
parent 223a84ec67
commit 25a8381681
6 changed files with 258 additions and 1 deletions

View File

@@ -29,6 +29,29 @@ class Origami::CheckInProcessController < BaseOrigamiController
:checkin_by=>current_login_employee.name,:checkin_at => Time.now.utc,:checkout_at =>checkout_at, :booking_status => "assign", :reserved_at => checkout_at, :reserved_by => current_login_employee.name })
@booking.save!
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
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
end
respond = {:status => 'ok'}
respond_to do |format|
@@ -36,4 +59,14 @@ class Origami::CheckInProcessController < BaseOrigamiController
end
end
#get cloud domain
def getCloudDomain
from = ""
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
end
return from
end
end