gobl 0.24.1 → 0.24.3

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 (96) hide show
  1. checksums.yaml +4 -4
  2. data/data/addons/br-nfe-v4.json +481 -0
  3. data/data/addons/br-nfse-v1.json +235 -0
  4. data/data/addons/co-dian-v2.json +311 -0
  5. data/data/addons/de-xrechnung-v3.json +16 -0
  6. data/data/addons/de-zugferd-v2.json +16 -0
  7. data/data/addons/es-facturae-v3.json +359 -0
  8. data/data/addons/es-tbai-v1.json +225 -0
  9. data/data/addons/es-verifactu-v1.json +609 -0
  10. data/data/addons/eu-en16931-v2017.json +92 -0
  11. data/data/addons/fr-choruspro-v1.json +260 -0
  12. data/data/addons/fr-facturx-v1.json +16 -0
  13. data/data/addons/gr-mydata-v1.json +1495 -0
  14. data/data/addons/it-sdi-v1.json +1570 -0
  15. data/data/addons/it-ticket-v1.json +144 -0
  16. data/data/addons/mx-cfdi-v4.json +908 -0
  17. data/data/addons/pl-favat-v2.json +235 -0
  18. data/data/addons/pt-saft-v1.json +950 -0
  19. data/data/catalogues/cef.json +374 -0
  20. data/data/catalogues/iso.json +19 -0
  21. data/data/catalogues/untdid.json +10669 -0
  22. data/data/currency/iso.json +2378 -0
  23. data/data/currency/non-iso.json +128 -0
  24. data/data/schemas/bill/charge.json +125 -0
  25. data/data/schemas/bill/correction-options.json +54 -0
  26. data/data/schemas/bill/delivery-details.json +41 -0
  27. data/data/schemas/bill/delivery.json +412 -0
  28. data/data/schemas/bill/discount.json +137 -0
  29. data/data/schemas/bill/invoice.json +423 -0
  30. data/data/schemas/bill/line.json +433 -0
  31. data/data/schemas/bill/order.json +401 -0
  32. data/data/schemas/bill/ordering.json +107 -0
  33. data/data/schemas/bill/payment-details.json +36 -0
  34. data/data/schemas/bill/payment.json +424 -0
  35. data/data/schemas/bill/tax.json +45 -0
  36. data/data/schemas/bill/totals.json +84 -0
  37. data/data/schemas/cal/date-time.json +13 -0
  38. data/data/schemas/cal/date.json +13 -0
  39. data/data/schemas/cal/period.json +32 -0
  40. data/data/schemas/cal/time.json +13 -0
  41. data/data/schemas/cbc/code-map.json +16 -0
  42. data/data/schemas/cbc/code.json +15 -0
  43. data/data/schemas/cbc/definition.json +67 -0
  44. data/data/schemas/cbc/key.json +15 -0
  45. data/data/schemas/cbc/meta.json +16 -0
  46. data/data/schemas/cbc/source.json +37 -0
  47. data/data/schemas/currency/amount.json +32 -0
  48. data/data/schemas/currency/code.json +734 -0
  49. data/data/schemas/currency/exchange-rate.json +43 -0
  50. data/data/schemas/dsig/digest.json +27 -0
  51. data/data/schemas/dsig/signature.json +12 -0
  52. data/data/schemas/envelope.json +41 -0
  53. data/data/schemas/head/header.json +62 -0
  54. data/data/schemas/head/link.json +42 -0
  55. data/data/schemas/head/stamp.json +27 -0
  56. data/data/schemas/i18n/string.json +18 -0
  57. data/data/schemas/l10n/code.json +13 -0
  58. data/data/schemas/l10n/iso-country-code.json +1010 -0
  59. data/data/schemas/l10n/tax-country-code.json +1022 -0
  60. data/data/schemas/note/message.json +43 -0
  61. data/data/schemas/num/amount.json +13 -0
  62. data/data/schemas/num/percentage.json +13 -0
  63. data/data/schemas/org/address.json +105 -0
  64. data/data/schemas/org/attachment.json +58 -0
  65. data/data/schemas/org/coordinates.json +33 -0
  66. data/data/schemas/org/document-ref.json +117 -0
  67. data/data/schemas/org/email.json +37 -0
  68. data/data/schemas/org/identity.json +57 -0
  69. data/data/schemas/org/image.json +70 -0
  70. data/data/schemas/org/inbox.json +49 -0
  71. data/data/schemas/org/item.json +96 -0
  72. data/data/schemas/org/name.json +59 -0
  73. data/data/schemas/org/note.json +184 -0
  74. data/data/schemas/org/party.json +129 -0
  75. data/data/schemas/org/person.json +90 -0
  76. data/data/schemas/org/registration.json +66 -0
  77. data/data/schemas/org/telephone.json +32 -0
  78. data/data/schemas/org/unit.json +350 -0
  79. data/data/schemas/org/website.json +38 -0
  80. data/data/schemas/pay/advance.json +211 -0
  81. data/data/schemas/pay/instructions.json +245 -0
  82. data/data/schemas/pay/terms.json +128 -0
  83. data/data/schemas/regimes/mx/food-vouchers.json +111 -0
  84. data/data/schemas/regimes/mx/fuel-account-balance.json +179 -0
  85. data/data/schemas/schema/object.json +12 -0
  86. data/data/schemas/tax/addon-def.json +288 -0
  87. data/data/schemas/tax/catalogue-def.json +37 -0
  88. data/data/schemas/tax/extensions.json +16 -0
  89. data/data/schemas/tax/identity.json +45 -0
  90. data/data/schemas/tax/regime-def.json +513 -0
  91. data/data/schemas/tax/set.json +139 -0
  92. data/data/schemas/tax/total.json +135 -0
  93. data/lib/gobl/extensions/tax/addon_helper.rb +37 -0
  94. data/lib/gobl/version.rb +1 -1
  95. data/lib/gobl.rb +1 -0
  96. metadata +93 -1
