class Inventory::InventoryController < BaseInventoryController
  load_and_authorize_resource
  def index

    filter = params[:filter]

    @inventory_definitions = InventoryDefinition.get_by_category(filter)

  end
  
  def show
    inventory_definition_id = params[:inventory_definition_id]
    inventory = InventoryDefinition.find(inventory_definition_id)

    @stock_journals = StockJournal.where(item_code: inventory.item_code)
    @stock_journals  = Kaminari.paginate_array(@stock_journals).page(params[:page]).per(20)
    
    respond_to do |format|
      format.html
      format.xls
    end
  end

   	#Shop Name in Navbor
	helper_method :shop_detail
	def shop_detail
		@shop = Shop.first
	end
end
