fix order update with table and room
This commit is contained in:
@@ -95,6 +95,10 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
end
|
||||
|
||||
def modify_order
|
||||
@zone = Zone.all
|
||||
@tables = Table.active.order('status desc')
|
||||
@rooms = Room.active.order('status desc')
|
||||
|
||||
@cashier_type = "food_court"
|
||||
today = DateTime.now
|
||||
day = Date.today.wday
|
||||
@@ -112,6 +116,8 @@ class Foodcourt::OrdersController < BaseFoodcourtController
|
||||
@booking = @table.get_booking
|
||||
end
|
||||
|
||||
# byebug
|
||||
|
||||
@sale_id = @booking.sale_id
|
||||
|
||||
if @booking
|
||||
|
||||
@@ -533,8 +533,8 @@
|
||||
$('#addorder').on('click', function () {
|
||||
var status = "<%= @status %>"
|
||||
if (status == 'sale'){
|
||||
var table_id = "<%= @pending.try(:bookings).try(:first).try(:dining_facility).try(:id) %>"
|
||||
var booking_id = "<%= @pending.try(:bookings).try(:first).try(:id) %>"
|
||||
var table_id = "<%= @pending.try(:booking).try(:dining_facility).try(:id) %>"
|
||||
var booking_id = "<%= @pending.try(:booking).try(:id) %>"
|
||||
}
|
||||
else {
|
||||
var table_id = "<%= @pending.try(:dining_facility).try(:id) %>";
|
||||
@@ -543,11 +543,11 @@
|
||||
}
|
||||
|
||||
var sale_id = $("#sale_id").text();
|
||||
if (table_id) {
|
||||
window.location.href = '/foodcourt/food_court/modify_order/' + table_id + "/"+ sale_id + '?update=true';
|
||||
}else{
|
||||
window.location.href = '/foodcourt/food_court/modify_order/' + booking_id + "/" + sale_id + '?update=true&order_id="'+order_id+'"'
|
||||
}
|
||||
// if (table_id) {
|
||||
window.location.href = '/foodcourt/food_court/modify_order/' + booking_id + "/"+ sale_id + '?update=true';
|
||||
// }else{
|
||||
// window.location.href = '/foodcourt/food_court/modify_order/' + booking_id + "/" + sale_id + '?update=true&order_id="'+order_id+'"'
|
||||
// }
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user