Fixed orders form.
This commit is contained in:
parent
9ad93e9c06
commit
afb2c26ab3
7 changed files with 77 additions and 94 deletions
|
|
@ -37,12 +37,12 @@ class Order < ActiveRecord::Base
|
|||
|
||||
def articles_for_ordering
|
||||
if stockit?
|
||||
StockArticle.available.without_deleted(:include => :article_category,
|
||||
StockArticle.available.all(:include => :article_category,
|
||||
:order => 'article_categories.name, articles.name').reject{ |a|
|
||||
a.quantity_available <= 0
|
||||
}.group_by { |a| a.article_category.name }
|
||||
else
|
||||
supplier.articles.available.without_deleted.group_by { |a| a.article_category.name }
|
||||
supplier.articles.available.all.group_by { |a| a.article_category.name }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue