2013-01-28 20:46:35 +01:00
|
|
|
# encoding: utf-8
|
2013-01-12 16:14:06 +01:00
|
|
|
module StockArticleSelectionsHelper
|
2013-01-28 20:46:35 +01:00
|
|
|
def article_deletion_classes(article)
|
|
|
|
className = "label label-success" # usual deletable case, maybe modified below
|
|
|
|
className = "label label-important" if article.quantity_available > 0
|
|
|
|
className = "label" if article.deleted?
|
|
|
|
|
|
|
|
className
|
|
|
|
end
|
|
|
|
|
|
|
|
def article_deletion_title(article)
|
|
|
|
myTitle = "Löschbar" # usual deletable case, maybe modified below
|
|
|
|
myTitle = "Nicht löschbar, da im Lager vorhanden" if article.quantity_available > 0
|
|
|
|
myTitle = "Bereits gelöscht" if article.deleted?
|
|
|
|
|
|
|
|
myTitle
|
|
|
|
end
|
2013-01-12 16:14:06 +01:00
|
|
|
end
|