2013-07-09 21:46:04 +02:00
|
|
|
module StockChangesHelper
|
|
|
|
|
|
|
|
def link_to_stock_change_reason(stock_change)
|
|
|
|
if stock_change.delivery_id
|
2013-07-11 18:37:55 +02:00
|
|
|
link_to t('.delivery'), supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
|
2013-07-09 21:46:04 +02:00
|
|
|
elsif stock_change.order_id
|
2013-07-11 18:37:55 +02:00
|
|
|
link_to t('.order'), order_path(stock_change.order)
|
2013-07-09 21:46:04 +02:00
|
|
|
elsif stock_change.stock_taking_id
|
2013-07-11 18:37:55 +02:00
|
|
|
link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking)
|
2013-07-09 21:46:04 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|