Module: BookingTemplateHelper

Defined in:
app/helpers/booking_template_helper.rb

Instance Method Summary collapse

Instance Method Details

#amount_relations_as_collectionObject



2
3
4
5
6
7
8
# File 'app/helpers/booking_template_helper.rb', line 2

def amount_relations_as_collection
  relations = ['reference_amount', 'reference_balance', 'reference_amount_minus_balance']
  relations.inject({}) do |result, relation|
    result[t(relation, :scope => 'booking_template.relation')] = relation
    result
  end
end

#amount_to_s(booking_template) ⇒ Object



10
11
12
13
14
15
16
# File 'app/helpers/booking_template_helper.rb', line 10

def amount_to_s(booking_template)
  if booking_template.amount_relates_to.present?
    return "%.2f%%" % (booking_template.amount.to_f * 100)
  else
    return currency_fmt(booking_template.amount)
  end
end