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
@@ -38,10 +38,15 @@ module GOBL
38
38
  property :code, GOBL::CBC::Code
39
39
  validates_presence_of :code
40
40
 
41
- # @!attribute [r] line
42
- # Line index number inside the document, if relevant.
43
- # @return [Integer]
44
- property :line, Integer
41
+ # @!attribute [r] currency
42
+ # Currency used in the document, if different from the parent's currency.
43
+ # @return [GOBL::Currency::Code]
44
+ property :currency, GOBL::Currency::Code
45
+
46
+ # @!attribute [r] lines
47
+ # Line index numbers inside the document, if relevant.
48
+ # @return [Array<Integer>]
49
+ property :lines, [Integer]
45
50
 
46
51
  # @!attribute [r] identities
47
52
  # List of additional codes, IDs, or SKUs which can be used to identify the document or its contents, agreed upon by the supplier and customer.
@@ -64,7 +69,7 @@ module GOBL
64
69
  property :description, String
65
70
 
66
71
  # @!attribute [r] stamps
67
- # Seals of approval from other organisations that may need to be listed.
72
+ # Seals of approval from other organizations that may need to be listed.
68
73
  # @return [Array<GOBL::Head::Stamp>]
69
74
  property :stamps, [GOBL::Head::Stamp]
70
75
 
@@ -73,6 +78,16 @@ module GOBL
73
78
  # @return [String]
74
79
  property :url, String
75
80
 
81
+ # @!attribute [r] tax
82
+ # Tax total breakdown from the original document in the provided currency. Should only be included if required by a specific tax regime or addon.
83
+ # @return [GOBL::Tax::Total]
84
+ property :tax, GOBL::Tax::Total
85
+
86
+ # @!attribute [r] payable
87
+ # Payable is the total amount that is payable in the referenced document. Only needed for specific tax regimes or addons. This may also be used in some scenarios to determine the proportion of the referenced document that has been paid, and calculate the remaining amount due and taxes.
88
+ # @return [GOBL::Num::Amount]
89
+ property :payable, GOBL::Num::Amount
90
+
76
91
  # @!attribute [r] ext
77
92
  # Extensions for additional codes that may be required.
78
93
  # @return [GOBL::Tax::Extensions]
@@ -28,7 +28,7 @@ module GOBL
28
28
  property :country, GOBL::L10n::ISOCountryCode
29
29
 
30
30
  # @!attribute [r] key
31
- # Uniquely classify this identity using a key instead of a code.
31
+ # Uniquely classify this identity using a key instead of a type.
32
32
  # @return [GOBL::CBC::Key]
33
33
  property :key, GOBL::CBC::Key
34
34
 
@@ -47,6 +47,11 @@ module GOBL
47
47
  # Description adds details about what the code could mean or imply
48
48
  # @return [String]
49
49
  property :description, String
50
+
51
+ # @!attribute [r] ext
52
+ # Ext provides a way to add additional information to the identity.
53
+ # @return [GOBL::Tax::Extensions]
54
+ property :ext, GOBL::Tax::Extensions
50
55
  end
51
56
  end
52
57
  end
@@ -7,7 +7,7 @@
7
7
 
8
8
  module GOBL
9
9
  module Org
10
- # Inbox is used to store data about a connection with a service that is responsible for potentially receiving copies of GOBL envelopes or other document formats defined locally.
10
+ # Inbox is used to store data about a connection with a service that is responsible for automatically receiving copies of GOBL envelopes or other document formats.
11
11
  class Inbox < GOBL::Object
12
12
  # The Schema ID of the GOBL Inbox structure
13
13
  SCHEMA_ID = 'https://gobl.org/draft-0/org/inbox'
@@ -17,27 +17,35 @@ module GOBL
17
17
  # @return [String]
18
18
  property :uuid, String
19
19
 
20
+ # @!attribute [r] label
21
+ # Label for the inbox.
22
+ # @return [String]
23
+ property :label, String
24
+
20
25
  # @!attribute [r] key
21
- # Type of inbox being defined.
26
+ # Type of inbox being defined if required for clarification between multiple inboxes.
22
27
  # @return [GOBL::CBC::Key]
23
28
  property :key, GOBL::CBC::Key
24
- validates_presence_of :key
25
29
 
