Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-07-21 18:15:39 +06:30
4 changed files with 11 additions and 9 deletions

View File

@@ -1,4 +1,3 @@
class Booking < ApplicationRecord
self.primary_key = "booking_id"
@@ -14,6 +13,7 @@ class Booking < ApplicationRecord
def self.update_dining_facility(booking_arr, newd, old)
table = DiningFacility.find(newd)
exist = table.get_booking
if exist
# order exists
booking_arr.each do |booking|

View File

@@ -321,10 +321,14 @@ class SalePayment < ApplicationRecord
bookings = table.bookings
bookings.each do |tablebooking|
if tablebooking.booking_status != 'moved'
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
if tablebooking.sale_id
if tablebooking.sale.sale_status != 'completed' && tablebooking.sale.sale_status != 'void'
status = false
end
else
status = false
end
end
end
end
end
if status
table.status = "available"