tax profiles
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class Api::OrdersController < Api::ApiController
|
||||
skip_before_action :authenticate
|
||||
# skip_before_action :authenticate
|
||||
#Description
|
||||
# This API show current order details
|
||||
# Input Params - order_id
|
||||
@@ -72,7 +72,6 @@ class Api::OrdersController < Api::ApiController
|
||||
@status = false
|
||||
@message = "No Current Open Shift for This Employee"
|
||||
else
|
||||
current_user = Employee.find(current_shift.employee_id)
|
||||
if checkin_checkout_time(params[:booking_id])
|
||||
|
||||
table = DiningFacility.find(params[:table_id]) if params[:table_id].present?
|
||||
@@ -95,6 +94,24 @@ class Api::OrdersController < Api::ApiController
|
||||
end
|
||||
end
|
||||
}
|
||||
items_arr = []
|
||||
params[:order_items].each { |i|
|
||||
i["item_instance_code"] = i["item_instance_code"].downcase.to_s
|
||||
if i["item_instance_code"].include? "ext"
|
||||
is_extra_time = true
|
||||
arr_exts = i["item_instance_code"].split("_")
|
||||
if arr_exts[1].match(/^(\d)+$/)
|
||||
time = arr_exts[1].to_i*60*i["quantity"].to_i
|
||||
extra_time = Time.at(time)
|
||||
end
|
||||
end
|
||||
if i["parent_order_item_id"]
|
||||
items = {"order_item_id": i,"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"parent_order_item_id": i["parent_order_item_id"],"options": JSON.parse(i["options"])}
|
||||
else
|
||||
items = {"order_item_id": i,"item_instance_code": i["item_instance_code"],"quantity": i["quantity"],"options": i["options"]}
|
||||
end
|
||||
items_arr.push(items)
|
||||
}
|
||||
#end extra time
|
||||
Order.transaction do
|
||||
# begin
|
||||
@@ -102,12 +119,12 @@ class Api::OrdersController < Api::ApiController
|
||||
@order.source = params[:order_source]
|
||||
@order.order_type = params[:order_type]
|
||||
@order.customer_id = params[:customer_id].present? ? params[:customer_id] : walkin.customer_id # for no customer id from mobile
|
||||
@order.items = params[:order_items]
|
||||
@order.items = items_arr
|
||||
@order.guest = params[:guest_info]
|
||||
@order.table_id = params[:table_id] # this is dining facilities's id
|
||||
@order.new_booking = true
|
||||
@order.waiters = current_login_employee.name
|
||||
@order.employee_name = current_login_employee.name
|
||||
@order.waiters = @user.name
|
||||
@order.employee_name = @user.name
|
||||
|
||||
@order.is_extra_time = is_extra_time
|
||||
@order.extra_time = extra_time
|
||||
@@ -125,7 +142,7 @@ class Api::OrdersController < Api::ApiController
|
||||
if @status && @booking
|
||||
Order.process_order_queue(@order.order_id,@order.table_id,@order.source)
|
||||
if @order.source == 'app'
|
||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||
@status, @sale = Sale.request_bill(@order,@user,@user)
|
||||
end
|
||||
end
|
||||
if @order.table_id.to_i > 0
|
||||
|
||||
Reference in New Issue
Block a user