gobl 0.21.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/ae.json +173 -0
  3. data/data/regimes/at.json +56 -50
  4. data/data/regimes/be.json +56 -50
  5. data/data/regimes/br.json +135 -0
  6. data/data/regimes/ca.json +2 -1
  7. data/data/regimes/ch.json +56 -50
  8. data/data/regimes/co.json +34 -203
  9. data/data/regimes/de.json +74 -47
  10. data/data/regimes/el.json +211 -0
  11. data/data/regimes/es.json +69 -550
  12. data/data/regimes/fr.json +56 -50
  13. data/data/regimes/gb.json +60 -50
  14. data/data/regimes/in.json +128 -0
  15. data/data/regimes/it.json +48 -1311
  16. data/data/regimes/mx.json +39 -639
  17. data/data/regimes/nl.json +56 -50
  18. data/data/regimes/pl.json +101 -97
  19. data/data/regimes/pt.json +1459 -227
  20. data/data/regimes/us.json +55 -50
  21. data/lib/generated/gobl/bill/charge.rb +34 -19
  22. data/lib/generated/gobl/bill/correction_options.rb +8 -3
  23. data/lib/generated/gobl/bill/delivery.rb +184 -16
  24. data/lib/generated/gobl/bill/delivery_details.rb +41 -0
  25. data/lib/generated/gobl/bill/discount.rb +36 -13
  26. data/lib/generated/gobl/bill/invoice.rb +88 -41
  27. data/lib/generated/gobl/bill/line.rb +39 -4
  28. data/lib/generated/gobl/bill/line_charge.rb +56 -11
  29. data/lib/generated/gobl/bill/line_discount.rb +45 -12
  30. data/lib/generated/gobl/bill/order.rb +208 -0
  31. data/lib/generated/gobl/bill/ordering.rb +40 -35
  32. data/lib/generated/gobl/bill/payment.rb +155 -15
  33. data/lib/generated/gobl/bill/payment_details.rb +36 -0
  34. data/lib/generated/gobl/bill/payment_line.rb +77 -0
  35. data/lib/generated/gobl/bill/sub_line.rb +83 -0
  36. data/lib/generated/gobl/bill/tax.rb +19 -5
  37. data/lib/generated/gobl/bill/totals.rb +18 -18
  38. data/lib/generated/gobl/bill/tracking.rb +26 -0
  39. data/lib/generated/gobl/cal/date_time.rb +1 -1
  40. data/lib/generated/gobl/cal/time.rb +16 -0
  41. data/lib/generated/gobl/cbc/code.rb +2 -1
  42. data/lib/generated/gobl/cbc/{key_definition.rb → definition.rb} +18 -14
  43. data/lib/generated/gobl/cbc/source.rb +37 -0
  44. data/lib/generated/gobl/currency/code.rb +16 -16
  45. data/lib/generated/gobl/currency/exchange_rate.rb +10 -5
  46. data/lib/generated/gobl/head/header.rb +5 -5
  47. data/lib/generated/gobl/head/link.rb +43 -0
  48. data/lib/generated/gobl/l10n/{country_code.rb → iso_country_code.rb} +3 -3
  49. data/lib/generated/gobl/l10n/tax_country_code.rb +277 -0
  50. data/lib/generated/gobl/org/address.rb +11 -7
  51. data/lib/generated/gobl/org/attachment.rb +62 -0
  52. data/lib/generated/gobl/org/document_ref.rb +102 -0
  53. data/lib/generated/gobl/org/identity.rb +11 -1
  54. data/lib/generated/gobl/org/inbox.rb +22 -14
  55. data/lib/generated/gobl/org/item.rb +4 -5
  56. data/lib/generated/gobl/org/name.rb +0 -2
  57. data/lib/generated/gobl/{cbc → org}/note.rb +16 -5
  58. data/lib/generated/gobl/org/party.rb +9 -6
  59. data/lib/generated/gobl/org/person.rb +5 -0
  60. data/lib/generated/gobl/org/registration.rb +4 -0
  61. data/lib/generated/gobl/org/telephone.rb +1 -1
  62. data/lib/generated/gobl/org/unit.rb +2 -1
  63. data/lib/generated/gobl/pay/advance.rb +8 -1
  64. data/lib/generated/gobl/pay/card.rb +5 -2
  65. data/lib/generated/gobl/pay/instructions.rb +10 -3
  66. data/lib/generated/gobl/pay/terms.rb +7 -2
  67. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
  68. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
  69. data/lib/generated/gobl/tax/addon_def.rb +76 -0
  70. data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
  71. data/lib/generated/gobl/tax/{category.rb → category_def.rb} +14 -14
  72. data/lib/generated/gobl/tax/combo.rb +5 -0
  73. data/lib/generated/gobl/tax/correction_definition.rb +6 -1
  74. data/lib/generated/gobl/tax/correction_set.rb +13 -0
  75. data/lib/generated/gobl/tax/identity.rb +8 -3
  76. data/lib/generated/gobl/tax/{rate.rb → rate_def.rb} +11 -16
  77. data/lib/generated/gobl/tax/rate_total.rb +5 -0
  78. data/lib/generated/gobl/tax/{rate_value.rb → rate_value_def.rb} +4 -4
  79. data/lib/generated/gobl/tax/{regime.rb → regime_def.rb} +38 -33
  80. data/lib/generated/gobl/tax/scenario.rb +22 -12
  81. data/lib/generated/gobl/tax/scenario_note.rb +42 -0
  82. data/lib/generated/gobl/tax/scenario_set.rb +1 -1
  83. data/lib/generated/gobl/tax/tag_set.rb +28 -0
  84. data/lib/generated/gobl/tax/total.rb +6 -1
  85. data/lib/gobl/extensions/bill/invoice_helper.rb +6 -36
  86. data/lib/gobl/extensions/envelope_helper.rb +4 -0
  87. data/lib/gobl/version.rb +1 -1
  88. data/lib/gobl.rb +3 -2
  89. metadata +36 -21
  90. data/lib/generated/gobl/bill/document_reference.rb +0 -36
  91. data/lib/generated/gobl/bill/outlay.rb +0 -58
  92. data/lib/generated/gobl/bill/preceding.rb +0 -78
  93. data/lib/generated/gobl/cbc/code_definition.rb +0 -37
  94. data/lib/generated/gobl/tax/source.rb +0 -27
  95. data/lib/gobl/extensions/bill/scenario_summary.rb +0 -25
data/data/regimes/us.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://gobl.org/draft-0/tax/regime",
2
+ "$schema": "https://gobl.org/draft-0/tax/regime-def",
3
3
  "name": {
4
4
  "en": "United States of America"
5
5
  },
@@ -8,55 +8,60 @@
8
8
  "currency": "USD",
9
9
  "tags": [
10
10
  {
11
- "key": "simplified",
12
- "name": {
13
- "de": "Vereinfachte Rechnung",
14
- "en": "Simplified Invoice",
15
- "es": "Factura Simplificada",
16
- "it": "Fattura Semplificata"
17
- },
18
- "desc": {
19
- "de": "Wird für B2C-Transaktionen verwendet, wenn die Kundendaten nicht verfügbar sind. Bitte wenden Sie sich an die örtlichen Behörden, um die Grenzwerte zu ermitteln.",
20
- "en": "Used for B2C transactions when the client details are not available, check with local authorities for limits.",
21
- "es": "Usado para transacciones B2C cuando los detalles del cliente no están disponibles, consulte con las autoridades locales para los límites.",
22
- "it": "Utilizzato per le transazioni B2C quando i dettagli del cliente non sono disponibili, controllare con le autorità locali per i limiti."
23
- }
24
- },
25
- {
26
- "key": "reverse-charge",
27
- "name": {
28
- "de": "Umkehr der Steuerschuld",
29
- "en": "Reverse Charge",
30
- "es": "Inversión del Sujeto Pasivo",
31
- "it": "Inversione del soggetto passivo"
32
- }
33
- },
34
- {
35
- "key": "self-billed",
36
- "name": {
37
- "de": "Rechnung durch den Leistungsempfänger",
38
- "en": "Self-billed",
39
- "es": "Facturación por el destinatario",
40
- "it": "Autofattura"
41
- }
42
- },
43
- {
44
- "key": "customer-rates",
45
- "name": {
46
- "de": "Kundensätze",
47
- "en": "Customer rates",
48
- "es": "Tarifas aplicables al destinatario",
49
- "it": "Aliquote applicabili al destinatario"
50
- }
51
- },
52
- {
53
- "key": "partial",
54
- "name": {
55
- "de": "Teilweise",
56
- "en": "Partial",
57
- "es": "Parcial",
58
- "it": "Parziale"
59
- }
11
+ "schema": "bill/invoice",
12
+ "list": [
13
+ {
14
+ "key": "simplified",
15
+ "name": {
16
+ "de": "Vereinfachte Rechnung",
17
+ "en": "Simplified Invoice",
18
+ "es": "Factura Simplificada",
19
+ "it": "Fattura Semplificata"
20
+ },
21
+ "desc": {
22
+ "de": "Wird für B2C-Transaktionen verwendet, wenn die Kundendaten nicht verfügbar sind. Bitte wenden Sie sich an die örtlichen Behörden, um die Grenzwerte zu ermitteln.",
23
+ "en": "Used for B2C transactions when the client details are not available, check with local authorities for limits.",
24
+ "es": "Usado para transacciones B2C cuando los detalles del cliente no están disponibles, consulte con las autoridades locales para los límites.",
25
+ "it": "Utilizzato per le transazioni B2C quando i dettagli del cliente non sono disponibili, controllare con le autorità locali per i limiti."
26
+ }
27
+ },
28
+ {
29
+ "key": "reverse-charge",
30
+ "name": {
31
+ "de": "Umkehr der Steuerschuld",
32
+ "en": "Reverse Charge",
33
+ "es": "Inversión del Sujeto Pasivo",
34
+ "it": "Inversione del soggetto passivo"
35
+ }
36
+ },
37
+ {
38
+ "key": "self-billed",
39
+ "name": {
40
+ "de": "Rechnung durch den Leistungsempfänger",
41
+ "en": "Self-billed",
42
+ "es": "Facturación por el destinatario",
43
+ "it": "Autofattura"
44
+ }
45
+ },
46
+ {
47
+ "key": "customer-rates",
48
+ "name": {
49
+ "de": "Kundensätze",
50
+ "en": "Customer rates",
51
+ "es": "Tarifas aplicables al destinatario",
52
+ "it": "Aliquote applicabili al destinatario"
53
+ }
54
+ },
55
+ {
56
+ "key": "partial",
57
+ "name": {
58
+ "de": "Teilweise",
59
+ "en": "Partial",
60
+ "es": "Parcial",
61
+ "it": "Parziale"
62
+ }
63
+ }
64
+ ]
60
65
  }
61
66
  ],
