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.
61 62 63 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 61 def bank_date h.render_date r.bank_date end |
#company_amount ⇒ String
Currency-formatted company-currency amount.
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_amount ⇒ String
Currency-formatted consolidated (USD) amount.
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 |
#document ⇒ ActiveSupport::SafeBuffer?
Link to the source-document (invoice / receipt / payment /
voucher / etc.) for the parent transaction.
37 38 39 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 37 def document h.entry_resource_link r.ledger_transaction end |
#le_amount ⇒ String
Currency-formatted entry amount in the entry currency.
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_date ⇒ String
Localized transaction date.
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_type ⇒ String
Short transaction-type code (SO, RE, PAY, …) from
LedgerTransaction::TYPE_ABBREVIATIONS.
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 |
#reconciled ⇒ ActiveSupport::SafeBuffer
Y / blank indicator from h.y for the bank-rec flag.
55 56 57 |
# File 'app/presenters/search/ledger_entry_presenter.rb', line 55 def reconciled h.y r.reconciled end |
#transaction_number_link ⇒ ActiveSupport::SafeBuffer
Link to the parent LedgerTransaction, labelled with its
transaction number.
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 |