change booking model generate
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user