Class: AdvancedBilling::InvoiceConsolidationLevel
- Inherits:
-
Object
- Object
- AdvancedBilling::InvoiceConsolidationLevel
- Defined in:
- lib/advanced_billing/models/invoice_consolidation_level.rb
Overview
Consolidation level of the invoice, which is applicable to invoice consolidation. It will hold one of the following values: * “none”: A normal invoice with no consolidation. * “child”: An invoice segment which has been combined into a consolidated invoice. * “parent”: A consolidated invoice, whose contents are composed of invoice segments. “Parent” invoices do not have lines of their own, but they have subtotals and totals which aggregate the member invoice segments. See also the [invoice consolidation documentation](maxio.zendesk.com/hc/en-us/articles/24252269909389-In voice-Consolidation).
Constant Summary collapse
- INVOICE_CONSOLIDATION_LEVEL =
[ # TODO: Write general description for NONE NONE = 'none'.freeze, # TODO: Write general description for CHILD CHILD = 'child'.freeze, # TODO: Write general description for PARENT PARENT = 'parent'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = NONE) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/invoice_consolidation_level.rb', line 34 def self.from_value(value, default_value = NONE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'none' then NONE when 'child' then CHILD when 'parent' then PARENT else default_value end end |
.validate(value) ⇒ Object
28 29 30 31 32 |
# File 'lib/advanced_billing/models/invoice_consolidation_level.rb', line 28 def self.validate(value) return false if value.nil? INVOICE_CONSOLIDATION_LEVEL.include?(value) end |