Class: GOBL::Bill::Invoice
- Includes:
- Extensions::Bill::InvoiceHelper
- Defined in:
- lib/generated/gobl/bill/invoice.rb
Overview
Invoice represents a payment claim for goods or services supplied under conditions agreed between the supplier and the customer.
Constant Summary collapse
- SCHEMA_ID =
The Schema ID of the GOBL Invoice structure
'https://gobl.org/draft-0/bill/invoice'
- TYPE_ENUM =
Enumeration of possible values for #type with their corresponding descriptions
{ 'standard' => 'A regular commercial invoice document between a supplier and customer.', 'proforma' => 'For a clients validation before sending a final invoice.', 'corrective' => 'Corrected invoice that completely *replaces* the preceding document.', 'credit-note' => 'Reflects a refund either partial or complete of the preceding document. A credit note effectively *extends* the previous document.', 'debit-note' => 'An additional set of charges to be added to the preceding document.', 'other' => 'Any other type of invoice that does not fit into the standard categories and implies that any scenarios defined in tax regimes or addons will not be applied. This is useful for being able to create invoices with custom types in extensions, but is not recommend for general use.' }.freeze
Instance Attribute Summary collapse
-
#$addons($addons) ⇒ Array<GOBL::CBC::Key>
readonly
Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.
- #$regime($regime) ⇒ GOBL::L10n::TaxCountryCode readonly
-
#$tags($tags) ⇒ Array<GOBL::CBC::Key>
readonly
Tags are used to help identify specific tax scenarios or requirements that will apply changes to the contents of the invoice.
-
#attachments ⇒ Array<GOBL::Org::Attachment>
readonly
Attachments provide additional information or supporting documents that are not included in the main document.
-
#charges ⇒ Array<GOBL::Bill::Charge>
readonly
Charges or surcharges applied to the complete invoice.
-
#code ⇒ GOBL::CBC::Code
readonly
Code is a sequential identifier that uniquely identifies the invoice.
-
#complements ⇒ Array<GOBL::Schema::Object>
readonly
Additional complementary objects that add relevant information to the invoice.
-
#currency ⇒ GOBL::Currency::Code
readonly
Currency for all invoice amounts and totals, unless explicitly stated otherwise.
-
#customer ⇒ GOBL::Org::Party
readonly
Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
-
#delivery ⇒ GOBL::Bill::DeliveryDetails
readonly
Specific details on delivery of the goods referenced in the invoice.
-
#discounts ⇒ Array<GOBL::Bill::Discount>
readonly
Discounts or allowances applied to the complete invoice.
-
#exchange_rates ⇒ Array<GOBL::Currency::ExchangeRate>
readonly
Exchange rates to be used when converting the invoices monetary values into other currencies.
-
#issue_date ⇒ GOBL::Cal::Date
readonly
Issue date for when the invoice was created and issued.
-
#issue_time ⇒ GOBL::Cal::Time
readonly
IssueTime is an optional field that may be useful to indicate the time of day when the invoice was issued.
-
#lines ⇒ Array<GOBL::Bill::Line>
readonly
List of invoice lines representing each of the items sold to the customer.
-
#meta ⇒ GOBL::CBC::Meta
readonly
Additional semi-structured data that doesn’t fit into the body of the invoice.
-
#notes ⇒ Array<GOBL::Org::Note>
readonly
Unstructured information that is relevant to the invoice, such as correction or additional legal details.
-
#op_date ⇒ GOBL::Cal::Date
readonly
Date when the operation defined by the invoice became effective.
-
#ordering ⇒ GOBL::Bill::Ordering
readonly
Ordering details including document references and buyer or seller parties.
-
#payment ⇒ GOBL::Bill::PaymentDetails
readonly
Information on when, how, and to whom the invoice should be paid.
-
#preceding ⇒ Array<GOBL::Org::DocumentRef>
readonly
Document references for previous invoices that this document replaces or extends.
-
#series ⇒ GOBL::CBC::Code
readonly
Series is used to identify groups of invoices by date, business area, project, type of document, customer type, a combination of any or other company specific data.
-
#supplier ⇒ GOBL::Org::Party
readonly
The entity supplying the goods or services and usually responsible for paying taxes.
-
#tax ⇒ GOBL::Bill::Tax
readonly
Special billing tax configuration options.
-
#totals ⇒ GOBL::Bill::Totals
readonly
Summary of all the invoice totals, including taxes (calculated).
-
#type ⇒ GOBL::CBC::Key
readonly
Type of invoice document.
-
#uuid ⇒ String
readonly
Universally Unique Identifier.
-
#value_date ⇒ GOBL::Cal::Date
readonly
When the taxes of this invoice become accountable, if none set, the issue date is used.
Method Summary
Methods included from Extensions::Bill::InvoiceHelper
Methods inherited from Object
Methods inherited from Struct
#as_json, from_data, from_json!, #to_json
Instance Attribute Details
#$addons($addons) ⇒ Array<GOBL::CBC::Key> (readonly)
Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.
46 |
# File 'lib/generated/gobl/bill/invoice.rb', line 46 property :$addons, [GOBL::CBC::Key] |
#$regime($regime) ⇒ GOBL::L10n::TaxCountryCode (readonly)
40 |
# File 'lib/generated/gobl/bill/invoice.rb', line 40 property :$regime, GOBL::L10n::TaxCountryCode |
#$tags($tags) ⇒ Array<GOBL::CBC::Key> (readonly)
Tags are used to help identify specific tax scenarios or requirements that will apply changes to the contents of the invoice. Tags by design should always be optional, it should always be possible to build a valid invoice without any tags.
51 |
# File 'lib/generated/gobl/bill/invoice.rb', line 51 property :$tags, [GOBL::CBC::Key] |
#attachments ⇒ Array<GOBL::Org::Attachment> (readonly)
Attachments provide additional information or supporting documents that are not included in the main document. It is important that attachments are not used for alternative versions of the PDF, for that, see “links” inside the envelope headers.
193 |
# File 'lib/generated/gobl/bill/invoice.rb', line 193 property :attachments, [GOBL::Org::Attachment] |
#charges ⇒ Array<GOBL::Bill::Charge> (readonly)
Charges or surcharges applied to the complete invoice
153 |
# File 'lib/generated/gobl/bill/invoice.rb', line 153 property :charges, [GOBL::Bill::Charge] |
#code ⇒ GOBL::CBC::Code (readonly)
Code is a sequential identifier that uniquely identifies the invoice. The code can be left empty initially, but is required to sign the invoice.
87 |
# File 'lib/generated/gobl/bill/invoice.rb', line 87 property :code, GOBL::CBC::Code |
#complements ⇒ Array<GOBL::Schema::Object> (readonly)
Additional complementary objects that add relevant information to the invoice.
183 |
# File 'lib/generated/gobl/bill/invoice.rb', line 183 property :complements, [GOBL::Schema::Object] |
#currency ⇒ GOBL::Currency::Code (readonly)
Currency for all invoice amounts and totals, unless explicitly stated otherwise.
112 |
# File 'lib/generated/gobl/bill/invoice.rb', line 112 property :currency, GOBL::Currency::Code |
#customer ⇒ GOBL::Org::Party (readonly)
Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
138 |
# File 'lib/generated/gobl/bill/invoice.rb', line 138 property :customer, GOBL::Org::Party |
#delivery ⇒ GOBL::Bill::DeliveryDetails (readonly)
Specific details on delivery of the goods referenced in the invoice.
168 |
# File 'lib/generated/gobl/bill/invoice.rb', line 168 property :delivery, GOBL::Bill::DeliveryDetails |
#discounts ⇒ Array<GOBL::Bill::Discount> (readonly)
Discounts or allowances applied to the complete invoice
148 |
# File 'lib/generated/gobl/bill/invoice.rb', line 148 property :discounts, [GOBL::Bill::Discount] |
#exchange_rates ⇒ Array<GOBL::Currency::ExchangeRate> (readonly)
Exchange rates to be used when converting the invoices monetary values into other currencies.
117 |
# File 'lib/generated/gobl/bill/invoice.rb', line 117 property :exchange_rates, [GOBL::Currency::ExchangeRate] |
#issue_date ⇒ GOBL::Cal::Date (readonly)
Issue date for when the invoice was created and issued. Todays date is used if none is set. There are often legal restrictions on how far back or in the future an invoice can be issued.
92 |
# File 'lib/generated/gobl/bill/invoice.rb', line 92 property :issue_date, GOBL::Cal::Date |
#issue_time ⇒ GOBL::Cal::Time (readonly)
IssueTime is an optional field that may be useful to indicate the time of day when the invoice was issued. Some regions and formats may require this field to be set. An empty string will be automatically updated to reflect the current time, otherwise the field can be left with a nil value.
97 |
# File 'lib/generated/gobl/bill/invoice.rb', line 97 property :issue_time, GOBL::Cal::Time |
#lines ⇒ Array<GOBL::Bill::Line> (readonly)
List of invoice lines representing each of the items sold to the customer.
143 |
# File 'lib/generated/gobl/bill/invoice.rb', line 143 property :lines, [GOBL::Bill::Line] |
#meta ⇒ GOBL::CBC::Meta (readonly)
Additional semi-structured data that doesn’t fit into the body of the invoice.
188 |
# File 'lib/generated/gobl/bill/invoice.rb', line 188 property :meta, GOBL::CBC::Meta |
#notes ⇒ Array<GOBL::Org::Note> (readonly)
Unstructured information that is relevant to the invoice, such as correction or additional legal details.
178 |
# File 'lib/generated/gobl/bill/invoice.rb', line 178 property :notes, [GOBL::Org::Note] |
#op_date ⇒ GOBL::Cal::Date (readonly)
Date when the operation defined by the invoice became effective.
102 |
# File 'lib/generated/gobl/bill/invoice.rb', line 102 property :op_date, GOBL::Cal::Date |
#ordering ⇒ GOBL::Bill::Ordering (readonly)
Ordering details including document references and buyer or seller parties.
158 |
# File 'lib/generated/gobl/bill/invoice.rb', line 158 property :ordering, GOBL::Bill::Ordering |
#payment ⇒ GOBL::Bill::PaymentDetails (readonly)
Information on when, how, and to whom the invoice should be paid.
163 |
# File 'lib/generated/gobl/bill/invoice.rb', line 163 property :payment, GOBL::Bill::PaymentDetails |
#preceding ⇒ Array<GOBL::Org::DocumentRef> (readonly)
Document references for previous invoices that this document replaces or extends.
122 |
# File 'lib/generated/gobl/bill/invoice.rb', line 122 property :preceding, [GOBL::Org::DocumentRef] |
#series ⇒ GOBL::CBC::Code (readonly)
Series is used to identify groups of invoices by date, business area, project, type of document, customer type, a combination of any or other company specific data. If the output format does not support the series as a separate field, it will be prepended to the code for presentation with a dash (‘-`) for separation.
82 |
# File 'lib/generated/gobl/bill/invoice.rb', line 82 property :series, GOBL::CBC::Code |
#supplier ⇒ GOBL::Org::Party (readonly)
The entity supplying the goods or services and usually responsible for paying taxes.
132 |
# File 'lib/generated/gobl/bill/invoice.rb', line 132 property :supplier, GOBL::Org::Party |
#tax ⇒ GOBL::Bill::Tax (readonly)
Special billing tax configuration options.
127 |
# File 'lib/generated/gobl/bill/invoice.rb', line 127 property :tax, GOBL::Bill::Tax |
#totals ⇒ GOBL::Bill::Totals (readonly)
Summary of all the invoice totals, including taxes (calculated).
173 |
# File 'lib/generated/gobl/bill/invoice.rb', line 173 property :totals, GOBL::Bill::Totals |
#type ⇒ GOBL::CBC::Key (readonly)
Type of invoice document. May be restricted by local tax regime requirements.
76 |
# File 'lib/generated/gobl/bill/invoice.rb', line 76 property :type, GOBL::CBC::Key |
#uuid ⇒ String (readonly)
Universally Unique Identifier.
56 |
# File 'lib/generated/gobl/bill/invoice.rb', line 56 property :uuid, String |
#value_date ⇒ GOBL::Cal::Date (readonly)
When the taxes of this invoice become accountable, if none set, the issue date is used.
107 |
# File 'lib/generated/gobl/bill/invoice.rb', line 107 property :value_date, GOBL::Cal::Date |