gobl 0.22.0 → 0.24.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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/ae.json +173 -0
  3. data/data/regimes/at.json +1 -0
  4. data/data/regimes/be.json +1 -0
  5. data/data/regimes/br.json +135 -0
  6. data/data/regimes/ca.json +1 -0
  7. data/data/regimes/ch.json +1 -0
  8. data/data/regimes/co.json +0 -221
  9. data/data/regimes/de.json +14 -1
  10. data/data/regimes/el.json +8 -1
  11. data/data/regimes/es.json +3 -2
  12. data/data/regimes/fr.json +1 -0
  13. data/data/regimes/gb.json +1 -0
  14. data/data/regimes/in.json +128 -0
  15. data/data/regimes/it.json +2 -14
  16. data/data/regimes/mx.json +1 -0
  17. data/data/regimes/nl.json +1 -0
  18. data/data/regimes/pl.json +8 -7
  19. data/data/regimes/pt.json +1573 -9
  20. data/lib/generated/gobl/bill/charge.rb +34 -19
  21. data/lib/generated/gobl/bill/correction_options.rb +6 -1
  22. data/lib/generated/gobl/bill/delivery.rb +187 -16
  23. data/lib/generated/gobl/bill/delivery_details.rb +41 -0
  24. data/lib/generated/gobl/bill/discount.rb +36 -13
  25. data/lib/generated/gobl/bill/invoice.rb +43 -33
  26. data/lib/generated/gobl/bill/line.rb +44 -4
  27. data/lib/generated/gobl/bill/line_charge.rb +56 -11
  28. data/lib/generated/gobl/bill/line_discount.rb +45 -12
  29. data/lib/generated/gobl/bill/order.rb +211 -0
  30. data/lib/generated/gobl/bill/ordering.rb +13 -3
  31. data/lib/generated/gobl/bill/payment.rb +158 -15
  32. data/lib/generated/gobl/bill/payment_details.rb +36 -0
  33. data/lib/generated/gobl/bill/payment_line.rb +77 -0
  34. data/lib/generated/gobl/bill/sub_line.rb +83 -0
  35. data/lib/generated/gobl/bill/tax.rb +20 -1
  36. data/lib/generated/gobl/bill/totals.rb +18 -18
  37. data/lib/generated/gobl/bill/tracking.rb +26 -0
  38. data/lib/generated/gobl/cal/date_time.rb +1 -1
  39. data/lib/generated/gobl/cal/time.rb +16 -0
  40. data/lib/generated/gobl/cbc/code.rb +2 -1
  41. data/lib/generated/gobl/cbc/{key_definition.rb → definition.rb} +18 -9
  42. data/lib/generated/gobl/cbc/source.rb +37 -0
  43. data/lib/generated/gobl/currency/code.rb +16 -16
  44. data/lib/generated/gobl/currency/exchange_rate.rb +10 -5
  45. data/lib/generated/gobl/org/address.rb +9 -4
  46. data/lib/generated/gobl/org/attachment.rb +57 -0
  47. data/lib/generated/gobl/org/document_ref.rb +26 -6
  48. data/lib/generated/gobl/org/identity.rb +6 -1
  49. data/lib/generated/gobl/org/inbox.rb +22 -14
  50. data/lib/generated/gobl/org/item.rb +7 -3
  51. data/lib/generated/gobl/{cbc → org}/note.rb +16 -5
  52. data/lib/generated/gobl/org/party.rb +4 -0
  53. data/lib/generated/gobl/org/person.rb +17 -2
  54. data/lib/generated/gobl/org/telephone.rb +1 -1
  55. data/lib/generated/gobl/org/unit.rb +11 -1
  56. data/lib/generated/gobl/pay/advance.rb +3 -1
  57. data/lib/generated/gobl/pay/card.rb +5 -2
  58. data/lib/generated/gobl/pay/instructions.rb +5 -3
  59. data/lib/generated/gobl/pay/terms.rb +7 -2
  60. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
  61. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
  62. data/lib/generated/gobl/tax/addon_def.rb +19 -4
  63. data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
  64. data/lib/generated/gobl/tax/category_def.rb +14 -4
  65. data/lib/generated/gobl/tax/category_total.rb +4 -0
  66. data/lib/generated/gobl/tax/combo.rb +8 -3
  67. data/lib/generated/gobl/tax/correction_definition.rb +5 -0
  68. data/lib/generated/gobl/tax/identity.rb +5 -0
  69. data/lib/generated/gobl/tax/key_def.rb +36 -0
  70. data/lib/generated/gobl/tax/rate_def.rb +9 -14
  71. data/lib/generated/gobl/tax/rate_total.rb +5 -5
  72. data/lib/generated/gobl/tax/rate_value_def.rb +1 -6
  73. data/lib/generated/gobl/tax/regime_def.rb +17 -22
  74. data/lib/generated/gobl/tax/scenario.rb +11 -6
  75. data/lib/generated/gobl/tax/scenario_note.rb +42 -0
  76. data/lib/generated/gobl/tax/tag_set.rb +2 -2
  77. data/lib/generated/gobl/tax/total.rb +6 -1
  78. data/lib/gobl/version.rb +1 -1
  79. metadata +25 -13
  80. data/lib/generated/gobl/bill/outlay.rb +0 -58
  81. data/lib/generated/gobl/cbc/value_definition.rb +0 -37
  82. data/lib/generated/gobl/tax/source.rb +0 -27
