gobl 0.22.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 (75) 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 +184 -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 +39 -32
  26. data/lib/generated/gobl/bill/line.rb +39 -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 +208 -0
  30. data/lib/generated/gobl/bill/ordering.rb +8 -3
  31. data/lib/generated/gobl/bill/payment.rb +155 -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 +62 -0
  47. data/lib/generated/gobl/org/document_ref.rb +20 -5
  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 +2 -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/telephone.rb +1 -1
  54. data/lib/generated/gobl/org/unit.rb +2 -1
  55. data/lib/generated/gobl/pay/advance.rb +3 -1
  56. data/lib/generated/gobl/pay/card.rb +5 -2
  57. data/lib/generated/gobl/pay/instructions.rb +5 -3
  58. data/lib/generated/gobl/pay/terms.rb +7 -2
  59. data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
  60. data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
  61. data/lib/generated/gobl/tax/addon_def.rb +19 -4
  62. data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
  63. data/lib/generated/gobl/tax/category_def.rb +4 -4
  64. data/lib/generated/gobl/tax/correction_definition.rb +5 -0
  65. data/lib/generated/gobl/tax/identity.rb +5 -0
  66. data/lib/generated/gobl/tax/regime_def.rb +17 -22
  67. data/lib/generated/gobl/tax/scenario.rb +6 -6
  68. data/lib/generated/gobl/tax/scenario_note.rb +42 -0
  69. data/lib/generated/gobl/tax/tag_set.rb +2 -2
  70. data/lib/generated/gobl/tax/total.rb +6 -1
  71. data/lib/gobl/version.rb +1 -1
  72. metadata +24 -13
  73. data/lib/generated/gobl/bill/outlay.rb +0 -58
  74. data/lib/generated/gobl/cbc/value_definition.rb +0 -37
  75. data/lib/generated/gobl/tax/source.rb +0 -27
@@ -10,27 +10,72 @@ module GOBL
10
10
  # LineCharge represents an amount added to the line, and will be applied before taxes.
11
11
  class LineCharge < GOBL::Object
12
12
  # The Schema ID of the GOBL LineCharge structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/LineCharge'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/line#/$defs/LineCharge'
14
+
15
+ # Enumeration of possible values for {#key} with their corresponding descriptions
16
+ KEY_ENUM = {
17
+ 'stamp-duty' => 'Stamp Duty',
18
+ 'outlay' => 'Outlay',
19
+ 'tax' => 'Tax',
20
+ 'customs' => 'Customs',
21
+ 'delivery' => 'Delivery',
22
+ 'packing' => 'Packing',
23
+ 'handling' => 'Handling',
24
+ 'insurance' => 'Insurance',
25
+ 'storage' => 'Storage',
26
+ 'admin' => 'Administration',
27
+ 'cleaning' => 'Cleaning'
28
+ }.freeze
29
+
30
+ # @!attribute [r] key
31
+ # Key for grouping or identifying charges for tax purposes. A suggested list of keys is provided, but these are for reference only and may be extended by the issuer.
32
+ # @return [GOBL::CBC::Key]
33
+ property :key, GOBL::CBC::Key
34
+
35
+ # @!attribute [r] code
36
+ # Reference or ID for this charge defined by the issuer
37
+ # @return [GOBL::CBC::Code]
38
+ property :code, GOBL::CBC::Code
39
+
40
+ # @!attribute [r] reason
41
+ # Text description as to why the charge was applied
42
+ # @return [String]
43
+ property :reason, String
44
+
45
+ # @!attribute [r] base
46
+ # Base for percent calculations instead of the line's sum
47
+ # @return [GOBL::Num::Amount]
48
+ property :base, GOBL::Num::Amount
14
49
 
15
50
  # @!attribute [r] percent
16
- # Percentage if fixed amount not applied
51
+ # Percentage of base or parent line's sum
17
52
  # @return [GOBL::Num::Percentage]
18
53
  property :percent, GOBL::Num::Percentage
19
54
 
