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,11 +1,18 @@
|
||||||
class StockitController < ApplicationController
|
class StockitController < ApplicationController
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
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(
|
@stock_articles = StockArticle.without_deleted.all(
|
||||||
:include => [:supplier, :article_category],
|
:include => [:supplier, :article_category],
|
||||||
:order => 'suppliers.name, article_categories.name, articles.name'
|
:order => 'suppliers.name, article_categories.name, articles.name'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
@stock_article = StockArticle.new
|
@stock_article = StockArticle.new
|
||||||
|
|
|
@ -20,6 +20,11 @@
|
||||||
%b= link_to "Inventur anlegen", new_stock_taking_path
|
%b= link_to "Inventur anlegen", new_stock_taking_path
|
||||||
|
|
|
|
||||||
= link_to "Inventurübersicht", stock_takings_path
|
= link_to "Inventurübersicht", stock_takings_path
|
||||||
|
|
|
||||||
|
- unless params[:show_not_available] == "1"
|
||||||
|
= link_to "Zeige auch nicht verfügbare Lagerartikel", stock_articles_path(:show_not_available => 1)
|
||||||
|
- else
|
||||||
|
= link_to "Verstecke nicht verfügbare Artikel", stock_articles_path
|
||||||
|
|
||||||
#articles{:style => "clear:both;margin-top:1em"}
|
#articles{:style => "clear:both;margin-top:1em"}
|
||||||
%table.list
|
%table.list
|
||||||
|
|
Loading…
Reference in a new issue