Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user