update request bill reload in quick service
This commit is contained in:
@@ -8,9 +8,7 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
if !ShiftSale.current_shift.nil?
|
if !ShiftSale.current_shift.nil?
|
||||||
order_id = params[:id] # order_id
|
order_id = params[:id] # order_id
|
||||||
bk_order = BookingOrder.find_by_order_id(order_id)
|
bk_order = BookingOrder.find_by_order_id(order_id)
|
||||||
puts params[:id]
|
order = Order.find(order_id)
|
||||||
puts bk_order
|
|
||||||
puts bk_order.booking_id
|
|
||||||
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
|
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
|
||||||
|
|
||||||
if check_booking.sale_id.nil?
|
if check_booking.sale_id.nil?
|
||||||
@@ -29,6 +27,10 @@ class Origami::RequestBillsController < ApplicationController
|
|||||||
|
|
||||||
# Promotion Activation
|
# Promotion Activation
|
||||||
Promotion.promo_activate(@sale)
|
Promotion.promo_activate(@sale)
|
||||||
|
if order.source == "quick_service"
|
||||||
|
result = {:status=> @status, :data => @sale.sale_id }
|
||||||
|
render :json => result.to_json
|
||||||
|
end
|
||||||
else
|
else
|
||||||
@status = false
|
@status = false
|
||||||
@error_message = "No Current Open Shift for This Employee"
|
@error_message = "No Current Open Shift for This Employee"
|
||||||
|
|||||||
@@ -203,11 +203,12 @@ $(document).ready(function(){
|
|||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
// data: 'order_id='+ order_id,
|
// data: 'order_id='+ order_id,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
|
console.log(result)
|
||||||
if (!result.status) {
|
if (!result.status) {
|
||||||
swal("Information!", result.error_message);
|
swal("Information!", result.error_message);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
location.reload();
|
window.location.href = '../pending_order/'+ result.data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user