Files
sx-fc/app/controllers/inventory/inventory_controller.rb
Myat Zin Wai Maw b0f6368248 shop_code
2019-12-05 14:56:47 +06:30

30 lines
805 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
#Shop Name in Navbor
helper_method :shop_detail
def shop_detail
@shop = Shop.current_shop
end
end