26
- # @!attribute [r] role
27
- # Role assigned to this inbox that may be relevant for the consumer.
28
- # @return [GOBL::CBC::Key]
29
- property :role, GOBL::CBC::Key
30
+ # @!attribute [r] scheme
31
+ # Scheme ID of the code used to identify the inbox. This is context specific and usually an ISO 6523 code or CEF (Connecting Europe Facility) code.
32
+ # @return [GOBL::CBC::Code]
33
+ property :scheme, GOBL::CBC::Code
30
34
 
31
- # @!attribute [r] name
32
- # Human name for the inbox.
35
+ # @!attribute [r] code
36
+ # Code or ID that identifies the Inbox. Mutually exclusive with URL and Email.
37
+ # @return [GOBL::CBC::Code]
38
+ property :code, GOBL::CBC::Code
39
+
40
+ # @!attribute [r] url
41
+ # URL of the inbox that includes the protocol, server, and path. May be used instead of the Code to identify the inbox. Mutually exclusive with Code and Email.
33
42
  # @return [String]
34
- property :name, String
43
+ property :url, String
35
44
 
36
- # @!attribute [r] code
37
- # Actual Code or ID that identifies the Inbox.
45
+ # @!attribute [r] email
46
+ # Email address for the inbox. Mutually exclusive with Code and URL.
38
47
  # @return [String]
39
- property :code, String
40
- validates_presence_of :code
48
+ property :email, String
41
49
  end
42
50
  end
43
51
  end
@@ -19,8 +19,8 @@ module GOBL
19
19
 
20
20
  # @!attribute [r] ref
21
21
  # Primary reference code that identifies this item. Additional codes can be provided in the 'identities' property.
22
- # @return [String]
23
- property :ref, String
22
+ # @return [GOBL::CBC::Code]
23
+ property :ref, GOBL::CBC::Code
24
24
 
25
25
  # @!attribute [r] key
26
26
  # Special key used to classify the item sometimes required by some regimes.
@@ -52,7 +52,6 @@ module GOBL
52
52
  # Base price of a single unit to be sold.
53
53
  # @return [GOBL::Num::Amount]
54
54
  property :price, GOBL::Num::Amount
55
- validates_presence_of :price
56
55
 
57
56
  # @!attribute [r] alt_prices
58
57
  # AltPrices defines a list of prices with their currencies that may be used as an alternative to the item's base price.
@@ -6,11 +6,16 @@
6
6
  ##
7
7
 
8
8
  module GOBL
9
- module CBC
9
+ module Org
10
10
  # Note represents a free text of additional information that may be added to a document.
11
11
  class Note < GOBL::Object
12
12
  # The Schema ID of the GOBL Note structure
13
- SCHEMA_ID = 'https://gobl.org/draft-0/cbc/note'
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/org/note'
14
+
15
+ # @!attribute [r] uuid
16
+ # Universally Unique Identifier.
17
+ # @return [String]
18
+ property :uuid, String
14
19
 
15
20
  # Enumeration of possible values for {#key} with their corresponding descriptions
16
21
  KEY_ENUM = {
@@ -38,7 +43,8 @@ module GOBL
38
43
  'transport' => 'Transportation information',
39
44
  'delivery' => 'Delivery information',
40
45
  'quarantine' => 'Quarantine information',
41
- 'tax' => 'Tax declaration'
46
+ 'tax' => 'Tax declaration',
47
+ 'other' => 'Mutually defined'
42
48
  }.freeze
43
49
 
44
50
  # @!attribute [r] key
@@ -49,8 +55,8 @@ module GOBL
49
55
 
50
56
  # @!attribute [r] code
51
57
  # Code used for additional data that may be required to identify the note.
52
- # @return [String]
53
- property :code, String
58
+ # @return [GOBL::CBC::Code]
59
+ property :code, GOBL::CBC::Code
54
60
 
55
61
  # @!attribute [r] src
56
62
  # Source of this note, especially useful when auto-generated.
@@ -67,6 +73,11 @@ module GOBL
67
73
  # Additional information about the note
68
74
  # @return [GOBL::CBC::Meta]
69
75
  property :meta, GOBL::CBC::Meta
76
+
77
+ # @!attribute [r] ext
78
+ # Extension data
79
+ # @return [GOBL::Tax::Extensions]
80
+ property :ext, GOBL::Tax::Extensions
70
81
  end
