Hide StockArticles with negeative stock amount in new order. Closes #9

This commit is contained in:
Benjamin Meichsner 2009-05-17 16:43:48 +02:00
parent 27ff4bbd9b
commit 0db7724f85

View file

@ -55,7 +55,7 @@ class Order < ActiveRecord::Base
if stockit?
StockArticle.available.without_deleted(:include => :article_category,
:order => 'article_categories.name, articles.name').reject{ |a|
a.quantity_available == 0
a.quantity_available <= 0
}.group_by { |a| a.article_category.name }
else
supplier.articles.available.without_deleted.group_by { |a| a.article_category.name }