Class: Activity::ResourceList::InvoiceFormatter
- Inherits:
-
BaseFormatter
- Object
- SimpleDelegator
- BaseFormatter
- Activity::ResourceList::InvoiceFormatter
- Defined in:
- app/services/activity/resource_list.rb
Overview
Service object: invoice formatter.
Instance Attribute Summary
Attributes inherited from BaseFormatter
Instance Method Summary collapse
-
#display ⇒ String
Option label: reference, state, total, and GL date.
-
#total ⇒ String
Formatted invoice total.
Methods inherited from BaseFormatter
#created_at, #identifier, #initialize, #state
Constructor Details
This class inherits a constructor from Activity::ResourceList::BaseFormatter
Instance Method Details
#display ⇒ String
Option label: reference, state, total, and GL date.
352 353 354 |
# File 'app/services/activity/resource_list.rb', line 352 def display [reference_number, state, total, gl_date.to_fs(:crm_date_only)].compact.join(' - ') end |
#total ⇒ String
Formatted invoice total.
358 359 360 |
# File 'app/services/activity/resource_list.rb', line 358 def total Money.new((record.total || 0) * 100, record.currency).format end |