71
82
  end
72
83
  end
@@ -12,6 +12,10 @@ module GOBL
12
12
  # The Schema ID of the GOBL Party structure
13
13
  SCHEMA_ID = 'https://gobl.org/draft-0/org/party'
14
14
 
15
+ # @!attribute [r] $regime
16
+ # @return [GOBL::L10n::TaxCountryCode]
17
+ property :$regime, GOBL::L10n::TaxCountryCode
18
+
15
19
  # @!attribute [r] uuid
16
20
  # Universally Unique Identifier.
17
21
  # @return [String]
@@ -23,7 +23,7 @@ module GOBL
23
23
  property :label, String
24
24
 
25
25
  # @!attribute [r] num
26
- # The number to be dialed in ITU E.164 international format.
26
+ # Free-text string that represents the telephone number.
27
27
  # @return [String]
28
28
  property :num, String
29
29
  validates_presence_of :num
@@ -7,7 +7,7 @@
7
7
 
8
8
  module GOBL
9
9
  module Org
10
- # Unit describes how the quantity of the product should be interpreted either using a GOBL key, or UN/ECE code.
10
+ # Unit defines how the quantity of the product should be interpreted either using a GOBL lower-case key (e.g. 'kg'), or UN/ECE code upper-case code (e.g. 'KGM').
11
11
  class Unit < String
12
12
  # The Schema ID of the GOBL Unit structure
13
13
  SCHEMA_ID = 'https://gobl.org/draft-0/org/unit'
@@ -53,6 +53,7 @@ module GOBL
53
53
  'kit' => 'A unit of count defining the number of kits (kit: tub, barrel or pail).',
54
54
  'basebox' => 'A unit of area of 112 sheets of tin mil products (tin plate, tin free steel or black plate) 14 by 20 inches, or 31,360 square inches.',
55
55
  'pk' => 'A unit of count defining the number of items per bulk pack.',
56
+ 'one' => 'A single generic unit of a service or product.',
56
57
  'bag' => 'Bags',
57
58
  'box' => 'Boxes',
58
59
  'bin' => 'Bins',
@@ -27,11 +27,13 @@ module GOBL
27
27
  'any' => 'Any method available, no preference.',
28
28
  'card' => 'Payment card.',
29
29
  'credit-transfer' => 'Sender initiated bank or wire transfer.',
30
+ 'credit-transfer+sepa' => 'Sender initiated bank or wire transfer via SEPA.',
30
31
  'debit-transfer' => 'Receiver initiated bank or wire transfer.',
31
32
  'cash' => 'Cash in hand.',
32
33
  'cheque' => 'Cheque from bank.',
33
34
  'bank-draft' => 'Bankers Draft or Bank Cheque.',
34
35
  'direct-debit' => 'Direct debit from the customers bank account.',
36
+ 'direct-debit+sepa' => 'Direct debit from the customers bank account via SEPA.',
35
37
  'online' => 'Online or web payment.',
36
38
  'promissory-note' => 'Promissory note contract.',
37
39
  'netting' => 'Intercompany clearing or clearing between partners.',
@@ -60,7 +62,7 @@ module GOBL
60
62
  validates_presence_of :description
61
63
 
62
64
  # @!attribute [r] percent
63
- # How much as a percentage of the total with tax was paid
65
+ # Percentage of the total amount payable that was paid. Note that multiple advances with percentages may lead to rounding errors, especially when the total advances sums to 100%. We recommend only including one advance with a percent value per document.
64
66
  # @return [GOBL::Num::Percentage]
65
67
  property :percent, GOBL::Num::Percentage
66
68
 
@@ -12,17 +12,20 @@ module GOBL
12
12
  # The Schema ID of the GOBL Card structure
13
13
  SCHEMA_ID = 'https://gobl.org/draft-0/pay/instructions#/$defs/Card'
14
14
 
15
+ # @!attribute [r] first6
16
+ # First 6 digits of the card's Primary Account Number (PAN).
17
+ # @return [String]
18
+ property :first6, String
19
+
15
20
  # @!attribute [r] last4
16
21
  # Last 4 digits of the card's Primary Account Number (PAN).
17
22
  # @return [String]
18
23
  property :last4, String
19
- validates_presence_of :last4
20
24
 
