2012-04-15 19:59:39 +02:00
|
|
|
# encoding: utf-8
|
2009-01-06 11:49:19 +01:00
|
|
|
module OrdersHelper
|
|
|
|
|
2009-01-29 01:57:51 +01:00
|
|
|
def update_articles_link(order, text, view)
|
2012-10-15 21:19:17 +02:00
|
|
|
link_to text, order_path(order, view: view), remote: true
|
2009-01-29 01:57:51 +01:00
|
|
|
end
|
|
|
|
|
2012-10-15 21:19:17 +02:00
|
|
|
def order_pdf(order, document, text)
|
2013-04-10 17:29:06 +02:00
|
|
|
link_to text, order_path(order, document: document, format: :pdf), title: I18n.t('helpers.orders.order_pdf')
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
2009-02-11 15:23:59 +01:00
|
|
|
|
|
|
|
def options_for_suppliers_to_select
|
2013-04-10 17:29:06 +02:00
|
|
|
options = [[I18n.t('helpers.orders.option_choose')]]
|
2012-10-15 21:19:17 +02:00
|
|
|
options += Supplier.all.map {|s| [ s.name, url_for(action: "new", supplier_id: s)] }
|
2013-04-10 17:29:06 +02:00
|
|
|
options += [[I18n.t('helpers.orders.option_stock'), url_for(action: 'new', supplier_id: 0)]]
|
2011-06-10 13:53:51 +02:00
|
|
|
options_for_select(options)
|
2009-02-11 15:23:59 +01:00
|
|
|
end
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|