62
67
  "corrections": [
@@ -10,27 +10,47 @@ module GOBL
10
10
  # Charge represents a surchange applied to the complete document independent from the individual lines.
11
11
  class Charge < GOBL::Object
12
12
  # The Schema ID of the GOBL Charge structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Charge'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/charge'
14
14
 
15
15
  # @!attribute [r] uuid
16
16
  # Universally Unique Identifier.
17
17
  # @return [String]
18
18
  property :uuid, String
19
19
 
20
- # @!attribute [r] key
21
- # Key for grouping or identifying charges for tax purposes.
22
- # @return [GOBL::CBC::Key]
23
- property :key, GOBL::CBC::Key
24
-
25
20
  # @!attribute [r] i
26
21
  # Line number inside the list of charges (calculated).
27
22
  # @return [Integer]
28
23
  property :i, Integer
29
24
 
30
- # @!attribute [r] ref
31
- # Code to used to refer to the this charge
25
+ # Enumeration of possible values for {#key} with their corresponding descriptions
26
+ KEY_ENUM = {
27
+ 'stamp-duty' => 'Stamp Duty',
28
+ 'outlay' => 'Outlay',
29
+ 'tax' => 'Tax',
30
+ 'customs' => 'Customs',
31
+ 'delivery' => 'Delivery',
32
+ 'packing' => 'Packing',
33
+ 'handling' => 'Handling',
34
+ 'insurance' => 'Insurance',
35
+ 'storage' => 'Storage',
36
+ 'admin' => 'Administration',
37
+ 'cleaning' => 'Cleaning'
38
+ }.freeze
39
+
40
+ # @!attribute [r] key
41
+ # Key for grouping or identifying charges for tax purposes. A suggested list of keys is provided, but these may be extended by the issuer.
42
+ # @return [GOBL::CBC::Key]
43
+ property :key, GOBL::CBC::Key
44
+
45
+ # @!attribute [r] code
46
+ # Code to used to refer to the this charge by the issuer
47
+ # @return [GOBL::CBC::Code]
48
+ property :code, GOBL::CBC::Code
49
+
50
+ # @!attribute [r] reason
51
+ # Text description as to why the charge was applied
32
52
  # @return [String]
33
- property :ref, String
53
+ property :reason, String
34
54
 
35
55
  # @!attribute [r] base
36
56
  # Base represents the value used as a base for percent calculations instead of the invoice's sum of lines.
@@ -38,7 +58,7 @@ module GOBL
38
58
  property :base, GOBL::Num::Amount
39
59
 
40
60
  # @!attribute [r] percent
41
- # Percentage to apply to the Base or Invoice Sum
61
+ # Percentage to apply to the sum of all lines
42
62
  # @return [GOBL::Num::Percentage]
43
63
  property :percent, GOBL::Num::Percentage
44
64
 
@@ -52,15 +72,10 @@ module GOBL
52
72
  # @return [GOBL::Tax::Set]
53
73
  property :taxes, GOBL::Tax::Set
54
74
 
55
- # @!attribute [r] code
56
- # Code for why was this charge applied?
57
- # @return [String]
58
- property :code, String
59
-
60
- # @!attribute [r] reason
61
- # Text description as to why the charge was applied
62
- # @return [String]
63
- property :reason, String
75
+ # @!attribute [r] ext
76
+ # Extension codes that apply to the charge
77
+ # @return [GOBL::Tax::Extensions]
78
+ property :ext, GOBL::Tax::Extensions
64
79
 
65
80
  # @!attribute [r] meta
66
81
  # Additional semi-structured information.
@@ -25,8 +25,8 @@ module GOBL
25
25
 
26
26
  # @!attribute [r] series
27
27
  # Series to assign to the new corrective invoice.
28
- # @return [String]
29
- property :series, String
28
+ # @return [GOBL::CBC::Code]
29
+ property :series, GOBL::CBC::Code
30
30
 
31
31
  # @!attribute [r] stamps
32
32
  # Stamps of the previous document to include in the preceding data.
@@ -39,9 +39,14 @@ module GOBL
39
39
  property :reason, String
40
40
 
41
41
  # @!attribute [r] ext
42
- # Extensions for region specific requirements.
42
+ # Extensions for region specific requirements that may be added in the preceding or at the document level, according to the local rules.
43
43
  # @return [GOBL::Tax::Extensions]
44
44
  property :ext, GOBL::Tax::Extensions
45
+
46
+ # @!attribute [r] copy_tax
47
+ # CopyTax when true will copy the tax totals from the previous document to the preceding document data.
48
+ # @return [Boolean]
49
+ property :copy_tax, Boolean
45
50
  end
46
51
  end
47
52
  end
@@ -7,35 +7,203 @@
7
7
 
8
8
  module GOBL
9
9
  module Bill
10
- # Delivery covers the details of the destination for the products described in the invoice body.
10
+ # Delivery document used to describe the delivery of goods or potentially also services.
11
11
  class Delivery < GOBL::Object
12
12
  # The Schema ID of the GOBL Delivery structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Delivery'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/delivery'
14
+
15
+ # Enumeration of possible values for {#$regime} with their corresponding descriptions
16
+ $REGIME_ENUM = {
17
+ 'AE' => 'United Arab Emirates',
18
+ 'AT' => 'Austria',
19
+ 'BE' => 'Belgium',
20
+ 'BR' => 'Brazil',
21
+ 'CA' => 'Canada',
22
+ 'CH' => 'Switzerland',
23
+ 'CO' => 'Colombia',
24
+ 'DE' => 'Germany',
25
+ 'EL' => 'Greece',
26
+ 'ES' => 'Spain',
27
+ 'FR' => 'France',
28
+ 'GB' => 'United Kingdom',
29
+ 'IN' => 'India',
30
+ 'IT' => 'Italy',
31
+ 'MX' => 'Mexico',
32
+ 'NL' => 'The Netherlands',
33
+ 'PL' => 'Poland',
34
+ 'PT' => 'Portugal',
35
+ 'US' => 'United States of America'
36
+ }.freeze
37
+
38
+ # @!attribute [r] $regime
39
+ # @return [GOBL::L10n::TaxCountryCode]
40
+ property :$regime, GOBL::L10n::TaxCountryCode
41
+ validates_inclusion_of :$regime, in: $REGIME_ENUM.keys, allow_blank: true
42
+
43
+ # @!attribute [r] $addons
44
+ # Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.
45
+ # @return [Array<GOBL::CBC::Key>]
46
+ property :$addons, [GOBL::CBC::Key]
47
+
48
+ # @!attribute [r] $tags
49
+ # 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.
50
+ # @return [Array<GOBL::CBC::Key>]
51
+ property :$tags, [GOBL::CBC::Key]
52
+
53
+ # @!attribute [r] uuid
54
+ # Universally Unique Identifier.
55
+ # @return [String]
56
+ property :uuid, String
57
+
58
+ # Enumeration of possible values for {#type} with their corresponding descriptions
59
+ TYPE_ENUM = {
60
+ 'advice' => 'A delivery or despatch advice document send by the supplier to indicate how
61
+ an order is to be delivered.',
62
+ 'note' => 'A delivery note is a document accompanying a shipment of goods that lists the
63
+ items included in the shipment.',
64
+ 'waybill' => 'A waybill is a document issued by a carrier giving details and instructions
65
+ relating to the shipment of a consignment of goods.',
66
+ 'receipt' => 'A delivery receipt is a document that is signed by the person who receives
67
+ goods to confirm that they have been received.'
68
+ }.freeze
69
+
70
+ # @!attribute [r] type
71
+ # Type of delivery document.
72
+ # @return [GOBL::CBC::Key]
73
+ property :type, GOBL::CBC::Key
74
+ validates_presence_of :type
75
+ validates_inclusion_of :type, in: TYPE_ENUM.keys
76
+
77
+ # @!attribute [r] series
78
+ # Series is used to identify groups of deliveries by date, business area, project, type, customer, 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.
79
+ # @return [GOBL::CBC::Code]
80
+ property :series, GOBL::CBC::Code
81
+
82
+ # @!attribute [r] code
83
+ # Code is a sequential identifier that uniquely identifies the delivery. The code can be left empty initially, but is **required** to **sign** the document.
84
+ # @return [GOBL::CBC::Code]
85
+ property :code, GOBL::CBC::Code
86
+
87
+ # @!attribute [r] issue_date
88
+ # When the delivery document is to be issued.
89
+ # @return [GOBL::Cal::Date]
90
+ property :issue_date, GOBL::Cal::Date
91
+
92
+ # @!attribute [r] issue_time
93
+ # IssueTime is an optional field that may be useful to indicate the time of day when the delivery 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.
94
+ # @return [GOBL::Cal::Time]
95
+ property :issue_time, GOBL::Cal::Time
96
+
97
+ # @!attribute [r] value_date
98
+ # When the taxes of this delivery become accountable, if none set, the issue date is used.
99
+ # @return [GOBL::Cal::Date]
100
+ property :value_date, GOBL::Cal::Date
101
+
102
+ # @!attribute [r] currency
103
+ # Currency for all delivery totals.
104
+ # @return [GOBL::Currency::Code]
105
+ property :currency, GOBL::Currency::Code
106
+
107
+ # @!attribute [r] exchange_rates
108
+ # Exchange rates to be used when converting the invoices monetary values into other currencies.
109
+ # @return [Array<GOBL::Currency::ExchangeRate>]
110
+ property :exchange_rates, [GOBL::Currency::ExchangeRate]
111
+
112
+ # @!attribute [r] ordering
113
+ # Ordering details for the delivery, including links to other documents.
114
+ # @return [GOBL::Bill::Ordering]
115
+ property :ordering, GOBL::Bill::Ordering
116
+
117
+ # @!attribute [r] preceding
118
+ # Key information regarding previous delivery documents that this one will either extend or replace.
119
+ # @return [Array<GOBL::Org::DocumentRef>]
120
+ property :preceding, [GOBL::Org::DocumentRef]
121
+
122
+ # @!attribute [r] tracking
123
+ # Tracking is used to define specific codes or IDs that may be used to identify and track delivery.
124
+ # @return [Tracking]
125
+ property :tracking, Tracking
126
+
127
+ # @!attribute [r] despatch_date
128
+ # DespatchDate is the date when the goods are expected to be despatched.
129
+ # @return [GOBL::Cal::Date]
130
+ property :despatch_date, GOBL::Cal::Date
131
+
132
+ # @!attribute [r] receive_date
133
+ # ReceiveDate is the date when the goods are expected to be received.
134
+ # @return [GOBL::Cal::Date]
135
+ property :receive_date, GOBL::Cal::Date
136
+
137
+ # @!attribute [r] tax
138
+ # Special tax configuration for calculating totals.
139
+ # @return [GOBL::Bill::Tax]
140
+ property :tax, GOBL::Bill::Tax
141
+
142
+ # @!attribute [r] supplier
143
+ # The entity supplying the goods or services and usually responsible for paying taxes.
144
+ # @return [GOBL::Org::Party]
145
+ property :supplier, GOBL::Org::Party
146
+ validates_presence_of :supplier
147
+
148
+ # @!attribute [r] customer
149
+ # Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
150
+ # @return [GOBL::Org::Party]
151
+ property :customer, GOBL::Org::Party
152
+
153
+ # @!attribute [r] despatcher
154
+ # The party who will despatch the goods defined in the invoice.
155
+ # @return [GOBL::Org::Party]
156
+ property :despatcher, GOBL::Org::Party
14
157
 
15
158
  # @!attribute [r] receiver
16
- # The party who will receive delivery of the goods defined in the invoice and is not responsible for taxes.
159
+ # The party who will receive delivery of the goods defined in the invoice.
17
160
  # @return [GOBL::Org::Party]
18
161
  property :receiver, GOBL::Org::Party
19
162
 
20
- # @!attribute [r] identities
21
- # Identities is used to define specific codes or IDs that may be used to identify the delivery.
22
- # @return [Array<GOBL::Org::Identity>]
23
- property :identities, [GOBL::Org::Identity]
163
+ # @!attribute [r] courier
164
+ # The courier responsible for delivering the goods.
165
+ # @return [GOBL::Org::Party]
166
+ property :courier, GOBL::Org::Party
24
167
 
25
- # @!attribute [r] date
26
- # When the goods should be expected.
27
- # @return [GOBL::Cal::Date]
28
- property :date, GOBL::Cal::Date
168
+ # @!attribute [r] lines
169
+ # List of lines representing each of the items to be ordered.
170
+ # @return [Array<GOBL::Bill::Line>]
171
+ property :lines, [GOBL::Bill::Line]
172
+
173
+ # @!attribute [r] discounts
174
+ # Discounts or allowances applied to order totals
175
+ # @return [Array<GOBL::Bill::Discount>]
176
+ property :discounts, [GOBL::Bill::Discount]
29
177
 
30
- # @!attribute [r] period
31
- # Period of time in which to expect delivery if a specific date is not available.
32
- # @return [GOBL::Cal::Period]
33
- property :period, GOBL::Cal::Period
178
+ # @!attribute [r] charges
179
+ # Charges or surcharges applied to order totals
180
+ # @return [Array<GOBL::Bill::Charge>]
181
+ property :charges, [GOBL::Bill::Charge]
182
+
183
+ # @!attribute [r] totals
184
+ # Summary of all the order totals, including taxes (calculated).
185
+ # @return [GOBL::Bill::Totals]
186
+ property :totals, GOBL::Bill::Totals
187
+
188
+ # @!attribute [r] notes
189
+ # Unstructured information that is relevant to the delivery, such as correction or additional legal details.
190
+ # @return [Array<GOBL::Org::Note>]
191
+ property :notes, [GOBL::Org::Note]
192
+
193
+ # @!attribute [r] complements
194
+ # Additional complementary objects that add relevant information to the delivery.
195
+ # @return [Array<GOBL::Schema::Object>]
196
+ property :complements, [GOBL::Schema::Object]
34
197
 
35
198
  # @!attribute [r] meta
36
- # Additional custom data.
199
+ # Additional semi-structured data that doesn't fit into the body of the delivery.
37
200
  # @return [GOBL::CBC::Meta]
38
201
  property :meta, GOBL::CBC::Meta
202
+
203
+ # @!attribute [r] attachments
204
+ # 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.
205
+ # @return [Array<GOBL::Org::Attachment>]
206
+ property :attachments, [GOBL::Org::Attachment]
39
207
  end
40
208
  end
41
209
  end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Bill
10
+ # DeliveryDetails covers the details of the destination for the products described in the invoice body.
11
+ class DeliveryDetails < GOBL::Object
12
+ # The Schema ID of the GOBL DeliveryDetails structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/delivery-details'
14
+
15
+ # @!attribute [r] receiver
16
+ # The party who will receive delivery of the goods defined in the invoice and is not responsible for taxes.
17
+ # @return [GOBL::Org::Party]
18
+ property :receiver, GOBL::Org::Party
19
+
20
+ # @!attribute [r] identities
21
+ # Identities is used to define specific codes or IDs that may be used to identify the delivery.
22
+ # @return [Array<GOBL::Org::Identity>]
23
+ property :identities, [GOBL::Org::Identity]
24
+
25
+ # @!attribute [r] date
26
+ # When the goods should be expected.
27
+ # @return [GOBL::Cal::Date]
28
+ property :date, GOBL::Cal::Date
29
+
30
+ # @!attribute [r] period
31
+ # Period of time in which to expect delivery if a specific date is not available.
32
+ # @return [GOBL::Cal::Period]
33
+ property :period, GOBL::Cal::Period
34
+
35
+ # @!attribute [r] meta
36
+ # Additional custom data.
37
+ # @return [GOBL::CBC::Meta]
38
+ property :meta, GOBL::CBC::Meta
39
+ end
40
+ end
41
+ end
@@ -10,7 +10,7 @@ module GOBL
10
10
  # Discount represents an allowance applied to the complete document independent from the individual lines.
11
11
  class Discount < GOBL::Object
12
12
  # The Schema ID of the GOBL Discount structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Discount'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/discount'
14
14
 
15
15
  # @!attribute [r] uuid
16
16
  # Universally Unique Identifier.
@@ -22,10 +22,38 @@ module GOBL
22
22
  # @return [Integer]
23
23
  property :i, Integer
24
24
 
25
- # @!attribute [r] ref
26
- # Reference or ID for this Discount
25
+ # Enumeration of possible values for {#key} with their corresponding descriptions
26
+ KEY_ENUM = {
27
+ 'early-completion' => 'Bonus for works ahead of schedule',
28
+ 'military' => 'Military Discount',
29
+ 'work-accident' => 'Work Accident Discount',
30
+ 'special-agreement' => 'Special Agreement Discount',
31
+ 'production-error' => 'Production Error Discount',
32
+ 'new-outlet' => 'New Outlet Discount',
33
+ 'sample' => 'Sample Discount',
34
+ 'end-of-range' => 'End of Range Discount',
35
+ 'incoterm' => 'Incoterm Discount',
36
+ 'pos-threshold' => 'Point of Sale Threshold Discount',
37
+ 'special-rebate' => 'Special Rebate',
38
+ 'temporary' => 'Temporary',
39
+ 'standard' => 'Standard',
40
+ 'yearly-turnover' => 'Yearly Turnover'
41
+ }.freeze
42
+
43
+ # @!attribute [r] key
44
+ # Key for identifying the type of discount being applied.
45
+ # @return [GOBL::CBC::Key]
46
+ property :key, GOBL::CBC::Key
47
+
48
+ # @!attribute [r] code
49
+ # Code to used to refer to the this discount by the issuer
50
+ # @return [GOBL::CBC::Code]
51
+ property :code, GOBL::CBC::Code
52
+
53
+ # @!attribute [r] reason
54
+ # Text description as to why the discount was applied
27
55
  # @return [String]
28
- property :ref, String
56
+ property :reason, String
29
57
 
30
58
  # @!attribute [r] base
31
59
  # Base represents the value used as a base for percent calculations instead of the invoice's sum of lines.
@@ -47,15 +75,10 @@ module GOBL
47
75
  # @return [GOBL::Tax::Set]
48
76
  property :taxes, GOBL::Tax::Set
49
77
 
50
- # @!attribute [r] code
51
- # Code for the reason this discount applied
52
- # @return [String]
53
- property :code, String
54
-
55
- # @!attribute [r] reason
56
- # Text description as to why the discount was applied
57
- # @return [String]
58
- property :reason, String
78
+ # @!attribute [r] ext
79
+ # Extension codes that apply to the discount
80
+ # @return [GOBL::Tax::Extensions]
81
+ property :ext, GOBL::Tax::Extensions
59
82
 
60
83
  # @!attribute [r] meta
61
84
  # Additional semi-structured information.