fix articles_for_select2 helper
This commit is contained in:
parent
2b511ee559
commit
1ab09b41bd
4 changed files with 14 additions and 17 deletions
|
|
@ -1,12 +1,3 @@
|
|||
# :encoding:utf-8:
|
||||
module Finance::ReceiveHelper
|
||||
# TODO currently duplicate a bit of DeliveriesHelper.articles_for_select2
|
||||
# except is an array of article id's to omit
|
||||
def articles_for_select2(supplier, except = [])
|
||||
articles = supplier.articles.reorder('articles.name ASC')
|
||||
articles.reject! {|a| not except.index(a.id).nil? } if except
|
||||
articles.map do |a|
|
||||
{:id => a.id, :text => "#{a.name} (#{a.unit_quantity}⨯#{a.unit})"}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue