From 970b6f857ef41d5a0cbd778d4b5128c4815d1986 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 7 Dec 2017 13:38:41 +0630 Subject: [PATCH] checkin get update --- app/controllers/api/check_in_process_controller.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/check_in_process_controller.rb b/app/controllers/api/check_in_process_controller.rb index 694c8794..5b5268c2 100644 --- a/app/controllers/api/check_in_process_controller.rb +++ b/app/controllers/api/check_in_process_controller.rb @@ -9,7 +9,14 @@ class Api::CheckInProcessController < Api::ApiController check_out_time = booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time } else - render :json => { :status => false, :error_message => "No current booking!" } + sale_booking = dining_facility.get_current_checkout_booking + if !sale_booking.nil? + check_in_time = sale_booking.checkin_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") + check_out_time = sale_booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") + render :json => { :status => true, :check_in_time => check_in_time, :check_out_time => check_out_time } + else + render :json => { :status => false, :error_message => "No current booking!" } + end end end end