21
25
  # @!attribute [r] holder
22
26
  # Name of the person whom the card belongs to.
23
27
  # @return [String]
24
28
  property :holder, String
25
- validates_presence_of :holder
26
29
  end
27
30
  end
28
31
  end
@@ -17,11 +17,13 @@ module GOBL
17
17
  'any' => 'Any method available, no preference.',
18
18
  'card' => 'Payment card.',
19
19
  'credit-transfer' => 'Sender initiated bank or wire transfer.',
20
+ 'credit-transfer+sepa' => 'Sender initiated bank or wire transfer via SEPA.',
20
21
  'debit-transfer' => 'Receiver initiated bank or wire transfer.',
21
22
  'cash' => 'Cash in hand.',
22
23
  'cheque' => 'Cheque from bank.',
23
24
  'bank-draft' => 'Bankers Draft or Bank Cheque.',
24
25
  'direct-debit' => 'Direct debit from the customers bank account.',
26
+ 'direct-debit+sepa' => 'Direct debit from the customers bank account via SEPA.',
25
27
  'online' => 'Online or web payment.',
26
28
  'promissory-note' => 'Promissory note contract.',
27
29
  'netting' => 'Intercompany clearing or clearing between partners.',
@@ -40,9 +42,9 @@ module GOBL
40
42
  property :detail, String
41
43
 
42
44
  # @!attribute [r] ref
43
- # Remittance information or concept, a text value used to link the payment with the invoice.
44
- # @return [String]
45
- property :ref, String
45
+ # Remittance information or concept, a code value used to link the payment with the invoice.
46
+ # @return [GOBL::CBC::Code]
47
+ property :ref, GOBL::CBC::Code
46
48
 
47
49
  # @!attribute [r] credit_transfer
48
50
  # Instructions for sending payment via a bank transfer.
@@ -14,7 +14,6 @@ module GOBL
14
14
 
15
15
  # Enumeration of possible values for {#key} with their corresponding descriptions
16
16
  KEY_ENUM = {
17
- '' => 'Not yet defined',
18
17
  'end-of-month' => 'End of month',
19
18
  'due-date' => 'Due on a specific date',
20
19
  'deferred' => 'Deferred until after the due date',
@@ -23,7 +22,8 @@ module GOBL
23
22
  'elective' => 'Chosen by the buyer',
24
23
  'pending' => 'Seller to advise buyer in separate transaction',
25
24
  'advanced' => 'Payment made in advance',
26
- 'delivery' => 'Payment on Delivery'
25
+ 'delivery' => 'Payment on Delivery',
26
+ 'undefined' => 'Not yet defined'
27
27
  }.freeze
28
28
 
29
29
  # @!attribute [r] key
@@ -46,6 +46,11 @@ module GOBL
46
46
  # Description of the conditions for payment.
47
47
  # @return [String]
48
48
  property :notes, String
49
+
50
+ # @!attribute [r] ext
51
+ # Extensions to the terms for local codes.
52
+ # @return [GOBL::Tax::Extensions]
53
+ property :ext, GOBL::Tax::Extensions
49
54
  end
50
55
  end
51
56
  end
@@ -13,6 +13,11 @@ module GOBL
13
13
  # The Schema ID of the GOBL FoodVouchersLine structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/regimes/mx/food-vouchers#/$defs/FoodVouchersLine'
15
15
 
16
+ # @!attribute [r] i
17
+ # Line number starting from 1 (calculated).
18
+ # @return [Integer]
19
+ property :i, Integer
20
+
16
21
  # @!attribute [r] e_wallet_id
17
22
  # Identifier of the e-wallet that received the food voucher (maps to `Identificador`).
18
23
  # @return [GOBL::CBC::Code]
@@ -13,6 +13,11 @@ module GOBL
13
13
  # The Schema ID of the GOBL FuelAccountLine structure
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/regimes/mx/fuel-account-balance#/$defs/FuelAccountLine'
15
15
 
16
+ # @!attribute [r] i
17
+ # Index of the line starting from 1 (calculated)
18
+ # @return [Integer]
19
+ property :i, Integer
20
+
16
21
  # @!attribute [r] e_wallet_id
17
22
  # Identifier of the e-wallet used to make the purchase (maps to `Identificador`).
18
23
  # @return [GOBL::CBC::Code]
@@ -18,6 +18,11 @@ module GOBL
18
18
  property :key, GOBL::CBC::Key
19
19
  validates_presence_of :key
20
20
 
21
+ # @!attribute [r] requires
22
+ # Requires defines any additional addons that this one depends on to operate correctly.
23
+ # @return [Array<GOBL::CBC::Key>]
24
+ property :requires, [GOBL::CBC::Key]
25
+
21
26
  # @!attribute [r] name
22
27
  # Name of the add-on
23
28
  # @return [GOBL::I18n::String]
@@ -29,10 +34,15 @@ module GOBL
29
34
  # @return [GOBL::I18n::String]
30
35
  property :description, GOBL::I18n::String
31
36
 
37
+ # @!attribute [r] sources
38
+ # Sources is a list of sources that are used to provide the data for the add-on.
39
+ # @return [Array<GOBL::CBC::Source>]
40
+ property :sources, [GOBL::CBC::Source]
41
+
32
42
  # @!attribute [r] extensions
33
43
  # Extensions defines the list of extensions that are associated with an add-on.
34
- # @return [Array<GOBL::CBC::KeyDefinition>]
35
- property :extensions, [GOBL::CBC::KeyDefinition]
44
+ # @return [Array<GOBL::CBC::Definition>]
45
+ property :extensions, [GOBL::CBC::Definition]
36
46
  validates_presence_of :extensions
37
47
 
38
48
  # @!attribute [r] tags
@@ -46,10 +56,15 @@ module GOBL
46
56
  property :scenarios, [ScenarioSet]
47
57
  validates_presence_of :scenarios
48
58
 
59
+ # @!attribute [r] identities
60
+ # Identities that are specific for the add-on and may be validated against or used during conversion processes.
61
+ # @return [Array<GOBL::CBC::Definition>]
62
+ property :identities, [GOBL::CBC::Definition]
63
+
49
64
  # @!attribute [r] inboxes
50
65
  # Inboxes is a list of keys that are used to identify where copies of documents can be sent.
51
- # @return [Array<GOBL::CBC::KeyDefinition>]
52
- property :inboxes, [GOBL::CBC::KeyDefinition]
66
+ # @return [Array<GOBL::CBC::Definition>]
67
+ property :inboxes, [GOBL::CBC::Definition]
53
68
 
54
69
  # @!attribute [r] corrections
55
70
  # Corrections is used to provide a map of correction definitions that are supported by the add-on.
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Tax
10
+ # A CatalogueDef contains a set of re-useable extensions, scenarios, and validators that can be used by addons or tax regimes.
11
+ class CatalogueDef < GOBL::Object
12
+ # The Schema ID of the GOBL CatalogueDef structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/tax/catalogue-def'
14
+
15
+ # @!attribute [r] key
16
+ # Key defines a unique identifier for the catalogue.
17
+ # @return [GOBL::CBC::Key]
18
+ property :key, GOBL::CBC::Key
19
+ validates_presence_of :key
20
+
21
+ # @!attribute [r] name
22
+ # Name is the name of the catalogue.
23
+ # @return [GOBL::I18n::String]
24
+ property :name, GOBL::I18n::String
25
+ validates_presence_of :name
26
+
27
+ # @!attribute [r] description
28
+ # Description is a human readable description of the catalogue.
29
+ # @return [GOBL::I18n::String]
30
+ property :description, GOBL::I18n::String
31
+
32
+ # @!attribute [r] extensions
33
+ # Extensions defines all the extensions offered by the catalogue.
34
+ # @return [Array<GOBL::CBC::Definition>]
35
+ property :extensions, [GOBL::CBC::Definition]
36
+ validates_presence_of :extensions
37
+ end
38
+ end
39
+ end
@@ -40,7 +40,7 @@ module GOBL
40
40
  property :retained, Boolean
41
41
 
42
42
  # @!attribute [r] rates
43
- # Specific tax definitions inside this category.
43
+ # Specific tax definitions inside this category. Order is important.
44
44
  # @return [Array<RateDef>]
45
45
  property :rates, [RateDef]
46
46
 
@@ -56,11 +56,11 @@ module GOBL
56
56
 
57
57
  # @!attribute [r] sources
58
58
  # List of sources for the information contained in this category.
