Revert "Do not subtract articles in open orders when calculating quantity."

This reverts commit 6bf3b241e6.
This commit is contained in:
Robert Waltemath 2013-03-07 20:39:35 +01:00
parent 6bf3b241e6
commit 93a99c45d8

View file

@ -16,7 +16,7 @@ class StockArticle < Article
# Check for unclosed orders and substract its ordered quantity
def quantity_available
quantity - OrderArticle.where(article_id: id).
joins(:order).where("orders.state = 'finished'").sum(:units_to_order)
joins(:order).where("orders.state = 'open' OR orders.state = 'finished'").sum(:units_to_order)
end
def self.stock_value