class Accounting::TransactionDetailDecorator < ApplicationDecorator
  def student_line_amount
    name = student.nil? ? 'Family' : student.full_name(:last_initial)
    "#{name} - #{h.number_to_currency(amount)}"
  end

  def currency
    h.number_to_currency(object.amount, precision: 2)
  end

  def currency_with_symbol
    accounting_transaction.increase? ? currency : "-#{currency}"
  end
end
