Show current stock value on stockit page.
This commit is contained in:
parent
6761a41048
commit
4d57bd2e73
2 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,10 @@ class StockArticle < Article
|
||||||
available
|
available
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.stock_value
|
||||||
|
available.collect { |a| a.quantity * a.gross_price }.sum
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
def check_quantity
|
def check_quantity
|
||||||
|
|
|
@ -53,4 +53,7 @@
|
||||||
%td
|
%td
|
||||||
= link_to icon(:edit), edit_stock_article_path(article)
|
= link_to icon(:edit), edit_stock_article_path(article)
|
||||||
= link_to icon(:delete), article, :method => :delete, :confirm => "Bist Du sicher?"
|
= link_to icon(:delete), article, :method => :delete, :confirm => "Bist Du sicher?"
|
||||||
|
%p
|
||||||
|
Aktueller Lagerwert:
|
||||||
|
= number_to_currency StockArticle.stock_value
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue