foodsoft/app/helpers/stockit_helper.rb

18 lines
594 B
Ruby
Raw Normal View History

2009-01-18 17:42:51 +01:00
module StockitHelper
2012-10-29 18:28:17 +01:00
def stock_article_classes(article)
class_names = []
class_names << "unavailable" if article.quantity_available <= 0
class_names.join(" ")
end
2013-07-13 09:34:19 +02:00
def link_to_stock_change_reason(stock_change)
if stock_change.delivery_id
link_to t('.delivery'), supplier_delivery_path(stock_change.delivery.supplier, stock_change.delivery)
elsif stock_change.order_id
link_to t('.order'), order_path(stock_change.order)
elsif stock_change.stock_taking_id
link_to t('.stock_taking'), stock_taking_path(stock_change.stock_taking)
end
end
2009-01-18 17:42:51 +01:00
end