59
- # @return [Array<Source>]
60
- property :sources, [Source]
59
+ # @return [Array<GOBL::CBC::Source>]
60
+ property :sources, [GOBL::CBC::Source]
61
61
 
62
62
  # @!attribute [r] ext
63
- # Extensions key-value pairs that will be copied to the tax combo if this category is used.
63
+ # Extension key-value pairs that will be copied to the tax combo if this category is used.
64
64
  # @return [GOBL::Tax::Extensions]
65
65
  property :ext, GOBL::Tax::Extensions
66
66
 
@@ -37,6 +37,11 @@ module GOBL
37
37
  # Stamps that must be copied from the preceding document.
38
38
  # @return [Array<GOBL::CBC::Key>]
39
39
  property :stamps, [GOBL::CBC::Key]
40
+
41
+ # @!attribute [r] copy_tax
42
+ # Copy tax from the preceding document to the document ref.
43
+ # @return [Boolean]
44
+ property :copy_tax, Boolean
40
45
  end
41
46
  end
42
47
  end
@@ -23,6 +23,11 @@ module GOBL
23
23
  # @return [GOBL::CBC::Code]
24
24
  property :code, GOBL::CBC::Code
25
25
 
26
+ # @!attribute [r] scheme
27
+ # Scheme is an optional field that may be used to override the tax regime's default tax scheme. Many electronic formats such as UBL or CII define an equivalent field. Examples: `VAT`, `GST`, `ST`, etc.
28
+ # @return [GOBL::CBC::Code]
29
+ property :scheme, GOBL::CBC::Code
30
+
26
31
  # @!attribute [r] type
27
32
  # Type is set according to the requirements of each regime, some have a single tax document type code, others require a choice to be made. Deprecated: Tax Identities should only be used for VAT or similar codes for companies. Use the identities array for other types of identification.
28
33
  # @return [GOBL::CBC::Key]
@@ -51,10 +51,15 @@ module GOBL
51
51
  property :currency, GOBL::Currency::Code
52
52
  validates_presence_of :currency
53
53
 
54
+ # @!attribute [r] tax_scheme
55
+ # TaxScheme defines the principal scheme of consumption tax that should be applied to the regime and associated with Tax IDs in some export formats such as UBL or CII. Some regimes may not have a Tax Scheme and as a consequence will not use tax identities, like the US.
56
+ # @return [GOBL::CBC::Code]
57
+ property :tax_scheme, GOBL::CBC::Code
58
+
54
59
  # @!attribute [r] calculator_rounding_rule
55
60
  # Rounding rule to use when calculating the tax totals, default is always `sum-then-round`.
56
- # @return [String]
57
- property :calculator_rounding_rule, String
61
+ # @return [GOBL::CBC::Key]
62
+ property :calculator_rounding_rule, GOBL::CBC::Key
58
63
 
59
64
  # @!attribute [r] tags
60
65
  # Tags that can be applied at the document level to identify additional considerations.
@@ -63,33 +68,23 @@ module GOBL
63
68
 
64
69
  # @!attribute [r] extensions
65
70
  # Extensions defines the keys that can be used for extended or extra data inside the regime that is specific to the regime and cannot be easily determined from other GOBL structures. Typically these are used to define local codes for suppliers, customers, products, or tax rates.
66
- # @return [Array<GOBL::CBC::KeyDefinition>]
67
- property :extensions, [GOBL::CBC::KeyDefinition]
68
-
69
- # @!attribute [r] tax_identity_type_keys
70
- # Tax Identity types specific for the regime and may be validated against.
71
- # @return [Array<GOBL::CBC::KeyDefinition>]
72
- property :tax_identity_type_keys, [GOBL::CBC::KeyDefinition]
73
-
74
- # @!attribute [r] identity_keys
75
- # Identity keys used in addition to regular tax identities and specific for the regime that may be validated against.
76
- # @return [Array<GOBL::CBC::KeyDefinition>]
77
- property :identity_keys, [GOBL::CBC::KeyDefinition]
71
+ # @return [Array<GOBL::CBC::Definition>]
72
+ property :extensions, [GOBL::CBC::Definition]
78
73
 