55
+ # @!attribute [r] quantity
56
+ # Quantity of units to apply the charge to when using the rate instead of the line's quantity.
57
+ # @return [GOBL::Num::Amount]
58
+ property :quantity, GOBL::Num::Amount
59
+
60
+ # @!attribute [r] unit
61
+ # Unit to associate with the quantity when using the rate.
62
+ # @return [GOBL::Org::Unit]
63
+ property :unit, GOBL::Org::Unit
64
+
65
+ # @!attribute [r] rate
66
+ # Rate defines a price per unit to use instead of the percentage.
67
+ # @return [GOBL::Num::Amount]
68
+ property :rate, GOBL::Num::Amount
69
+
20
70
  # @!attribute [r] amount
21
71
  # Fixed or resulting charge amount to apply (calculated if percent present).
22
72
  # @return [GOBL::Num::Amount]
23
73
  property :amount, GOBL::Num::Amount
24
74
 
25
- # @!attribute [r] code
26
- # Reference code.
27
- # @return [String]
28
- property :code, String
29
-
30
- # @!attribute [r] reason
31
- # Text description as to why the charge was applied
32
- # @return [String]
33
- 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
34
79
  end
35
80
  end
36
81
  end
@@ -10,27 +10,60 @@ module GOBL
10
10
  # LineDiscount represents an amount deducted from the line, and will be applied before taxes.
11
11
  class LineDiscount < GOBL::Object
12
12
  # The Schema ID of the GOBL LineDiscount structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/LineDiscount'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/line#/$defs/LineDiscount'
14
14
 
15
- # @!attribute [r] percent
16
- # Percentage if fixed amount not applied
17
- # @return [GOBL::Num::Percentage]
18
- property :percent, GOBL::Num::Percentage
15
+ # Enumeration of possible values for {#key} with their corresponding descriptions
16
+ KEY_ENUM = {
17
+ 'early-completion' => 'Bonus for works ahead of schedule',
18
+ 'military' => 'Military Discount',
19
+ 'work-accident' => 'Work Accident Discount',
20
+ 'special-agreement' => 'Special Agreement Discount',
21
+ 'production-error' => 'Production Error Discount',
22
+ 'new-outlet' => 'New Outlet Discount',
23
+ 'sample' => 'Sample Discount',
24
+ 'end-of-range' => 'End of Range Discount',
25
+ 'incoterm' => 'Incoterm Discount',
26
+ 'pos-threshold' => 'Point of Sale Threshold Discount',
27
+ 'special-rebate' => 'Special Rebate',
28
+ 'temporary' => 'Temporary',
29
+ 'standard' => 'Standard',
30
+ 'yearly-turnover' => 'Yearly Turnover'
31
+ }.freeze
19
32
 
20
- # @!attribute [r] amount
21
- # Fixed discount amount to apply (calculated if percent present).
22
- # @return [GOBL::Num::Amount]
23
- property :amount, GOBL::Num::Amount
33
+ # @!attribute [r] key
34
+ # Key for identifying the type of discount being applied.
35
+ # @return [GOBL::CBC::Key]
36
+ property :key, GOBL::CBC::Key
24
37
 
25
38
  # @!attribute [r] code
26
- # Reason code.
27
- # @return [String]
28
- property :code, String
39
+ # Code or reference for this discount defined by the issuer
40
+ # @return [GOBL::CBC::Code]
41
+ property :code, GOBL::CBC::Code
29
42
 
30
43
  # @!attribute [r] reason
31
44
  # Text description as to why the discount was applied
32
45
  # @return [String]
33
46
  property :reason, String
47
+
48
+ # @!attribute [r] base
49
+ # Base for percent calculations instead of the line's sum.
50
+ # @return [GOBL::Num::Amount]
51
+ property :base, GOBL::Num::Amount
52
+
53
+ # @!attribute [r] percent
54
+ # Percentage to apply to the base or line sum to calculate the discount amount
55
+ # @return [GOBL::Num::Percentage]
56
+ property :percent, GOBL::Num::Percentage
57
+
58
+ # @!attribute [r] amount
59
+ # Fixed discount amount to apply (calculated if percent present)
60
+ # @return [GOBL::Num::Amount]
61
+ property :amount, GOBL::Num::Amount
62
+
63
+ # @!attribute [r] ext
64
+ # Extension codes that apply to the discount
65
+ # @return [GOBL::Tax::Extensions]
66
+ property :ext, GOBL::Tax::Extensions
34
67
  end
