Class: Search::LedgerEntryPresenter

Inherits:
BasePresenter
  • Object
show all
Includes:
Presenters::Timeable
Defined in:
app/presenters/search/ledger_entry_presenter.rb

Overview

Presenter: ledger entry presenter.

Direct Known Subclasses

LedgerEntryTextPresenter

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_account, #options, #url_helper

Instance Method Summary collapse

Methods inherited from BasePresenter

#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u

Constructor Details

This class inherits a constructor from BasePresenter

Instance Method Details

#bank_dateString

Localized bank-rec date.

Returns:

  • (String)


61
62
63
# File 'app/presenters/search/ledger_entry_presenter.rb', line 61

def bank_date
  h.render_date r.bank_date
end

#company_amountString

Currency-formatted company-currency amount.

Returns:

  • (String)


43
44
45
# File 'app/presenters/search/ledger_entry_presenter.rb', line 43

def company_amount
  h.number_to_currency(r.company_amount || 0.00)
end

#consolidated_amountString

Currency-formatted consolidated (USD) amount.

Returns:

  • (String)


49
50
51
# File 'app/presenters/search/ledger_entry_presenter.rb', line 49

def consolidated_amount
  h.number_to_currency(r.consolidated_amount || 0.00)
end

#documentActiveSupport::SafeBuffer?

Link to the source-document (invoice / receipt / payment /
voucher / etc.) for the parent transaction.

Returns:

  • (ActiveSupport::SafeBuffer, nil)


37
38
39
# File 'app/presenters/search/ledger_entry_presenter.rb', line 37

def document
  h.entry_resource_link r.ledger_transaction
end

#le_amountString

Currency-formatted entry amount in the entry currency.

Returns:

  • (String)


30
31
32
# File 'app/presenters/search/ledger_entry_presenter.rb', line 30

def le_amount
  h.number_to_currency(r.le_amount || 0.00)
end

#lt_transaction_dateString

Localized transaction date.

Returns:

  • (String)


24
25
26
# File 'app/presenters/search/ledger_entry_presenter.rb', line 24

def lt_transaction_date
  h.render_date r.lt_transaction_date
end

#lt_transaction_typeString

Short transaction-type code (SO, RE, PAY, …) from
LedgerTransaction::TYPE_ABBREVIATIONS.

Returns:

  • (String)


11
12
13
# File 'app/presenters/search/ledger_entry_presenter.rb', line 11

def lt_transaction_type
  LedgerTransaction::TYPE_ABBREVIATIONS[r.lt_transaction_type] || r_lt_transaction_type
end

#reconciledActiveSupport::SafeBuffer

Y / blank indicator from h.y for the bank-rec flag.

Returns:

  • (ActiveSupport::SafeBuffer)


55
56
57
# File 'app/presenters/search/ledger_entry_presenter.rb', line 55

def reconciled
  h.y r.reconciled
end

Link to the parent LedgerTransaction, labelled with its
transaction number.

Returns:

  • (ActiveSupport::SafeBuffer)


18
19
20
# File 'app/presenters/search/ledger_entry_presenter.rb', line 18

def transaction_number_link
  h.link_to r.lt_transaction_number, h.ledger_transaction_path(r.lt_transaction_id)
end