udpdate qs

This commit is contained in:
Aung Myo
2018-02-14 13:46:22 +06:30
parent a844b51b39
commit 08e372cfb5
3 changed files with 26 additions and 62 deletions

View File

@@ -102,9 +102,13 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
if !params["booking_id"].nil?
# check booking id is already completed.
booking = Booking.find(params[:booking_id])
if !params[:table_id].nil?
table_status = booking.dining_facility_id.to_i == params[:table_id].to_i
else
table_status = true
end
if booking
if booking.dining_facility_id.to_i == params[:table_id].to_i && booking.booking_status != 'moved'
if table_status && booking.booking_status != 'moved'
if !booking.sale_id.nil?
sale_status = check_order_with_booking(booking)
if sale_status
@@ -115,17 +119,21 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
@order.booking_id = params[:booking_id]
end
else
if !params[:table_id].nil?
sale_status = check_order_with_table(params[:table_id])
if sale_status
return return_json_status_with_code(400, "bill requested")
end
end
end
end #booking exists
else
sale_status = check_order_with_table(params[:table_id])
if sale_status
# return false , @message = "bill requested"
return return_json_status_with_code(400, "bill requested")
if !params[:table_id].nil?
sale_status = check_order_with_table(params[:table_id])
if sale_status
# return false , @message = "bill requested"
return return_json_status_with_code(400, "bill requested")
end
end
end