35
68
  end
36
69
  end
@@ -0,0 +1,208 @@
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
+ # Order documents are used for the initial part of a order-to-invoice process where the buyer requests goods or services from the seller.
11
+ class Order < GOBL::Object
12
+ # The Schema ID of the GOBL Order structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/order'
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
+ 'purchase' => 'A purchase order is a document that a buyer sends to a seller to request goods or services.',
61
+ 'sale' => 'A sales order is a document that a seller sends to a buyer to confirm the sale of goods or services.',
62
+ 'quote' => 'A quote is a document that a seller sends to a buyer to provide a price for goods or services.'
63
+ }.freeze
64
+
65
+ # @!attribute [r] type
66
+ # Type of the order.
67
+ # @return [GOBL::CBC::Key]
68
+ property :type, GOBL::CBC::Key
69
+ validates_inclusion_of :type, in: TYPE_ENUM.keys, allow_blank: true
70
+
71
+ # @!attribute [r] series
72
+ # Series is used to identify groups of orders 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.
73
+ # @return [GOBL::CBC::Code]
74
+ property :series, GOBL::CBC::Code
75
+
76
+ # @!attribute [r] code
77
+ # Code is a sequential identifier that uniquely identifies the order. The code can be left empty initially, but is **required** to **sign** the document.
78
+ # @return [GOBL::CBC::Code]
79
+ property :code, GOBL::CBC::Code
80
+
81
+ # @!attribute [r] issue_date
82
+ # When the invoice was created.
83
+ # @return [GOBL::Cal::Date]
84
+ property :issue_date, GOBL::Cal::Date
85
+
86
+ # @!attribute [r] issue_time
87
+ # IssueTime is an optional field that may be useful to indicate the time of day when the order 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.
88
+ # @return [GOBL::Cal::Time]
89
+ property :issue_time, GOBL::Cal::Time
90
+
91
+ # @!attribute [r] op_date
92
+ # Date when the operation defined by the invoice became effective.
93
+ # @return [GOBL::Cal::Date]
94
+ property :op_date, GOBL::Cal::Date
95
+
96
+ # @!attribute [r] value_date
97
+ # When the taxes of this invoice become accountable, if none set, the issue date is used.
98
+ # @return [GOBL::Cal::Date]
99
+ property :value_date, GOBL::Cal::Date
100
+
101
+ # @!attribute [r] currency
102
+ # Currency for all invoice totals.
103
+ # @return [GOBL::Currency::Code]
104
+ property :currency, GOBL::Currency::Code
105
+
106
+ # @!attribute [r] exchange_rates
107
+ # Exchange rates to be used when converting the invoices monetary values into other currencies.
108
+ # @return [Array<GOBL::Currency::ExchangeRate>]
109
+ property :exchange_rates, [GOBL::Currency::ExchangeRate]
110
+
111
+ # @!attribute [r] contracts
112
+ # The identification of contracts.
113
+ # @return [Array<GOBL::Org::DocumentRef>]
114
+ property :contracts, [GOBL::Org::DocumentRef]
115
+
116
+ # @!attribute [r] preceding
117
+ # Key information regarding previous order documents.
118
+ # @return [Array<GOBL::Org::DocumentRef>]
119
+ property :preceding, [GOBL::Org::DocumentRef]
120
+
121
+ # @!attribute [r] identities
122
+ # Additional codes, IDs, SKUs, or other regional or custom identifiers that may be used to identify the order.
123
+ # @return [Array<GOBL::Org::Identity>]
124
+ property :identities, [GOBL::Org::Identity]
125
+
126
+ # @!attribute [r] period
127
+ # Period of time in which the order is valid.
128
+ # @return [GOBL::Cal::Period]
129
+ property :period, GOBL::Cal::Period
130
+
131
+ # @!attribute [r] tax
132
+ # Special tax configuration for billing.
133
+ # @return [GOBL::Bill::Tax]
134
+ property :tax, GOBL::Bill::Tax
135
+
136
+ # @!attribute [r] supplier
137
+ # The entity supplying the goods or services and usually responsible for paying taxes.
138
+ # @return [GOBL::Org::Party]
139
+ property :supplier, GOBL::Org::Party
140
+ validates_presence_of :supplier
141
+
142
+ # @!attribute [r] customer
143
+ # Legal entity receiving the goods or services, may be nil in certain circumstances such as simplified invoices.
144
+ # @return [GOBL::Org::Party]
145
+ property :customer, GOBL::Org::Party
146
+
147
+ # @!attribute [r] buyer
148
+ # Party who is responsible for issuing payment, if not the same as the customer.
149
+ # @return [GOBL::Org::Party]
150
+ property :buyer, GOBL::Org::Party
151
+
152
+ # @!attribute [r] seller
153
+ # Seller is the party liable to pay taxes on the transaction if not the same as the supplier.
154
+ # @return [GOBL::Org::Party]
155
+ property :seller, GOBL::Org::Party
156
+
157
+ # @!attribute [r] lines
158
+ # List of lines representing each of the items to be ordered.
159
+ # @return [Array<GOBL::Bill::Line>]
160
+ property :lines, [GOBL::Bill::Line]
161
+
162
+ # @!attribute [r] discounts
163
+ # Discounts or allowances applied to order totals
164
+ # @return [Array<GOBL::Bill::Discount>]
165
+ property :discounts, [GOBL::Bill::Discount]
166
+
167
+ # @!attribute [r] charges
168
+ # Charges or surcharges applied to order totals
169
+ # @return [Array<GOBL::Bill::Charge>]
170
+ property :charges, [GOBL::Bill::Charge]
171
+
172
+ # @!attribute [r] payment
173
+ # Information on when, how, and to whom a final invoice would be paid.
174
+ # @return [GOBL::Bill::PaymentDetails]
175
+ property :payment, GOBL::Bill::PaymentDetails
176
+
177
+ # @!attribute [r] delivery
178
+ # Specific details on delivery of the goods to copy to the final invoice.
179
+ # @return [GOBL::Bill::DeliveryDetails]
180
+ property :delivery, GOBL::Bill::DeliveryDetails
181
+
182
+ # @!attribute [r] totals
183
+ # Summary of all the order totals, including taxes (calculated).
184
+ # @return [GOBL::Bill::Totals]
185
+ property :totals, GOBL::Bill::Totals
186
+
187
+ # @!attribute [r] notes
188
+ # Unstructured information that is relevant to the order, such as correction or additional legal details.
189
+ # @return [Array<GOBL::Org::Note>]
190
+ property :notes, [GOBL::Org::Note]
191
+
192
+ # @!attribute [r] complements
193
+ # Additional complementary objects that add relevant information to the order.
194
+ # @return [Array<GOBL::Schema::Object>]
195
+ property :complements, [GOBL::Schema::Object]
196
+
197
+ # @!attribute [r] meta
198
+ # Additional semi-structured data that doesn't fit into the body of the order.
199
+ # @return [GOBL::CBC::Meta]
200
+ property :meta, GOBL::CBC::Meta
201
+
202
+ # @!attribute [r] attachments
203
+ # 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.
204
+ # @return [Array<GOBL::Org::Attachment>]
205
+ property :attachments, [GOBL::Org::Attachment]
206
+ end
207
+ end
208
+ end
@@ -10,7 +10,7 @@ module GOBL
10
10
  # Ordering provides additional information about the ordering process including references to other documents and alternative parties involved in the order-to-delivery process.