@@ -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.
@@ -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,206 @@
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
+ 'IE' => 'Ireland',
30
+ 'IN' => 'India',
31
+ 'IT' => 'Italy',
32
+ 'MX' => 'Mexico',
33
+ 'NL' => 'The Netherlands',
34
+ 'PL' => 'Poland',
35
+ 'PT' => 'Portugal',
36
+ 'SE' => 'Sweden',
37
+ 'SG' => 'Singapore',
38
+ 'US' => 'United States of America'
39
+ }.freeze
40
+
41
+ # @!attribute [r] $regime
42
+ # @return [GOBL::L10n::TaxCountryCode]
43
+ property :$regime, GOBL::L10n::TaxCountryCode
44
+ validates_inclusion_of :$regime, in: $REGIME_ENUM.keys, allow_blank: true
45
+
46
+ # @!attribute [r] $addons
47
+ # Addons defines a list of keys used to identify tax addons that apply special normalization, scenarios, and validation rules to a document.
48
+ # @return [Array<GOBL::CBC::Key>]
49
+ property :$addons, [GOBL::CBC::Key]
50
+
51
+ # @!attribute [r] $tags
52
+ # 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.
53
+ # @return [Array<GOBL::CBC::Key>]
54
+ property :$tags, [GOBL::CBC::Key]
55
+
56
+ # @!attribute [r] uuid
57
+ # Universally Unique Identifier.
58
+ # @return [String]
59
+ property :uuid, String
60
+
61
+ # Enumeration of possible values for {#type} with their corresponding descriptions
62
+ TYPE_ENUM = {
63
+ 'advice' => 'A delivery or despatch advice document send by the supplier to indicate how
64
+ an order is to be delivered.',
65
+ 'note' => 'A delivery note is a document accompanying a shipment of goods that lists the
66
+ items included in the shipment.',
67
+ 'waybill' => 'A waybill is a document issued by a carrier giving details and instructions
68
+ relating to the shipment of a consignment of goods.',
69
+ 'receipt' => 'A delivery receipt is a document that is signed by the person who receives
70
+ goods to confirm that they have been received.'
71
+ }.freeze
72
+
73
+ # @!attribute [r] type
74
+ # Type of delivery document.
75
+ # @return [GOBL::CBC::Key]
76
+ property :type, GOBL::CBC::Key
77
+ validates_presence_of :type
78
+ validates_inclusion_of :type, in: TYPE_ENUM.keys
79
+
80
+ # @!attribute [r] series
81
+ # 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.
82
+ # @return [GOBL::CBC::Code]
83
+ property :series, GOBL::CBC::Code
84
+
85
+ # @!attribute [r] code
86
+ # Code is a sequential identifier that uniquely identifies the delivery. The code can be left empty initially, but is **required** to **sign** the document.
87
+ # @return [GOBL::CBC::Code]
88
+ property :code, GOBL::CBC::Code
89
+
90
+ # @!attribute [r] issue_date
91
+ # When the delivery document is to be issued.
92
+ # @return [GOBL::Cal::Date]
93
+ property :issue_date, GOBL::Cal::Date
94
+
95
+ # @!attribute [r] issue_time
96
+ # 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.
97
+ # @return [GOBL::Cal::Time]
98
+ property :issue_time, GOBL::Cal::Time
99
+
100
+ # @!attribute [r] value_date
101
+ # When the taxes of this delivery become accountable, if none set, the issue date is used.
102
+ # @return [GOBL::Cal::Date]
103
+ property :value_date, GOBL::Cal::Date
104
+
105
+ # @!attribute [r] currency
106
+ # Currency for all delivery totals.
107
+ # @return [GOBL::Currency::Code]
108
+ property :currency, GOBL::Currency::Code
109
+
110
+ # @!attribute [r] exchange_rates
111
+ # Exchange rates to be used when converting the invoices monetary values into other currencies.
112
+ # @return [Array<GOBL::Currency::ExchangeRate>]
113
+ property :exchange_rates, [GOBL::Currency::ExchangeRate]
114
+
115
+ # @!attribute [r] ordering
116
+ # Ordering details for the delivery, including links to other documents.
117
+ # @return [GOBL::Bill::Ordering]
118
+ property :ordering, GOBL::Bill::Ordering
119
+
120
+ # @!attribute [r] preceding
121
+ # Key information regarding previous delivery documents that this one will either extend or replace.
122
+ # @return [Array<GOBL::Org::DocumentRef>]
123
+ property :preceding, [GOBL::Org::DocumentRef]
124
+
125
+ # @!attribute [r] tracking
126
+ # Tracking is used to define specific codes or IDs that may be used to identify and track delivery.
127
+ # @return [Tracking]
128
+ property :tracking, Tracking
129
+
130
+ # @!attribute [r] despatch_date
131
+ # DespatchDate is the date when the goods are expected to be despatched.
132
+ # @return [GOBL::Cal::Date]
133
+ property :despatch_date, GOBL::Cal::Date
134
+
135
+ # @!attribute [r] receive_date
136
+ # ReceiveDate is the date when the goods are expected to be received.
137
+ # @return [GOBL::Cal::Date]
138
+ property :receive_date, GOBL::Cal::Date
139
+
140
+ # @!attribute [r] tax
141
+ # Special tax configuration for calculating totals.
142
+ # @return [GOBL::Bill::Tax]
143
+ property :tax, GOBL::Bill::Tax
144
+
145
+ # @!attribute [r] supplier
146
+ # The entity supplying the goods or services and usually responsible for paying taxes.
147
+ # @return [GOBL::Org::Party]
148
+ property :supplier, GOBL::Org::Party
149
+ validates_presence_of :supplier
150
+
151
+ # @!attribute [r] customer
152
+ # Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
153
+ # @return [GOBL::Org::Party]
154
+ property :customer, GOBL::Org::Party
155
+
156
+ # @!attribute [r] despatcher
157
+ # The party who will despatch the goods defined in the invoice.
158
+ # @return [GOBL::Org::Party]
159
+ property :despatcher, GOBL::Org::Party
14
160
 
15
161
  # @!attribute [r] receiver
16
- # The party who will receive delivery of the goods defined in the invoice and is not responsible for taxes.
162
+ # The party who will receive delivery of the goods defined in the invoice.
17
163
  # @return [GOBL::Org::Party]
18
164
  property :receiver, GOBL::Org::Party
19
165
 
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]
166
+ # @!attribute [r] courier
167
+ # The courier responsible for delivering the goods.
168
+ # @return [GOBL::Org::Party]
169
+ property :courier, GOBL::Org::Party
24
170
 
25
- # @!attribute [r] date
26
- # When the goods should be expected.
27
- # @return [GOBL::Cal::Date]
28
- property :date, GOBL::Cal::Date
171
+ # @!attribute [r] lines
172
+ # List of lines representing each of the items to be ordered.
173
+ # @return [Array<GOBL::Bill::Line>]
174
+ property :lines, [GOBL::Bill::Line]
175
+
176
+ # @!attribute [r] discounts
177
+ # Discounts or allowances applied to order totals
178
+ # @return [Array<GOBL::Bill::Discount>]
179
+ property :discounts, [GOBL::Bill::Discount]
29
180
 
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
181
+ # @!attribute [r] charges
182
+ # Charges or surcharges applied to order totals
183
+ # @return [Array<GOBL::Bill::Charge>]
184
+ property :charges, [GOBL::Bill::Charge]
185
+
186
+ # @!attribute [r] totals
187
+ # Summary of all the order totals, including taxes (calculated).
188
+ # @return [GOBL::Bill::Totals]
189
+ property :totals, GOBL::Bill::Totals
190
+
191
+ # @!attribute [r] notes
192
+ # Unstructured information that is relevant to the delivery, such as correction or additional legal details.
193
+ # @return [Array<GOBL::Org::Note>]
194
+ property :notes, [GOBL::Org::Note]
195
+
196
+ # @!attribute [r] complements
197
+ # Additional complementary objects that add relevant information to the delivery.
198
+ # @return [Array<GOBL::Schema::Object>]
199
+ property :complements, [GOBL::Schema::Object]
34
200
 
35
201
  # @!attribute [r] meta
36
- # Additional custom data.
202
+ # Additional semi-structured data that doesn't fit into the body of the delivery.
37
203
  # @return [GOBL::CBC::Meta]
38
204
  property :meta, GOBL::CBC::Meta
205
+
206
+ # @!attribute [r] attachments
207
+ # 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.
208
+ # @return [Array<GOBL::Org::Attachment>]
209
+ property :attachments, [GOBL::Org::Attachment]
39
210
  end
40
211
  end
41
212
  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.
@@ -14,8 +14,10 @@ module GOBL
14
14
 
15
15
  # Enumeration of possible values for {#$regime} with their corresponding descriptions
16
16
  $REGIME_ENUM = {
17
+ 'AE' => 'United Arab Emirates',
17
18
  'AT' => 'Austria',
18
19
  'BE' => 'Belgium',
20
+ 'BR' => 'Brazil',
19
21
  'CA' => 'Canada',
20
22
  'CH' => 'Switzerland',
21
23
  'CO' => 'Colombia',
@@ -24,11 +26,15 @@ module GOBL
24
26
  'ES' => 'Spain',
25
27
  'FR' => 'France',
26
28
  'GB' => 'United Kingdom',
29
+ 'IE' => 'Ireland',
30
+ 'IN' => 'India',
27
31
  'IT' => 'Italy',
28
32
  'MX' => 'Mexico',
29
33
  'NL' => 'The Netherlands',
30
34
  'PL' => 'Poland',
31
35
  'PT' => 'Portugal',
36
+ 'SE' => 'Sweden',
37
+ 'SG' => 'Singapore',
32
38
  'US' => 'United States of America'
33
39
  }.freeze
34
40
 
@@ -43,7 +49,7 @@ module GOBL
43
49
  property :$addons, [GOBL::CBC::Key]
44
50
 
45
51
  # @!attribute [r] $tags
46
- # 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.
52
+ # 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.
47
53
  # @return [Array<GOBL::CBC::Key>]
48
54
  property :$tags, [GOBL::CBC::Key]
49
55
 
@@ -68,27 +74,31 @@ module GOBL
68
74
  }.freeze
69
75
 
70
76
  # @!attribute [r] type
71
- # Type of invoice document subject to the requirements of the local tax regime.
77
+ # Type of invoice document. May be restricted by local tax regime requirements.
72
78
  # @return [GOBL::CBC::Key]
73
79
  property :type, GOBL::CBC::Key
74
80
  validates_inclusion_of :type, in: TYPE_ENUM.keys, allow_blank: true
75
81
 
76
82
  # @!attribute [r] series
77
- # Used as a prefix to group codes.
83
+ # 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.
78
84
  # @return [GOBL::CBC::Code]
79
85
  property :series, GOBL::CBC::Code
80
86
 
81
87
  # @!attribute [r] code
82
- # Sequential code used to identify this invoice in tax declarations.
88
+ # Code is a sequential identifier that uniquely identifies the invoice. The code can be left empty initially, but is **required** to **sign** the invoice.
83
89
  # @return [GOBL::CBC::Code]
84
90
  property :code, GOBL::CBC::Code
85
- validates_presence_of :code
86
91
 
87
92
  # @!attribute [r] issue_date
88
- # When the invoice was created.
93
+ # 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.
89
94
  # @return [GOBL::Cal::Date]
90
95
  property :issue_date, GOBL::Cal::Date
91
96
 
97
+ # @!attribute [r] issue_time
98
+ # 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.
99
+ # @return [GOBL::Cal::Time]
100
+ property :issue_time, GOBL::Cal::Time
101
+
92
102
  # @!attribute [r] op_date
93
103
  # Date when the operation defined by the invoice became effective.
94
104
  # @return [GOBL::Cal::Date]
@@ -100,7 +110,7 @@ module GOBL
100
110
  property :value_date, GOBL::Cal::Date
101
111
 
102
112
  # @!attribute [r] currency
103
- # Currency for all invoice totals.
113
+ # Currency for all invoice amounts and totals, unless explicitly stated otherwise.
104
114
  # @return [GOBL::Currency::Code]
105
115
  property :currency, GOBL::Currency::Code
106
116
 
@@ -110,17 +120,17 @@ module GOBL
110
120
  property :exchange_rates, [GOBL::Currency::ExchangeRate]
