Class: Search::InvoiceSummaryPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Search::InvoiceSummaryPresenter
- Defined in:
- app/presenters/search/invoice_summary_presenter.rb
Overview
Presenter designed to use in invoice advanced search to render summary in footer
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
#profit_consolidated ⇒ Object
18 19 20 |
# File 'app/presenters/search/invoice_summary_presenter.rb', line 18 def profit_consolidated h.number_to_currency results.to_a.sum{|i| i.profit_consolidated || 0.00 }, unit: 'USD$ ' end |
#revenue ⇒ Object
6 7 8 |
# File 'app/presenters/search/invoice_summary_presenter.rb', line 6 def revenue h.number_to_currency results.to_a.sum{|i| i.line_total || 0.00 } end |
#revenue_consolidated ⇒ Object
14 15 16 |
# File 'app/presenters/search/invoice_summary_presenter.rb', line 14 def revenue_consolidated h.number_to_currency results.to_a.sum{|i| i.revenue_consolidated || 0.00 }, unit: 'USD$ ' end |
#total ⇒ Object
10 11 12 |
# File 'app/presenters/search/invoice_summary_presenter.rb', line 10 def total h.number_to_currency results.to_a.sum{|i| i.total || 0.00 } end |