change booking model generate

This commit is contained in:
phyusin
2018-06-22 15:50:43 +06:30
parent 703c4de50e
commit 8ee9434032
3 changed files with 13 additions and 13 deletions

View File

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