update request bill msg box error

This commit is contained in:
Aung Myo
2018-04-10 17:29:02 +06:30
parent 0e39e4577f
commit 0e5269c66f
5 changed files with 26 additions and 15 deletions

View File

@@ -154,10 +154,13 @@ class Origami::QuickServiceController < ApplicationController
result = {:status=> true, :data => @sale }
render :json => result.to_json
end
end
elsif (params[:sale_id][0,3] == "BKI")
result = {:status=> true, :data => 'OK' }
render :json => result.to_json
else
result = {:status=> true, :data => nil }
render :json => result.to_json
render :json => result.to_json
end
end

View File

@@ -16,7 +16,12 @@ class Origami::RequestBillsController < ApplicationController
bk_order = BookingOrder.find_by_order_id(order_id)
order = Order.find(order_id)
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
table = DiningFacility.find(check_booking.dining_facility_id)
if check_booking.dining_facility_id.to_i > 0
table = DiningFacility.find(check_booking.dining_facility_id)
else
table = nil
end
if check_booking.sale_id.nil?
# Create Sale if it doesn't exist
@status, @sale_id = @sale.generate_invoice_from_booking(check_booking.id,current_login_employee, current_user, order.source)