update waiter view add order

This commit is contained in:
Aung Myo
2018-02-26 09:19:14 +06:30
parent ac47501e01
commit f4f5915532
12 changed files with 259 additions and 160 deletions

View File

@@ -153,13 +153,18 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
end
@status, @booking = @order.generate
if @status && @booking && @order.source == 'quick_service'
if current_user.role != "waiter"
if @status && @booking && @order.source == 'quick_service'
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
result = {:status=> @status, :data => @sale }
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
result = {:status=> @status, :data => @sale }
render :json => result.to_json
end
else
result = {:status=> @status, :data => 0 }
render :json => result.to_json
end
end
# render json for http status code