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)


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

def bank_date
  h.render_date r.bank_date
end

#company_amountString

Currency-formatted company-currency amount.

Returns:

  • (String)


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

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

#consolidated_amountString

Currency-formatted consolidated (USD) amount.

Returns:

  • (String)


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

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)


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

def document
  h.entry_resource_link r.ledger_transaction
end

#le_amountString

Currency-formatted entry amount in the entry currency.

Returns:

  • (String)


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

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

#lt_transaction_dateString

Localized transaction date.

Returns:

  • (String)


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

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)


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

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)


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

def reconciled
  h.y r.reconciled
end

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

Returns:

  • (ActiveSupport::SafeBuffer)


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

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