79
- # @!attribute [r] charge_keys
80
- # Charge keys specific for the regime and may be validated or used in the UI as suggestions
81
- # @return [Array<GOBL::CBC::KeyDefinition>]
82
- property :charge_keys, [GOBL::CBC::KeyDefinition]
74
+ # @!attribute [r] identities
75
+ # Identities used in addition to regular tax identities and specific for the regime that may be validated against.
76
+ # @return [Array<GOBL::CBC::Definition>]
77
+ property :identities, [GOBL::CBC::Definition]
83
78
 
84
79
  # @!attribute [r] payment_means_keys
85
80
  # PaymentMeansKeys specific for the regime that extend the original base payment means keys.
86
- # @return [Array<GOBL::CBC::KeyDefinition>]
87
- property :payment_means_keys, [GOBL::CBC::KeyDefinition]
81
+ # @return [Array<GOBL::CBC::Definition>]
82
+ property :payment_means_keys, [GOBL::CBC::Definition]
88
83
 
89
84
  # @!attribute [r] inbox_keys
90
85
  # InboxKeys specific to the regime that can be used to identify where a document should be forwarded to.
91
- # @return [Array<GOBL::CBC::KeyDefinition>]
92
- property :inbox_keys, [GOBL::CBC::KeyDefinition]
86
+ # @return [Array<GOBL::CBC::Definition>]
87
+ property :inbox_keys, [GOBL::CBC::Definition]
93
88
 
94
89
  # @!attribute [r] scenarios
95
90
  # @return [Array<ScenarioSet>]
@@ -32,15 +32,15 @@ module GOBL
32
32
  # @return [GOBL::CBC::Key]
33
33
  property :ext_key, GOBL::CBC::Key
34
34
 
35
- # @!attribute [r] ext_value
36
- # Extension value that along side the key must be present for a match to happen. This cannot be used without an `ExtKey`. The value will be copied to the note code if needed.
37
- # @return [String]
38
- property :ext_value, String
35
+ # @!attribute [r] ext_code
36
+ # Extension code that along side the key must be present for a match to happen. This cannot be used without an `cbc.Code`. The value will be copied to the note code if needed.
37
+ # @return [GOBL::CBC::Code]
38
+ property :ext_code, GOBL::CBC::Code
39
39
 
40
40
  # @!attribute [r] note
41
41
  # A note to be added to the document if the scenario is applied.
42
- # @return [GOBL::CBC::Note]
43
- property :note, GOBL::CBC::Note
42
+ # @return [ScenarioNote]
43
+ property :note, ScenarioNote
44
44
 
45
45
  # @!attribute [r] codes
46
46
  # Codes is used to define additional codes for regime specific situations.
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Tax
10
+ # ScenarioNote represents the structure of the note that needs to be added to the document.
11
+ class ScenarioNote < GOBL::Object
12
+ # The Schema ID of the GOBL ScenarioNote structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/ScenarioNote'
14
+
15
+ # @!attribute [r] key
16
+ # Key specifying subject of the text
17
+ # @return [GOBL::CBC::Key]
18
+ property :key, GOBL::CBC::Key
19
+
20
+ # @!attribute [r] code
21
+ # Code used for additional data that may be required to identify the note.
22
+ # @return [GOBL::CBC::Code]
23
+ property :code, GOBL::CBC::Code
24
+
25
+ # @!attribute [r] src
26
+ # Source of this note, especially useful when auto-generated.
27
+ # @return [GOBL::CBC::Key]
28
+ property :src, GOBL::CBC::Key
29
+
30
+ # @!attribute [r] text
31
+ # The contents of the note
32
+ # @return [String]
33
+ property :text, String
34
+ validates_presence_of :text
35
+
36
+ # @!attribute [r] ext
37
+ # Extension data
38
+ # @return [GOBL::Tax::Extensions]
39
+ property :ext, GOBL::Tax::Extensions
40
+ end
41
+ end
42
+ end
@@ -20,8 +20,8 @@ module GOBL
20
20
 
21
21
  # @!attribute [r] list
22
22
  # List of tags for the schema
23
- # @return [Array<GOBL::CBC::KeyDefinition>]
24
- property :list, [GOBL::CBC::KeyDefinition]
23
+ # @return [Array<GOBL::CBC::Definition>]
24
+ property :list, [GOBL::CBC::Definition]
25
25
  validates_presence_of :list
26
26
  end
27
27
  end