11
11
  class Ordering < GOBL::Object
12
12
  # The Schema ID of the GOBL Ordering structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Ordering'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/ordering'
14
14
 
15
15
  # @!attribute [r] code
16
16
  # Identifier assigned by the customer or buyer for internal routing purposes.
@@ -22,18 +22,23 @@ module GOBL
22
22
  # @return [Array<GOBL::Org::Identity>]
23
23
  property :identities, [GOBL::Org::Identity]
24
24
 
25
+ # @!attribute [r] cost
26
+ # Buyer accounting reference cost code associated with the document.
27
+ # @return [GOBL::CBC::Code]
28
+ property :cost, GOBL::CBC::Code
29
+
25
30
  # @!attribute [r] period
26
31
  # Period of time that the invoice document refers to often used in addition to the details provided in the individual line items.
27
32
  # @return [GOBL::Cal::Period]
28
33
  property :period, GOBL::Cal::Period
29
34
 
30
35
  # @!attribute [r] buyer
31
- # Party who is responsible for making the purchase, but is not responsible for handling taxes.
36
+ # Party who is responsible for issuing payment, if not the same as the customer.
32
37
  # @return [GOBL::Org::Party]
33
38
  property :buyer, GOBL::Org::Party
34
39
 
35
40
  # @!attribute [r] seller
