From 0db7724f85b45a0000dd5d26452f16fae07e0efc Mon Sep 17 00:00:00 2001 From: Benjamin Meichsner Date: Sun, 17 May 2009 16:43:48 +0200 Subject: [PATCH] Hide StockArticles with negeative stock amount in new order. Closes #9 --- app/models/order.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/order.rb b/app/models/order.rb index c85aa2da..03ae8967 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -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 }