@@ -0,0 +1,424 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/bill/payment",
4
+ "$ref": "#/$defs/Payment",
5
+ "$defs": {
6
+ "Payment": {
7
+ "properties": {
8
+ "$regime": {
9
+ "$ref": "https://gobl.org/draft-0/l10n/tax-country-code",
10
+ "oneOf": [
11
+ {
12
+ "const": "AE",
13
+ "title": "United Arab Emirates"
14
+ },
15
+ {
16
+ "const": "AT",
17
+ "title": "Austria"
18
+ },
19
+ {
20
+ "const": "BE",
21
+ "title": "Belgium"
22
+ },
23
+ {
24
+ "const": "BR",
25
+ "title": "Brazil"
26
+ },
27
+ {
28
+ "const": "CA",
29
+ "title": "Canada"
30
+ },
31
+ {
32
+ "const": "CH",
33
+ "title": "Switzerland"
34
+ },
35
+ {
36
+ "const": "CO",
37
+ "title": "Colombia"
38
+ },
39
+ {
40
+ "const": "DE",
41
+ "title": "Germany"
42
+ },
43
+ {
44
+ "const": "EL",
45
+ "title": "Greece"
46
+ },
47
+ {
48
+ "const": "ES",
49
+ "title": "Spain"
50
+ },
51
+ {
52
+ "const": "FR",
53
+ "title": "France"
54
+ },
55
+ {
56
+ "const": "GB",
57
+ "title": "United Kingdom"
58
+ },
59
+ {
60
+ "const": "IE",
61
+ "title": "Ireland"
62
+ },
63
+ {
64
+ "const": "IN",
65
+ "title": "India"
66
+ },
67
+ {
68
+ "const": "IT",
69
+ "title": "Italy"
70
+ },
71
+ {
72
+ "const": "MX",
73
+ "title": "Mexico"
74
+ },
75
+ {
76
+ "const": "NL",
77
+ "title": "The Netherlands"
78
+ },
79
+ {
80
+ "const": "PL",
81
+ "title": "Poland"
82
+ },
83
+ {
84
+ "const": "PT",
85
+ "title": "Portugal"
86
+ },
87
+ {
88
+ "const": "SE",
89
+ "title": "Sweden"
90
+ },
91
+ {
92
+ "const": "SG",
93
+ "title": "Singapore"
94
+ },
95
+ {
96
+ "const": "US",
97
+ "title": "United States of America"
98
+ }
99
+ ],
100
+ "title": "Tax Regime"
101
+ },
102
+ "$addons": {
103
+ "items": {
104
+ "$ref": "https://gobl.org/draft-0/cbc/key",
105
+ "oneOf": [
106
+ {
107
+ "const": "br-nfe-v4",
108
+ "title": "Brazil NF-e 4.00"
109
+ },
110
+ {
111
+ "const": "br-nfse-v1",
112
+ "title": "Brazil NFS-e 1.X"
113
+ },
114
+ {
115
+ "const": "co-dian-v2",
116
+ "title": "Colombia DIAN UBL 2.X"
117
+ },
118
+ {
119
+ "const": "de-xrechnung-v3",
120
+ "title": "German XRechnung 3.X"
121
+ },
122
+ {
123
+ "const": "de-zugferd-v2",
124
+ "title": "German ZUGFeRD 2.X"
125
+ },
126
+ {
127
+ "const": "es-facturae-v3",
128
+ "title": "Spain FacturaE"
129
+ },
130
+ {
131
+ "const": "es-tbai-v1",
132
+ "title": "Spain TicketBAI"
133
+ },
134
+ {
135
+ "const": "es-verifactu-v1",
136
+ "title": "Spain VERI*FACTU V1"
137
+ },
138
+ {
139
+ "const": "eu-en16931-v2017",
140
+ "title": "EN 16931-1:2017"
141
+ },
142
+ {
143
+ "const": "fr-choruspro-v1",
144
+ "title": "Chorus Pro"
145
+ },
146
+ {
147
+ "const": "fr-facturx-v1",
148
+ "title": "French Factur-X v1"
149
+ },
150
+ {
151
+ "const": "gr-mydata-v1",
152
+ "title": "Greece MyData v1.x"
153
+ },
154
+ {
155
+ "const": "it-sdi-v1",
156
+ "title": "Italy SDI FatturaPA v1.x"
157
+ },
158
+ {
159
+ "const": "it-ticket-v1",
160
+ "title": "Italy AdE ticket v1.x"
161
+ },
162
+ {
163
+ "const": "mx-cfdi-v4",
164
+ "title": "Mexican SAT CFDI v4.X"
165
+ },
166
+ {
167
+ "const": "pl-favat-v2",
168
+ "title": "Polish KSeF FA_VAT v2.x"
169
+ },
170
+ {
171
+ "const": "pt-saft-v1",
172
+ "title": "Portugal SAF-T"
173
+ }
174
+ ]
175
+ },
176
+ "type": "array",
177
+ "title": "Addons",
178
+ "description": "Addons defines a list of keys used to identify tax addons that apply special\nnormalization, scenarios, and validation rules to a document."
179
+ },
180
+ "$tags": {
181
+ "items": {
182
+ "$ref": "https://gobl.org/draft-0/cbc/key"
183
+ },
184
+ "type": "array",
185
+ "title": "Tags",
186
+ "description": "Tags are used to help identify specific tax scenarios or requirements that may\napply changes to the contents of the document or imply a specific meaning.\nConverters may use tags to help identify specific situations that do not have\na specific extension, for example; self-billed or partial invoices may be\nidentified by their respective tags."
187
+ },
188
+ "uuid": {
189
+ "type": "string",
190
+ "format": "uuid",
191
+ "title": "UUID",
192
+ "description": "Universally Unique Identifier."
193
+ },
194
+ "type": {
195
+ "$ref": "https://gobl.org/draft-0/cbc/key",
196
+ "oneOf": [
197
+ {
198
+ "const": "request",
199
+ "title": "Request",
200
+ "description": "A payment request sent from the supplier to a customer indicating that they are\nrequesting a transfer of funds from the customer directly or a payer.\nThis is used to request payment for specific documents and invoices."
201
+ },
202
+ {
203
+ "const": "advice",
204
+ "title": "Advice",
205
+ "description": "A remittance advice sent from the customer to the supplier reflecting that payment for\nthe referenced documents has been made."
206
+ },
207
+ {
208
+ "const": "receipt",
209
+ "title": "Receipt",
210
+ "description": "A payment receipt sent from the supplier to a customer indicating that they have\nreceived a transfer of funds from the customer directly or a payer.\nThis is the default payment type and may be required by some tax\nregimes in order to communicate the payment of specific documents and invoices."
211
+ }
212
+ ],
213
+ "title": "Type",
214
+ "description": "Type of payment document being issued.",
215
+ "calculated": true
216
+ },
217
+ "method": {
218
+ "$ref": "https://gobl.org/draft-0/pay/instructions",
219
+ "title": "Method",
220
+ "description": "Details on how the payment was made based on the original instructions."
221
+ },
222
+ "series": {
223
+ "$ref": "https://gobl.org/draft-0/cbc/code",
224
+ "title": "Series",
225
+ "description": "Series is used to identify groups of payments by date, business area, project,\ntype, customer, a combination of any, or other company specific data.\nIf the output format does not support the series as a separate field, it will be\nprepended to the code for presentation with a dash (`-`) for separation."
226
+ },
227
+ "code": {
228
+ "$ref": "https://gobl.org/draft-0/cbc/code",
229
+ "title": "Code",
230
+ "description": "Code is a sequential identifier that uniquely identifies the payment. The code can\nbe left empty initially, but is **required** to **sign** the document."
231
+ },
232
+ "issue_date": {
233
+ "$ref": "https://gobl.org/draft-0/cal/date",
234
+ "title": "Issue Date",
235
+ "description": "When the payment was issued.",
236
+ "calculated": true
237
+ },
238
+ "issue_time": {
239
+ "$ref": "https://gobl.org/draft-0/cal/time",
240
+ "title": "Issue Time",
241
+ "description": "IssueTime is an optional field that may be useful to indicate the time of day when\nthe payment was issued.",
242
+ "calculated": true
243
+ },
244
+ "value_date": {
245
+ "$ref": "https://gobl.org/draft-0/cal/date",
246
+ "title": "Value Date",
247
+ "description": "When the taxes of this payment become accountable, if none set, the issue date is assumed."
248
+ },
249
+ "currency": {
250
+ "$ref": "https://gobl.org/draft-0/currency/code",
251
+ "title": "Currency",
252
+ "description": "Currency for all payment totals.",
253
+ "calculated": true
254
+ },
255
+ "exchange_rates": {
256
+ "items": {
257
+ "$ref": "https://gobl.org/draft-0/currency/exchange-rate"
258
+ },
259
+ "type": "array",
260
+ "title": "Exchange Rates",
261
+ "description": "Exchange rates to be used when converting the payment's monetary values into other currencies."
262
+ },
263
+ "ext": {
264
+ "$ref": "https://gobl.org/draft-0/tax/extensions",
265
+ "title": "Extensions",
266
+ "description": "Extensions for additional codes that may be required."
267
+ },
268
+ "preceding": {
269
+ "items": {
270
+ "$ref": "https://gobl.org/draft-0/org/document-ref"
271
+ },
272
+ "type": "array",
273
+ "title": "Preceding Details",
274
+ "description": "Key information regarding previous versions of this document."
275
+ },
276
+ "supplier": {
277
+ "$ref": "https://gobl.org/draft-0/org/party",
278
+ "title": "Supplier",
279
+ "description": "The taxable entity who is responsible for supplying goods or services."
280
+ },
281
+ "customer": {
282
+ "$ref": "https://gobl.org/draft-0/org/party",
283
+ "title": "Customer",
284
+ "description": "Legal entity that receives the goods or services."
285
+ },
286
+ "payee": {
287
+ "$ref": "https://gobl.org/draft-0/org/party",
288
+ "title": "Payee",
289
+ "description": "Legal entity that receives the payment if not the supplier."
290
+ },
291
+ "lines": {
292
+ "items": {
293
+ "$ref": "#/$defs/PaymentLine"
294
+ },
295
+ "type": "array",
296
+ "title": "Lines",
297
+ "description": "List of documents that are being paid for."
298
+ },
299
+ "ordering": {
300
+ "$ref": "https://gobl.org/draft-0/bill/ordering",
301
+ "title": "Ordering",
302
+ "description": "Ordering allows for additional information about the ordering process including references\nto other documents and alternative parties involved in the order-to-delivery process."
303
+ },
304
+ "total": {
305
+ "$ref": "https://gobl.org/draft-0/num/amount",
306
+ "title": "Total",
307
+ "description": "Total amount to be paid in this payment, either positive or negative according to the\nline types and totals. Calculated automatically."
308
+ },
309
+ "notes": {
310
+ "items": {
311
+ "$ref": "https://gobl.org/draft-0/org/note"
312
+ },
313
+ "type": "array",
314
+ "title": "Notes",
315
+ "description": "Unstructured information that is relevant to the payment, such as correction or additional\nlegal details."
316
+ },
317
+ "complements": {
318
+ "items": {
319
+ "$ref": "https://gobl.org/draft-0/schema/object"
320
+ },
321
+ "type": "array",
322
+ "title": "Complements",
323
+ "description": "Additional complementary objects that add relevant information to the payment."
324
+ },
325
+ "meta": {
326
+ "$ref": "https://gobl.org/draft-0/cbc/meta",
327
+ "title": "Meta",
328
+ "description": "Additional semi-structured data that doesn't fit into the body of the invoice."
329
+ }
330
+ },
331
+ "type": "object",
332
+ "required": [
333
+ "type",
334
+ "issue_date",
335
+ "currency",
336
+ "supplier",
337
+ "lines",
338
+ "total"
339
+ ],
340
+ "description": "A Payment is used to link an invoice or invoices with a payment transaction.",
341
+ "recommended": [
342
+ "$regime",
343
+ "series",
344
+ "code",
345
+ "lines"
346
+ ]
347
+ },
348
+ "PaymentLine": {
349
+ "properties": {
350
+ "uuid": {
351
+ "type": "string",
352
+ "format": "uuid",
353
+ "title": "UUID",
354
+ "description": "Universally Unique Identifier."
355
+ },
356
+ "i": {
357
+ "type": "integer",
358
+ "title": "Index",
359
+ "description": "Line number within the parent document (automatically calculated)",
360
+ "calculated": true
361
+ },
362
+ "refund": {
363
+ "type": "boolean",
364
+ "title": "Refund",
365
+ "description": "Indicates whether this payment is a refund of a previous payment, effectively reversing\nthe flow of funds between the supplier and customer or their representatives."
366
+ },
367
+ "document": {
368
+ "$ref": "https://gobl.org/draft-0/org/document-ref",
369
+ "title": "Document",
370
+ "description": "Reference to the document being paid"
371
+ },
372
+ "installment": {
373
+ "type": "integer",
374
+ "title": "Installment",
375
+ "description": "When making multiple payments for a single document, this specifies the\ninstallment number for this payment line."
376
+ },
377
+ "description": {
378
+ "type": "string",
379
+ "title": "Description",
380
+ "description": "Additional human readable description of the payment line which may be useful for\nexplaining the purpose or special conditions. Notes should be used for more\nformal comments."
381
+ },
382
+ "payable": {
383
+ "$ref": "https://gobl.org/draft-0/num/amount",
384
+ "title": "Payable",
385
+ "description": "Payable reflects the amount of the document that is payable. This will be\ncalculated from the embedded document's amount automatically and converted\nto the currency of the document."
386
+ },
387
+ "advances": {
388
+ "$ref": "https://gobl.org/draft-0/num/amount",
389
+ "title": "Advances",
390
+ "description": "Amount already paid in previous installments, which may be required\nby some tax regimes or specific use cases."
391
+ },
392
+ "amount": {
393
+ "$ref": "https://gobl.org/draft-0/num/amount",
394
+ "title": "Amount",
395
+ "description": "Amount of the total payment allocated to the referenced document."
396
+ },
397
+ "due": {
398
+ "$ref": "https://gobl.org/draft-0/num/amount",
399
+ "title": "Due",
400
+ "description": "Due reflects how much still needs to be paid"
401
+ },
402
+ "tax": {
403
+ "$ref": "https://gobl.org/draft-0/tax/total",
404
+ "title": "Tax",
405
+ "description": "Tax contains a breakdown of the taxes that will be applied to this payment line\nafter taking into account currency conversion and the relative amounts."
406
+ },
407
+ "notes": {
408
+ "items": {
409
+ "$ref": "https://gobl.org/draft-0/org/note"
410
+ },
411
+ "type": "array",
412
+ "title": "Notes",
413
+ "description": "Additional notes specific to this line item for clarification purposes"
414
+ }
415
+ },
416
+ "type": "object",
417
+ "required": [
418
+ "i",
419
+ "amount"
420
+ ],
421
+ "description": "PaymentLine defines the details of a line item in a payment document."
422
+ }
423
+ }
424
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/bill/tax",
4
+ "$ref": "#/$defs/Tax",
5
+ "$defs": {
6
+ "Tax": {
7
+ "properties": {
8
+ "prices_include": {
9
+ "$ref": "https://gobl.org/draft-0/cbc/code",
10
+ "title": "Prices Include",
11
+ "description": "Category of the tax already included in the line item prices, especially\nuseful for B2C retailers with customers who prefer final prices inclusive of\ntax."
12
+ },
13
+ "rounding": {
14
+ "$ref": "https://gobl.org/draft-0/cbc/key",
15
+ "oneOf": [
16
+ {
17
+ "const": "precise",
18
+ "title": "Precise",
19
+ "description": "The default method of calculating the totals in GOBL, and provides the best results\nfor most cases as the precision is maintained to the maximum amount possible. The\ntradeoff however is that sometimes the totals may not sum exactly based on what is visible."
20
+ },
21
+ {
22
+ "const": "currency",
23
+ "title": "Currency",
24
+ "description": "The alternative method of calculating the totals that will first round all the amounts\nto the currency's precision before making the sums. Totals using this approach can always\nbe recalculated using the amounts presented, but can lead to rounding errors in the case\nof pre-payments and when line item prices include tax."
25
+ }
26
+ ],
27
+ "title": "Rounding Model",
28
+ "description": "Rounding model used to perform tax calculations on the invoice. This\nwill be configured automatically based on the tax regime, or\n`sum-then-round` by default, but you can override here if needed.\nUse with caution, as some conversion tools may make assumptions about\nthe rounding model used."
29
+ },
30
+ "ext": {
31
+ "$ref": "https://gobl.org/draft-0/tax/extensions",
32
+ "title": "Extensions",
33
+ "description": "Additional extensions that are applied to the invoice as a whole as opposed to specific\nsections."
34
+ },
35
+ "meta": {
36
+ "$ref": "https://gobl.org/draft-0/cbc/meta",
37
+ "title": "Meta",
38
+ "description": "Any additional data that may be required for processing, but should never\nbe relied upon by recipients."
39
+ }
40
+ },
41
+ "type": "object",
42
+ "description": "Tax defines a summary of the taxes which may be applied to an invoice."
43
+ }
44
+ }
45
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/bill/totals",
4
+ "$ref": "#/$defs/Totals",
5
+ "$defs": {
6
+ "Totals": {
7
+ "properties": {
8
+ "sum": {
9
+ "$ref": "https://gobl.org/draft-0/num/amount",
10
+ "title": "Sum",
11
+ "description": "Total of all line item amounts."
12
+ },
13
+ "discount": {
14
+ "$ref": "https://gobl.org/draft-0/num/amount",
15
+ "title": "Discount",
16
+ "description": "Total of all discounts applied at the document level."
17
+ },
18
+ "charge": {
19
+ "$ref": "https://gobl.org/draft-0/num/amount",
20
+ "title": "Charge",
21
+ "description": "Total of all charges applied at the document level."
22
+ },
23
+ "tax_included": {
24
+ "$ref": "https://gobl.org/draft-0/num/amount",
25
+ "title": "Tax Included",
26
+ "description": "Total tax amount included in the prices, if prices are tax-inclusive."
27
+ },
28
+ "total": {
29
+ "$ref": "https://gobl.org/draft-0/num/amount",
30
+ "title": "Total",
31
+ "description": "Net total amount after subtracting discounts and adding charges, excluding tax."
32
+ },
33
+ "taxes": {
34
+ "$ref": "https://gobl.org/draft-0/tax/total",
35
+ "title": "Tax Totals",
36
+ "description": "Detailed breakdown of all taxes applied to the invoice."
37
+ },
38
+ "tax": {
39
+ "$ref": "https://gobl.org/draft-0/num/amount",
40
+ "title": "Tax",
41
+ "description": "Total indirect tax amount to be applied to the invoice."
42
+ },
43
+ "total_with_tax": {
44
+ "$ref": "https://gobl.org/draft-0/num/amount",
45
+ "title": "Total with Tax",
46
+ "description": "Final total amount after applying indirect taxes."
47
+ },
48
+ "retained_tax": {
49
+ "$ref": "https://gobl.org/draft-0/num/amount",
50
+ "title": "Retained Tax",
51
+ "description": "Total tax amount retained or withheld by the customer to be paid to the tax authority."
52
+ },
53
+ "rounding": {
54
+ "$ref": "https://gobl.org/draft-0/num/amount",
55
+ "title": "Rounding",
56
+ "description": "Adjustment amount applied to the invoice totals to meet rounding rules or expectations."
57
+ },
58
+ "payable": {
59
+ "$ref": "https://gobl.org/draft-0/num/amount",
60
+ "title": "Payable",
61
+ "description": "Final amount to be paid after retained taxes and rounding adjustments."
62
+ },
63
+ "advance": {
64
+ "$ref": "https://gobl.org/draft-0/num/amount",
65
+ "title": "Advance",
66
+ "description": "Total amount already paid in advance by the customer."
67
+ },
68
+ "due": {
69
+ "$ref": "https://gobl.org/draft-0/num/amount",
70
+ "title": "Due",
71
+ "description": "Remaining amount that needs to be paid."
72
+ }
73
+ },
74
+ "type": "object",
75
+ "required": [
76
+ "sum",
77
+ "total",
78
+ "total_with_tax",
79
+ "payable"
80
+ ],
81
+ "description": "Totals contains the summaries of all calculations for the invoice."
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cal/date-time",
4
+ "$ref": "#/$defs/DateTime",
5
+ "$defs": {
6
+ "DateTime": {
7
+ "type": "string",
8
+ "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$",
9
+ "title": "Date Time",
10
+ "description": "Civil date time in simplified ISO format with no time zone\nnor location information, for example: 2021-05-26T13:45:00"
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cal/date",
4
+ "$ref": "#/$defs/Date",
5
+ "$defs": {
6
+ "Date": {
7
+ "type": "string",
8
+ "format": "date",
9
+ "title": "Date",
10
+ "description": "Civil date in simplified ISO format, like 2021-05-26"
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,32 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cal/period",
4
+ "$ref": "#/$defs/Period",
5
+ "$defs": {
6
+ "Period": {
7
+ "properties": {
8
+ "label": {
9
+ "type": "string",
10
+ "title": "Label",
11
+ "description": "Label is a short description of the period."
12
+ },
13
+ "start": {
14
+ "$ref": "https://gobl.org/draft-0/cal/date",
15
+ "title": "Start",
16
+ "description": "Start indicates when this period starts."
17
+ },
18
+ "end": {
19
+ "$ref": "https://gobl.org/draft-0/cal/date",
20
+ "title": "End",
21
+ "description": "End indicates when the period ends, and must be after the start date."
22
+ }
23
+ },
24
+ "type": "object",
25
+ "required": [
26
+ "start",
27
+ "end"
28
+ ],
29
+ "description": "Period represents two dates with a start and finish."
30
+ }
31
+ }
32
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cal/time",
4
+ "$ref": "#/$defs/Time",
5
+ "$defs": {
6
+ "Time": {
7
+ "type": "string",
8
+ "pattern": "^([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]$",
9
+ "title": "Time",
10
+ "description": "Civil time in simplified ISO format, like 13:45:30"
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cbc/code-map",
4
+ "$ref": "#/$defs/CodeMap",
5
+ "$defs": {
6
+ "CodeMap": {
7
+ "patternProperties": {
8
+ "^(?:[a-z]|[a-z0-9][a-z0-9-+]*[a-z0-9])$": {
9
+ "$ref": "https://gobl.org/draft-0/cbc/code"
10
+ }
11
+ },
12
+ "type": "object",
13
+ "description": "CodeMap is a map of keys to specific codes, useful to determine regime specific codes from their key counterparts."
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://gobl.org/draft-0/cbc/code",
4
+ "$ref": "#/$defs/Code",
5
+ "$defs": {
6
+ "Code": {
7
+ "type": "string",
8
+ "maxLength": 64,
9
+ "minLength": 1,
10
+ "pattern": "^[A-Za-z0-9]+([\\.\\-\\:/,_ ]?[A-Za-z0-9]+)*$",
11
+ "title": "Code",
12
+ "description": "Alphanumerical text identifier with upper-case letters and limits on using\nspecial characters or whitespace to separate blocks."
13
+ }
14
+ }
15
+ }