111
121
 
112
122
  # @!attribute [r] preceding
113
- # Key information regarding previous invoices and potentially details as to why they were corrected.
123
+ # Document references for previous invoices that this document replaces or extends.
114
124
  # @return [Array<GOBL::Org::DocumentRef>]
115
125
  property :preceding, [GOBL::Org::DocumentRef]
116
126
 
117
127
  # @!attribute [r] tax
118
- # Special tax configuration for billing.
119
- # @return [Tax]
120
- property :tax, Tax
128
+ # Special billing tax configuration options.
129
+ # @return [GOBL::Bill::Tax]
130
+ property :tax, GOBL::Bill::Tax
121
131
 
122
132
  # @!attribute [r] supplier
123
- # The taxable entity supplying the goods or services.
133
+ # The entity supplying the goods or services and usually responsible for paying taxes.
124
134
  # @return [GOBL::Org::Party]
125
135
  property :supplier, GOBL::Org::Party
126
136
  validates_presence_of :supplier
@@ -132,48 +142,43 @@ module GOBL
132
142
 
133
143
  # @!attribute [r] lines
134
144
  # List of invoice lines representing each of the items sold to the customer.
135
- # @return [Array<Line>]
136
- property :lines, [Line]
145
+ # @return [Array<GOBL::Bill::Line>]
146
+ property :lines, [GOBL::Bill::Line]
137
147
 
138
148
  # @!attribute [r] discounts
139
149
  # Discounts or allowances applied to the complete invoice
140
- # @return [Array<Discount>]
141
- property :discounts, [Discount]
150
+ # @return [Array<GOBL::Bill::Discount>]
151
+ property :discounts, [GOBL::Bill::Discount]
142
152
 
143
153
  # @!attribute [r] charges
144
154
  # Charges or surcharges applied to the complete invoice
145
- # @return [Array<Charge>]
146
- property :charges, [Charge]
147
-
148
- # @!attribute [r] outlays
149
- # Expenses paid for by the supplier but invoiced directly to the customer.
150
- # @return [Array<Outlay>]
151
- property :outlays, [Outlay]
155
+ # @return [Array<GOBL::Bill::Charge>]
156
+ property :charges, [GOBL::Bill::Charge]
152
157
 
153
158
  # @!attribute [r] ordering
154
159
  # Ordering details including document references and buyer or seller parties.
155
- # @return [Ordering]
156
- property :ordering, Ordering
160
+ # @return [GOBL::Bill::Ordering]
161
+ property :ordering, GOBL::Bill::Ordering
157
162
 
158
163
  # @!attribute [r] payment
159
164
  # Information on when, how, and to whom the invoice should be paid.
160
- # @return [Payment]
161
- property :payment, Payment
165
+ # @return [GOBL::Bill::PaymentDetails]
166
+ property :payment, GOBL::Bill::PaymentDetails
162
167
 
163
168
  # @!attribute [r] delivery
164
169
  # Specific details on delivery of the goods referenced in the invoice.
165
- # @return [Delivery]
166
- property :delivery, Delivery
170
+ # @return [GOBL::Bill::DeliveryDetails]
171
+ property :delivery, GOBL::Bill::DeliveryDetails
167
172
 
168
173
  # @!attribute [r] totals
169
174
  # Summary of all the invoice totals, including taxes (calculated).
170
- # @return [Totals]
171
- property :totals, Totals
175
+ # @return [GOBL::Bill::Totals]
176
+ property :totals, GOBL::Bill::Totals
172
177
 
173
178
  # @!attribute [r] notes
174
179
  # Unstructured information that is relevant to the invoice, such as correction or additional legal details.
175
- # @return [Array<GOBL::CBC::Note>]
176
- property :notes, [GOBL::CBC::Note]
180
+ # @return [Array<GOBL::Org::Note>]
181
+ property :notes, [GOBL::Org::Note]
177
182
 
178
183
  # @!attribute [r] complements
179
184
  # Additional complementary objects that add relevant information to the invoice.
@@ -184,6 +189,11 @@ module GOBL
184
189
  # Additional semi-structured data that doesn't fit into the body of the invoice.
185
190
  # @return [GOBL::CBC::Meta]
186
191
  property :meta, GOBL::CBC::Meta
192
+
193
+ # @!attribute [r] attachments
194
+ # 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.
195
+ # @return [Array<GOBL::Org::Attachment>]
196
+ property :attachments, [GOBL::Org::Attachment]
187
197
  end
188
198
  end
189
199
  end