update pay without existing invoice in salepayment.rb

This commit is contained in:
Aung Myo
2017-07-21 17:52:38 +06:30
parent c5dbbea76d
commit 8852bc0449
2 changed files with 7 additions and 7 deletions

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"