36
- # Party who is selling the goods but is not responsible for taxes like the supplier.
41
+ # Seller is the party liable to pay taxes on the transaction if not the same as the supplier.
37
42
  # @return [GOBL::Org::Party]
38
43
  property :seller, GOBL::Org::Party
39
44
 
@@ -7,30 +7,170 @@
7
7
 
8
8
  module GOBL
9
9
  module Bill
10
- # Payment contains details as to how the invoice should be paid.
10
+ # A Payment is used to link an invoice or invoices with a payment transaction.
11
11
  class Payment < GOBL::Object
12
12
  # The Schema ID of the GOBL Payment structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Payment'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/payment'
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
+ 'request' => 'A payment request sent from the supplier to a customer indicating that they are
61
+ requesting a transfer of funds from the customer directly or a payer.
62
+ This is used to request payment for specific documents and invoices.',
63
+ 'advice' => 'A remittance advice sent from the customer to the supplier reflecting that payment for
64
+ the referenced documents has been made.',
65
+ 'receipt' => 'A payment receipt sent from the supplier to a customer indicating that they have
66
+ received a transfer of funds from the customer directly or a payer.
67
+ This is the default payment type and may be required by some tax
68
+ regimes in order to communicate the payment of specific documents and invoices.'
69
+ }.freeze
70
+
71
+ # @!attribute [r] type
72
+ # Type of payment document being issued.
73
+ # @return [GOBL::CBC::Key]
74
+ property :type, GOBL::CBC::Key
75
+ validates_inclusion_of :type, in: TYPE_ENUM.keys, allow_blank: true
76
+
77
+ # @!attribute [r] method
78
+ # Details on how the payment was made based on the original instructions.
79
+ # @return [GOBL::Pay::Instructions]
80
+ property :method, GOBL::Pay::Instructions
81
+
82
+ # @!attribute [r] series
83
+ # Series is used to identify groups of payments 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.
84
+ # @return [GOBL::CBC::Code]
85
+ property :series, GOBL::CBC::Code
86
+
87
+ # @!attribute [r] code
88
+ # Code is a sequential identifier that uniquely identifies the payment. The code can be left empty initially, but is **required** to **sign** the document.
89
+ # @return [GOBL::CBC::Code]
90
+ property :code, GOBL::CBC::Code
91
+
92
+ # @!attribute [r] issue_date
93
+ # When the payment was issued.
94
+ # @return [GOBL::Cal::Date]
95
+ property :issue_date, GOBL::Cal::Date
96
+
97
+ # @!attribute [r] issue_time
98
+ # IssueTime is an optional field that may be useful to indicate the time of day when the payment was issued.
99
+ # @return [GOBL::Cal::Time]
100
+ property :issue_time, GOBL::Cal::Time
101
+
102
+ # @!attribute [r] value_date
103
+ # When the taxes of this payment become accountable, if none set, the issue date is assumed.
104
+ # @return [GOBL::Cal::Date]
105
+ property :value_date, GOBL::Cal::Date
106
+
107
+ # @!attribute [r] currency
108
+ # Currency for all payment totals.
109
+ # @return [GOBL::Currency::Code]
110
+ property :currency, GOBL::Currency::Code
111
+
112
+ # @!attribute [r] exchange_rates
113
+ # Exchange rates to be used when converting the payment's monetary values into other currencies.
114
+ # @return [Array<GOBL::Currency::ExchangeRate>]
115
+ property :exchange_rates, [GOBL::Currency::ExchangeRate]
116
+
117
+ # @!attribute [r] ext
118
+ # Extensions for additional codes that may be required.
119
+ # @return [GOBL::Tax::Extensions]
120
+ property :ext, GOBL::Tax::Extensions
121
+
122
+ # @!attribute [r] preceding
123
+ # Key information regarding previous versions of this document.
124
+ # @return [Array<GOBL::Org::DocumentRef>]
125
+ property :preceding, [GOBL::Org::DocumentRef]
126
+
127
+ # @!attribute [r] supplier
128
+ # The taxable entity who is responsible for supplying goods or services.
129
+ # @return [GOBL::Org::Party]
130
+ property :supplier, GOBL::Org::Party
131
+ validates_presence_of :supplier
132
+
133
+ # @!attribute [r] customer
134
+ # Legal entity that receives the goods or services.
135
+ # @return [GOBL::Org::Party]
136
+ property :customer, GOBL::Org::Party
14
137
 
