Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into quick_service

This commit is contained in:
Aung Myo
2018-02-16 09:51:51 +06:30
7 changed files with 25 additions and 13 deletions

View File

@@ -40,16 +40,25 @@ class Origami::VoidController < BaseOrigamiController
# end
table_avaliable = true
table_count = 0
table = sale.bookings[0].dining_facility
table.bookings.each do |booking|
if !booking.sale.nil?
if booking.sale.sale_status == 'new'
if booking.booking_status != 'moved'
if booking.sale_id
if booking.sale.sale_status != 'completed' && booking.sale.sale_status != 'void'
table_avaliable = false
table_count += 1
else
table_avaliable = true
end
else
table_avaliable = false
table_count += 1
end
end
end
if table_avaliable
if table_avaliable && table_count == 0
table.status = 'available'
table.save
end