update stock taking form
This commit is contained in:
@@ -1,21 +1,15 @@
|
||||
class Inventory::StockChecksController < BaseInventoryController
|
||||
def index
|
||||
@check = StockCheck.new
|
||||
@inventory_definitions1 = InventoryDefinition.active.all
|
||||
# @inventory_definitions1 = InventoryDefinition.active.all
|
||||
|
||||
@inventory_definitions = InventoryDefinition.select("inventory_definitions.*,
|
||||
mi.name as item_name,
|
||||
mii.item_instance_name as instance_name," +
|
||||
"mc.name as menu_category_name,mc.id as menu_category_id ")
|
||||
@category = InventoryDefinition.select("inventory_definitions.*,"+
|
||||
"mc.name as name,mc.id as id ")
|
||||
.joins("JOIN menu_item_instances mii ON mii.item_instance_code = inventory_definitions.item_code" +
|
||||
" JOIN menu_items mi ON mi.id = mii.menu_item_id" +
|
||||
" JOIN menu_categories mc ON mc.id = mi.menu_category_id ")
|
||||
.group("mi.menu_category_id,inventory_definitions.item_code")
|
||||
.group("mi.menu_category_id")
|
||||
.order("mi.menu_category_id desc")
|
||||
|
||||
puts @inventory_definitions.count
|
||||
puts @inventory_definitions1.count
|
||||
puts @inventory_definitions.to_json
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -56,6 +50,19 @@ class Inventory::StockChecksController < BaseInventoryController
|
||||
end
|
||||
end
|
||||
|
||||
def get_menu_category ()
|
||||
if (params[:id])
|
||||
|
||||
#Pull this menu
|
||||
@menu_category = InventoryDefinition.search_by_category(params[:id])
|
||||
puts @menu_category.to_json
|
||||
# puts @menu.menu_items[1].item_attributes.to_json
|
||||
return @menu_category
|
||||
else
|
||||
MenuCategory.current_menu
|
||||
end
|
||||
end
|
||||
|
||||
#Shop Name in Navbor
|
||||
helper_method :shop_detail
|
||||
def shop_detail
|
||||
|
||||
Reference in New Issue
Block a user