check checkedin exist in lookups and void - sale

This commit is contained in:
phyusin
2018-02-01 16:16:26 +06:30
parent 73858fc293
commit 383aeded60
3 changed files with 17 additions and 16 deletions

View File

@@ -12,21 +12,21 @@ class Origami::CheckInProcessController < BaseOrigamiController
checkout_at = checkout_at + (checkout_time[1]).to_i.minutes
end
end
end
@dining_facility = DiningFacility.find(params[:dining_id])
@dining_facility.status = "occupied"
@dining_facility.save!
if @dining_facility.type == "Table"
type = "TableBooking"
else
type = "RoomBooking"
end
@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!
@dining_facility = DiningFacility.find(params[:dining_id])
@dining_facility.status = "occupied"
@dining_facility.save!
if @dining_facility.type == "Table"
type = "TableBooking"
else
type = "RoomBooking"
end
@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!
end
respond = {:status => 'ok'}
respond_to do |format|
format.json { render json: respond }