parent
67ad202859
commit
085562dbf4
4 changed files with 23 additions and 8 deletions
|
|
@ -21,7 +21,7 @@ class StockArticle < Article
|
|||
|
||||
def quantity_ordered
|
||||
OrderArticle.where(article_id: id).
|
||||
joins(:order).where(orders: {state: ['open', 'finished']}).sum(:units_to_order)
|
||||
joins(:order).where(orders: {state: %w[open finished received]}).sum(:units_to_order)
|
||||
end
|
||||
|
||||
def quantity_history
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue