Class: Search::LedgerEntryPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Search::LedgerEntryPresenter
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/ledger_entry_presenter.rb
Overview
Presenter: ledger entry presenter.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BasePresenter
#current_account, #options, #url_helper
Instance Method Summary collapse
-
#bank_date ⇒ String
Localized bank-rec date.
-
#company_amount ⇒ String
Currency-formatted company-currency amount.
-
#consolidated_amount ⇒ String
Currency-formatted consolidated (USD) amount.
-
#document ⇒ ActiveSupport::SafeBuffer?
Link to the source-document (invoice / receipt / payment / voucher / etc.) for the parent transaction.
-
#le_amount ⇒ String
Currency-formatted entry amount in the entry currency.
-
#lt_transaction_date ⇒ String
Localized transaction date.
-
#lt_transaction_type ⇒ String
Short transaction-type code (
SO,RE,PAY, …) from LedgerTransaction::TYPE_ABBREVIATIONS. -
#reconciled ⇒ ActiveSupport::SafeBuffer
Y/ blank indicator fromh.yfor the bank-rec flag. -
#transaction_number_link ⇒ ActiveSupport::SafeBuffer
Link to the parent LedgerTransaction, labelled with its transaction number.
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_date ⇒ String
Localized bank-rec date.
62 63 64 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 62 def bank_date h.render_date r.bank_date end |
#company_amount ⇒ String
Currency-formatted company-currency amount.
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_amount ⇒ String
Currency-formatted consolidated (USD) amount.
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 |
#document ⇒ ActiveSupport::SafeBuffer?
Link to the source-document (invoice / receipt / payment /
voucher / etc.) for the parent transaction.
38 39 40 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 38 def document h.entry_resource_link r.ledger_transaction end |
#le_amount ⇒ String
Currency-formatted entry amount in the entry currency.
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_date ⇒ String
Localized transaction date.
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_type ⇒ String
Short transaction-type code (SO, RE, PAY, …) from
LedgerTransaction::TYPE_ABBREVIATIONS.
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 |
#reconciled ⇒ ActiveSupport::SafeBuffer
Y / blank indicator from h.y for the bank-rec flag.
56 57 58 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 56 def reconciled h.y r.reconciled end |
#transaction_number_link ⇒ ActiveSupport::SafeBuffer
Link to the parent LedgerTransaction, labelled with its
transaction number.
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 |