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

This commit is contained in:
Aung Myo
2017-06-12 15:03:02 +06:30
2 changed files with 11 additions and 4 deletions

View File

@@ -215,14 +215,21 @@ class SalePayment < ApplicationRecord
self.sale.payment_status = "paid"
self.sale.sale_status = "completed"
self.sale.save!
table_update_status()
table_update_status(sObj)
rebat()
end
end
def table_update_status
def table_update_status(sale_obj)
booking = Booking.find_by_sale_id(sale_obj.id)
if booking
table = DiningFacility.find(booking.dining_facility_id)
if table
table.status = "available"
table.save
end
end
end
def rebat

View File

@@ -233,7 +233,7 @@ $( document ).ready(function() {
data: "cash="+ cash + "&sale_id=" + sale_id,
success:function(result){
alert("Thank you")
// window.location.href = '/origami';
window.location.href = '/origami';
}
});
}