From 144f27d64c6b1198c88ea3c1997abdd722c4023a Mon Sep 17 00:00:00 2001 From: San Wai Lwin Date: Tue, 7 Aug 2018 16:26:34 +0630 Subject: [PATCH] Edit in check_in_process_controller --- .../api/check_in_process_controller.rb | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/app/controllers/api/check_in_process_controller.rb b/app/controllers/api/check_in_process_controller.rb index cc04e280..1b8650f1 100644 --- a/app/controllers/api/check_in_process_controller.rb +++ b/app/controllers/api/check_in_process_controller.rb @@ -77,25 +77,23 @@ class Api::CheckInProcessController < Api::ApiController dining_facility.save! 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, dining_facility) + end + end render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") } else render :json => { :status => true } end - - if ENV["SERVER_MODE"] != "cloud" #no print in cloud server - - 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 - 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