Class: Search::InvoicePresenter

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

Direct Known Subclasses

InvoiceTextPresenter

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

#currency_symbolObject



10
11
12
# File 'app/presenters/search/invoice_presenter.rb', line 10

def currency_symbol
  Money::Currency.new(r.currency).symbol
end

#currency_symbol_consolidatedObject



14
15
16
# File 'app/presenters/search/invoice_presenter.rb', line 14

def currency_symbol_consolidated
  Money::Currency.new(r.consolidated_currency).symbol
end


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_dateObject



46
47
48
# File 'app/presenters/search/invoice_presenter.rb', line 46

def due_date
  h.render_date r.due_date
end


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

#msrpObject



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


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_consolidatedObject



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

#revenueObject



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_consolidatedObject



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

#totalObject



34
35
36
# File 'app/presenters/search/invoice_presenter.rb', line 34

def total
  h.number_to_currency(r.total, unit: currency_symbol)
end