Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -369,6 +369,7 @@ class SalePayment < ApplicationRecord
|
||||
def table_update_status(sale_obj)
|
||||
status = true
|
||||
booking = Booking.find_by_sale_id(sale_obj.id)
|
||||
|
||||
if booking
|
||||
table = DiningFacility.find(booking.dining_facility_id)
|
||||
bookings = table.bookings
|
||||
@@ -377,12 +378,15 @@ class SalePayment < ApplicationRecord
|
||||
if tablebooking.sale_id
|
||||
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
|
||||
status = false
|
||||
else
|
||||
status = true
|
||||
end
|
||||
else
|
||||
status = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if status
|
||||
table.status = "available"
|
||||
table.save
|
||||
|
||||
Reference in New Issue
Block a user