Hide articles with a stock amount of zero. Closes #17
This commit is contained in:
parent
f72dccae18
commit
6761a41048
2 changed files with 16 additions and 4 deletions
|
|
@ -1,10 +1,17 @@
|
|||
class StockitController < ApplicationController
|
||||
|
||||
def index
|
||||
@stock_articles = StockArticle.without_deleted.all(
|
||||
:include => [:supplier, :article_category],
|
||||
:order => 'suppliers.name, article_categories.name, articles.name'
|
||||
)
|
||||
unless params[:show_not_available] == "1"
|
||||
@stock_articles = StockArticle.without_deleted.available.all(
|
||||
:include => [:supplier, :article_category],
|
||||
:order => 'suppliers.name, article_categories.name, articles.name'
|
||||
)
|
||||
else
|
||||
@stock_articles = StockArticle.without_deleted.all(
|
||||
:include => [:supplier, :article_category],
|
||||
:order => 'suppliers.name, article_categories.name, articles.name'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue