Allow to create stock_article as copy of article in delivery form

This commit is contained in:
Julius 2013-06-18 10:48:19 +02:00
parent cc5574f8b5
commit cc1a839246
6 changed files with 41 additions and 7 deletions

View file

@ -14,6 +14,10 @@ module DeliveriesHelper
supplier.stock_articles.undeleted.reorder('articles.name ASC').map {|a| ["#{a.name} (#{number_to_currency a.price}/#{a.unit})", a.id] }
end
def articles_for_select(supplier)
supplier.articles.undeleted.reorder('articles.name ASC').map {|a| ["#{a.name} (#{number_to_currency a.price}/#{a.unit})", a.id] }.unshift(['', nil])
end
def stock_articles_for_table(supplier)
supplier.stock_articles.undeleted.reorder('articles.name COLLATE NOCASE ASC')
end