15
138
  # @!attribute [r] payee
16
- # The party responsible for receiving payment of the invoice, if not the supplier.
139
+ # Legal entity that receives the payment if not the supplier.
17
140
  # @return [GOBL::Org::Party]
18
141
  property :payee, GOBL::Org::Party
19
142
 
20
- # @!attribute [r] terms
21
- # Payment terms or conditions.
22
- # @return [GOBL::Pay::Terms]
23
- property :terms, GOBL::Pay::Terms
143
+ # @!attribute [r] lines
144
+ # List of documents that are being paid for.
145
+ # @return [Array<PaymentLine>]
146
+ property :lines, [PaymentLine]
147
+ validates_presence_of :lines
24
148
 
25
- # @!attribute [r] advances
26
- # Any amounts that have been paid in advance and should be deducted from the amount due.
27
- # @return [Array<GOBL::Pay::Advance>]
28
- property :advances, [GOBL::Pay::Advance]
149
+ # @!attribute [r] ordering
150
+ # Ordering allows for additional information about the ordering process including references to other documents and alternative parties involved in the order-to-delivery process.
151
+ # @return [GOBL::Bill::Ordering]
152
+ property :ordering, GOBL::Bill::Ordering
29
153
 
30
- # @!attribute [r] instructions
31
- # Details on how payment should be made.
32
- # @return [GOBL::Pay::Instructions]
33
- property :instructions, GOBL::Pay::Instructions
154
+ # @!attribute [r] total
155
+ # Total amount to be paid in this payment, either positive or negative according to the line types and totals. Calculated automatically.
156
+ # @return [GOBL::Num::Amount]
157
+ property :total, GOBL::Num::Amount
158
+ validates_presence_of :total
159
+
160
+ # @!attribute [r] notes
161
+ # Unstructured information that is relevant to the payment, such as correction or additional legal details.
162
+ # @return [Array<GOBL::Org::Note>]
163
+ property :notes, [GOBL::Org::Note]
164
+
165
+ # @!attribute [r] complements
166
+ # Additional complementary objects that add relevant information to the payment.
167
+ # @return [Array<GOBL::Schema::Object>]
168
+ property :complements, [GOBL::Schema::Object]
169
+
170
+ # @!attribute [r] meta
171
+ # Additional semi-structured data that doesn't fit into the body of the invoice.
172
+ # @return [GOBL::CBC::Meta]
173
+ property :meta, GOBL::CBC::Meta
34
174
  end
35
175
  end
36
176
  end
@@ -0,0 +1,36 @@
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
+ # PaymentDetails contains details as to how the invoice should be paid.
11
+ class PaymentDetails < GOBL::Object
12
+ # The Schema ID of the GOBL PaymentDetails structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/bill/payment-details'
14
+
15
+ # @!attribute [r] payee
16
+ # The party responsible for receiving payment of the invoice, if not the supplier.
17
+ # @return [GOBL::Org::Party]
18
+ property :payee, GOBL::Org::Party
19
+
20
+ # @!attribute [r] terms
21
+ # Payment terms or conditions.
22
+ # @return [GOBL::Pay::Terms]
23
+ property :terms, GOBL::Pay::Terms
24
+
25
+ # @!attribute [r] advances
26
+ # Any amounts that have been paid in advance and should be deducted from the amount due.
27
+ # @return [Array<GOBL::Pay::Advance>]
28
+ property :advances, [GOBL::Pay::Advance]
29
+
30
+ # @!attribute [r] instructions
31
+ # Details on how payment should be made.
32
+ # @return [GOBL::Pay::Instructions]
33
+ property :instructions, GOBL::Pay::Instructions
34
+ end
35
+ end
36
+ end