Implement waiter ordering and improvements

This commit is contained in:
2014-03-24 10:02:57 +01:00
parent 474d5f88c6
commit 6c2427e082
24 changed files with 128 additions and 48 deletions
+15
View File
@@ -18,4 +18,19 @@ class WaiterController < ApplicationController
format.json { render json: ProductCategory.all.include_relation(:product), root: 'product_categories', each_serializer: ProductCategorySerializer }
end
end
def order_products
@table= Table.find_by_supplier_id_and_id!(current_supplier.id, params[:table_id])
@list = List.from_table_by_employee(@table, current_employee)
@list.place_order params[:order], employee: current_employee
render nothing: true
end
def current_supplier
@current_supplier ||= Supplier.first
end
def current_employee
@current_employee ||= current_supplier.employees.first
end
end