foodcoop-adam/foodsoft

View on GitHub
lib/foodsoft_current_orders/app/helpers/current_orders_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
module CurrentOrdersHelper

  def to_pay_message(ordergroup)
    funds = ordergroup.get_available_funds
    if funds > 0
      content_tag :b, I18n.t('helpers.current_orders.pay_done'), style: 'color: green'
    elsif funds == 0
      I18n.t('helpers.current_orders.pay_none')
    else
      content_tag :b, I18n.t('helpers.current_orders.pay_amount', amount: number_to_currency(-ordergroup.get_available_funds))
    end
  end

end