Class: GOBL::Bill::Invoice

Inherits:
Object show all
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

Method Summary

Methods included from Extensions::Bill::InvoiceHelper

included, #regime

Methods inherited from Object

new

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.

Returns:



49
# File 'lib/generated/gobl/bill/invoice.rb', line 49

property :$addons, [GOBL::CBC::Key]

#$regime($regime) ⇒ GOBL::L10n::TaxCountryCode (readonly)



43
# File 'lib/generated/gobl/bill/invoice.rb', line 43

property :$regime, GOBL::L10n::TaxCountryCode

#$tags($tags) ⇒ Array<GOBL::CBC::Key> (readonly)

Tags are used to help identify specific tax scenarios or requirements that may apply changes to the contents of the document or imply a specific meaning. Converters may use tags to help identify specific situations that do not have a specific extension, for example; self-billed or partial invoices may be identified by their respective tags.

Returns:



54
# File 'lib/generated/gobl/bill/invoice.rb', line 54

property :$tags, [GOBL::CBC::Key]

#attachmentsArray<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.

Returns:



196
# File 'lib/generated/gobl/bill/invoice.rb', line 196

property :attachments, [GOBL::Org::Attachment]

#chargesArray<GOBL::Bill::Charge> (readonly)

Charges or surcharges applied to the complete invoice

Returns:



156
# File 'lib/generated/gobl/bill/invoice.rb', line 156

property :charges, [GOBL::Bill::Charge]

#codeGOBL::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.

Returns:



90
# File 'lib/generated/gobl/bill/invoice.rb', line 90

property :code, GOBL::CBC::Code

#complementsArray<GOBL::Schema::Object> (readonly)

Additional complementary objects that add relevant information to the invoice.

Returns:



186
# File 'lib/generated/gobl/bill/invoice.rb', line 186

property :complements, [GOBL::Schema::Object]

#currencyGOBL::Currency::Code (readonly)

Currency for all invoice amounts and totals, unless explicitly stated otherwise.



115
# File 'lib/generated/gobl/bill/invoice.rb', line 115

property :currency, GOBL::Currency::Code

#customerGOBL::Org::Party (readonly)

Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.

Returns:



141
# File 'lib/generated/gobl/bill/invoice.rb', line 141

property :customer, GOBL::Org::Party

#deliveryGOBL::Bill::DeliveryDetails (readonly)

Specific details on delivery of the goods referenced in the invoice.



171
# File 'lib/generated/gobl/bill/invoice.rb', line 171

property :delivery, GOBL::Bill::DeliveryDetails

#discountsArray<GOBL::Bill::Discount> (readonly)

Discounts or allowances applied to the complete invoice

Returns:



151
# File 'lib/generated/gobl/bill/invoice.rb', line 151

property :discounts, [GOBL::Bill::Discount]

#exchange_ratesArray<GOBL::Currency::ExchangeRate> (readonly)

Exchange rates to be used when converting the invoices monetary values into other currencies.

Returns:



120
# File 'lib/generated/gobl/bill/invoice.rb', line 120

property :exchange_rates, [GOBL::Currency::ExchangeRate]

#issue_dateGOBL::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.

Returns:



95
# File 'lib/generated/gobl/bill/invoice.rb', line 95

property :issue_date, GOBL::Cal::Date

#issue_timeGOBL::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.

Returns:



100
# File 'lib/generated/gobl/bill/invoice.rb', line 100

property :issue_time, GOBL::Cal::Time

#linesArray<GOBL::Bill::Line> (readonly)

List of invoice lines representing each of the items sold to the customer.

Returns:



146
# File 'lib/generated/gobl/bill/invoice.rb', line 146

property :lines, [GOBL::Bill::Line]

#metaGOBL::CBC::Meta (readonly)

Additional semi-structured data that doesn’t fit into the body of the invoice.

Returns:



191
# File 'lib/generated/gobl/bill/invoice.rb', line 191

property :meta, GOBL::CBC::Meta

#notesArray<GOBL::Org::Note> (readonly)

Unstructured information that is relevant to the invoice, such as correction or additional legal details.

Returns:



181
# File 'lib/generated/gobl/bill/invoice.rb', line 181

property :notes, [GOBL::Org::Note]

#op_dateGOBL::Cal::Date (readonly)

Date when the operation defined by the invoice became effective.

Returns:



105
# File 'lib/generated/gobl/bill/invoice.rb', line 105

property :op_date, GOBL::Cal::Date

#orderingGOBL::Bill::Ordering (readonly)

Ordering details including document references and buyer or seller parties.



161
# File 'lib/generated/gobl/bill/invoice.rb', line 161

property :ordering, GOBL::Bill::Ordering

#paymentGOBL::Bill::PaymentDetails (readonly)

Information on when, how, and to whom the invoice should be paid.



166
# File 'lib/generated/gobl/bill/invoice.rb', line 166

property :payment, GOBL::Bill::PaymentDetails

#precedingArray<GOBL::Org::DocumentRef> (readonly)

Document references for previous invoices that this document replaces or extends.

Returns:



125
# File 'lib/generated/gobl/bill/invoice.rb', line 125

property :preceding, [GOBL::Org::DocumentRef]

#seriesGOBL::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.

Returns:



85
# File 'lib/generated/gobl/bill/invoice.rb', line 85

property :series, GOBL::CBC::Code

#supplierGOBL::Org::Party (readonly)

The entity supplying the goods or services and usually responsible for paying taxes.

Returns:



135
# File 'lib/generated/gobl/bill/invoice.rb', line 135

property :supplier, GOBL::Org::Party

#taxGOBL::Bill::Tax (readonly)

Special billing tax configuration options.

Returns:



130
# File 'lib/generated/gobl/bill/invoice.rb', line 130

property :tax, GOBL::Bill::Tax

#totalsGOBL::Bill::Totals (readonly)

Summary of all the invoice totals, including taxes (calculated).

Returns:



176
# File 'lib/generated/gobl/bill/invoice.rb', line 176

property :totals, GOBL::Bill::Totals

#typeGOBL::CBC::Key (readonly)

Type of invoice document. May be restricted by local tax regime requirements.

Returns:



79
# File 'lib/generated/gobl/bill/invoice.rb', line 79

property :type, GOBL::CBC::Key

#uuidString (readonly)

Universally Unique Identifier.

Returns:

  • (String)


59
# File 'lib/generated/gobl/bill/invoice.rb', line 59

property :uuid, String

#value_dateGOBL::Cal::Date (readonly)

When the taxes of this invoice become accountable, if none set, the issue date is used.

Returns:



110
# File 'lib/generated/gobl/bill/invoice.rb', line 110

property :value_date, GOBL::Cal::Date