23 lines
700 B
Ruby
Executable File
23 lines
700 B
Ruby
Executable File
class Inventory::InventoryController < BaseInventoryController
|
|
load_and_authorize_resource
|
|
def index
|
|
|
|
filter = params[:filter]
|
|
@inventory_definitions = InventoryDefinition.get_by_category(@shop,filter)
|
|
|
|
end
|
|
|
|
def show
|
|
inventory_definition_id = params[:inventory_definition_id]
|
|
inventory = InventoryDefinition.find_by_id_and_shop_code(inventory_definition_id,@shop.shop_code)
|
|
@stock_journals = StockJournal.where("item_code=? and shop_code='#{@shop.shop_code}'",inventory.item_code).order("id DESC")
|
|
@stock_journals = Kaminari.paginate_array(@stock_journals).page(params[:page]).per(20)
|
|
|
|
respond_to do |format|
|
|
format.html
|
|
format.xls
|
|
end
|
|
end
|
|
|
|
end
|