Class: Search::InvoicePresenter
- Inherits:
-
BasePresenter
show all
- Includes:
- Presenters::Timeable
- Defined in:
- app/presenters/search/invoice_presenter.rb
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#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
#currency_symbol ⇒ Object
10
11
12
|
# File 'app/presenters/search/invoice_presenter.rb', line 10
def currency_symbol
Money::Currency.new(r.currency).symbol
end
|
#currency_symbol_consolidated ⇒ Object
14
15
16
|
# File 'app/presenters/search/invoice_presenter.rb', line 14
def currency_symbol_consolidated
Money::Currency.new(r.consolidated_currency).symbol
end
|
#customer_link ⇒ Object
18
19
20
|
# File 'app/presenters/search/invoice_presenter.rb', line 18
def customer_link
h.link_to(r.customer_name, h.customer_path(r.customer_id))
end
|
#due_date ⇒ Object
46
47
48
|
# File 'app/presenters/search/invoice_presenter.rb', line 46
def due_date
h.render_date r.due_date
end
|
#invoice_link ⇒ Object
6
7
8
|
# File 'app/presenters/search/invoice_presenter.rb', line 6
def invoice_link
h.link_to(r.reference_number, h.invoice_path(r.id))
end
|
#msrp ⇒ Object
26
27
28
|
# File 'app/presenters/search/invoice_presenter.rb', line 26
def msrp
h.number_to_currency(r.line_total_msrp, unit: currency_symbol)
end
|
#opportunity_link ⇒ Object
22
23
24
|
# File 'app/presenters/search/invoice_presenter.rb', line 22
def opportunity_link
h.link_to(r.opportunity_name, h.opportunity_path(r.opportunity_id)) if r.opportunity_id
end
|
#profit_consolidated ⇒ Object
42
43
44
|
# File 'app/presenters/search/invoice_presenter.rb', line 42
def profit_consolidated
h.number_to_currency(r.profit_consolidated, unit: currency_symbol_consolidated)
end
|
#revenue ⇒ Object
30
31
32
|
# File 'app/presenters/search/invoice_presenter.rb', line 30
def revenue
h.number_to_currency(r.line_total, unit: currency_symbol)
end
|
#revenue_consolidated ⇒ Object
38
39
40
|
# File 'app/presenters/search/invoice_presenter.rb', line 38
def revenue_consolidated
h.number_to_currency(r.revenue_consolidated, unit: currency_symbol_consolidated)
end
|
#total ⇒ Object
34
35
36
|
# File 'app/presenters/search/invoice_presenter.rb', line 34
def total
h.number_to_currency(r.total, unit: currency_symbol)
end
|