add change tax in table/room and check-in for room

This commit is contained in:
phyusin
2018-06-22 13:33:01 +06:30
parent d2dc2b8576
commit 5ba98d76be
10 changed files with 418 additions and 97 deletions

View File

@@ -64,9 +64,6 @@ class Api::CheckInProcessController < Api::ApiController
end
if checkout_at.strftime("%Y-%m-%d %H:%M%p") > today.strftime("%Y-%m-%d %H:%M%p")
dining_facility.status = "occupied"
dining_facility.save!
if dining_facility.type == "Table"
type = "TableBooking"
else
@@ -75,7 +72,10 @@ class Api::CheckInProcessController < Api::ApiController
booking = Booking.create({:dining_facility_id => params[:dining_id],:type => type,
: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!
if booking.save!
dining_facility.status = "occupied"
dining_facility.save!
end
render :json => { :status => true, :checkout_at => booking.checkout_at.utc.getlocal.strftime("%Y-%m-%d %H:%M") }
else