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
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ ##
4
+ ## DO NOT EDIT - This file was generated automatically.
5
+ ##
6
+ ##
7
+
8
+ module GOBL
9
+ module Org
10
+ # An Attachment provides a structure to be used to attach documents inside a GOBL document, either as a reference via a URL, or directly as a base64 encoded string.
11
+ class Attachment < GOBL::Object
12
+ # The Schema ID of the GOBL Attachment structure
13
+ SCHEMA_ID = 'https://gobl.org/draft-0/org/attachment'
14
+
15
+ # @!attribute [r] uuid
16
+ # Universally Unique Identifier.
17
+ # @return [String]
18
+ property :uuid, String
19
+
20
+ # @!attribute [r] key
21
+ # Key used to identify the attachment inside the document.
22
+ # @return [GOBL::CBC::Key]
23
+ property :key, GOBL::CBC::Key
24
+
25
+ # @!attribute [r] code
26
+ # Code used to identify the payload of the attachment.
27
+ # @return [GOBL::CBC::Code]
28
+ property :code, GOBL::CBC::Code
29
+
30
+ # @!attribute [r] name
31
+ # Filename of the attachment.
32
+ # @return [String]
33
+ property :name, String
34
+ validates_presence_of :name
35
+
36
+ # @!attribute [r] description
37
+ # Details of why the attachment is being included and details on what it contains.
38
+ # @return [String]
39
+ property :description, String
40
+
41
+ # @!attribute [r] url
42
+ # URL of where to find the attachment. Prefer using this field over the Data field.
43
+ # @return [String]
44
+ property :url, String
45
+
46
+ # @!attribute [r] digest
47
+ # Digest is used to verify the integrity of the attachment when downloaded from the URL.
48
+ # @return [GOBL::DSig::Digest]
49
+ property :digest, GOBL::DSig::Digest
50
+
51
+ # @!attribute [r] mime
52
+ # MIME type of the attachment.
53
+ # @return [String]
54
+ property :mime, String
55
+ end
56
+ end
57
+ end
@@ -17,8 +17,13 @@ module GOBL
17
17
  # @return [String]
18
18
  property :uuid, String
19
19
 
20
+ # @!attribute [r] schema
21
+ # Schema of the referenced document if different from that of the parent.
22
+ # @return [String]
23
+ property :schema, String
24
+
20
25
  # @!attribute [r] type
21
- # Type of the document referenced.
26
+ # Type of the document referenced according to the defined schema or that of the parent document.
22
27
  # @return [GOBL::CBC::Key]
23
28
  property :type, GOBL::CBC::Key
24
29
 
@@ -38,10 +43,15 @@ module GOBL
38
43
  property :code, GOBL::CBC::Code
39
44
  validates_presence_of :code
40
45
 
41
- # @!attribute [r] line
42
- # Line index number inside the document, if relevant.
43
- # @return [Integer]
44
- property :line, Integer
46
+ # @!attribute [r] currency
47
+ # Currency used in the document, if different from the parent's currency.
48
+ # @return [GOBL::Currency::Code]
49
+ property :currency, GOBL::Currency::Code
50
+
51
+ # @!attribute [r] lines
52
+ # Line index numbers inside the document, if relevant.
53
+ # @return [Array<Integer>]
54
+ property :lines, [Integer]
45
55
 
46
56
  # @!attribute [r] identities
47
57
  # 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 +74,7 @@ module GOBL
64
74
  property :description, String
65
75
 
66
76
  # @!attribute [r] stamps
67
- # Seals of approval from other organisations that may need to be listed.
77
+ # Seals of approval from other organizations that may need to be listed.
68
78
  # @return [Array<GOBL::Head::Stamp>]
69
79
  property :stamps, [GOBL::Head::Stamp]
70
80
 
@@ -73,6 +83,16 @@ module GOBL
73
83
  # @return [String]
74
84
  property :url, String
75
85
 
86
+ # @!attribute [r] tax
87
+ # Tax total breakdown from the original document in the provided currency. Should only be included if required by a specific tax regime or addon.
88
+ # @return [GOBL::Tax::Total]
89
+ property :tax, GOBL::Tax::Total
90
+
91
+ # @!attribute [r] payable
92
+ # 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.
93
+ # @return [GOBL::Num::Amount]
94
+ property :payable, GOBL::Num::Amount
95
+
76
96
  # @!attribute [r] ext
77
97
  # Extensions for additional codes that may be required.
78
98
  # @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.
@@ -43,6 +43,11 @@ module GOBL
43
43
  # @return [String]
44
44
  property :description, String
45
45
 
46
+ # @!attribute [r] images
47
+ # Images associated with the item.
48
+ # @return [Array<GOBL::Org::Image>]
49
+ property :images, [GOBL::Org::Image]
50
+
46
51
  # @!attribute [r] currency
47
52
  # Currency used for the item's price.
48
53
  # @return [GOBL::Currency::Code]
@@ -52,7 +57,6 @@ module GOBL
52
57
  # Base price of a single unit to be sold.
53
58
  # @return [GOBL::Num::Amount]
54
59
  property :price, GOBL::Num::Amount
55
- validates_presence_of :price
56
60
 
57
61
  # @!attribute [r] alt_prices
58
62
  # 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]
@@ -22,17 +22,32 @@ module GOBL
22
22
  # @return [String]
23
23
  property :label, String
24
24
 
25
+ # @!attribute [r] key
26
+ # Key used to identify the role of the person inside the context of the object.
27
+ # @return [GOBL::CBC::Key]
28
+ property :key, GOBL::CBC::Key
29
+
25
30
  # @!attribute [r] name
26
- # Complete details on the name of the person
31
+ # Complete details on the name of the person.
27
32
  # @return [GOBL::Org::Name]
28
33
  property :name, GOBL::Org::Name
29
34
  validates_presence_of :name
30
35
 
31
36
  # @!attribute [r] role
32
- # What they do within an organization
37
+ # Role or job title of the responsibilities of the person within an organization.
33
38
  # @return [String]
34
39
  property :role, String
35
40
 
41
+ # @!attribute [r] identities
42
+ # Set of codes used to identify the person, such as ID numbers, social security, driving licenses, etc. that can be attributed to the individual.
43
+ # @return [Array<GOBL::Org::Identity>]
44
+ property :identities, [GOBL::Org::Identity]
45
+
46
+ # @!attribute [r] addresses
47
+ # Regular post addresses for where information should be sent if needed.
48
+ # @return [Array<GOBL::Org::Address>]
49
+ property :addresses, [GOBL::Org::Address]
50
+
36
51
  # @!attribute [r] emails
37
52
  # Electronic mail addresses that belong to the person.
38
53
  # @return [Array<GOBL::Org::Email>]
@@ -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'
@@ -21,11 +21,20 @@ module GOBL
21
21
  't' => 'Metric tons',
22
22
  'mm' => 'Milimetres',
23
23
  'cm' => 'Centimetres',
24
+ 'dm' => 'A unit of length equal to one-tenth of a metre.',
24
25
  'm' => 'Metres',
25
26
  'km' => 'Kilometers',
26
27
  'in' => 'Inches',
27
28
  'ft' => 'Feet',
29
+ 'mm2' => 'Square millimetres',
30
+ 'cm2' => 'Square centimetres',
31
+ 'dm2' => 'Square decimetres',
28
32
  'm2' => 'Square metres',
33
+ 'ac' => 'A unit of area equal to 43,560 square feet.',
34
+ 'ha' => 'A unit of area equal to 10,000 square metres.',
35
+ 'mm3' => 'Cubic millimetres',
36
+ 'cm3' => 'Cubic centimetres',
37
+ 'dm3' => 'Cubic decimetres',
29
38
  'm3' => 'Cubic metres',
30
39
  'ml' => 'Millilitres',
31
40
  'cl' => 'Centilitres',
@@ -53,6 +62,7 @@ module GOBL
53
62
  'kit' => 'A unit of count defining the number of kits (kit: tub, barrel or pail).',
54
63
  '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
64
  'pk' => 'A unit of count defining the number of items per bulk pack.',
65
+ 'one' => 'A single generic unit of a service or product.',
56
66
  'bag' => 'Bags',
57
67
  'box' => 'Boxes',
58
68
  '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
@@ -39,8 +39,18 @@ module GOBL
39
39
  # @return [Boolean]
40
40
  property :retained, Boolean
41
41
 
42
- # @!attribute [r] rates
42
+ # @!attribute [r] informative
43
+ # Informative when true implies that the tax amount will be calculated and reported but will not affect the invoice totals. Typically used for taxes that are embedded in the base amount or don't impact the final payable amount.
44
+ # @return [Boolean]
45
+ property :informative, Boolean
46
+
47
+ # @!attribute [r] keys
43
48
  # Specific tax definitions inside this category.
49
+ # @return [Array<KeyDef>]
50
+ property :keys, [KeyDef]
51
+
52
+ # @!attribute [r] rates
53
+ # Rates defines the set of rates that can be used with this category.
44
54
  # @return [Array<RateDef>]
45
55
  property :rates, [RateDef]
46
56
 
@@ -56,11 +66,11 @@ module GOBL
56
66
 
57
67
  # @!attribute [r] sources
58
68
  # List of sources for the information contained in this category.
59
- # @return [Array<Source>]
60
- property :sources, [Source]
69
+ # @return [Array<GOBL::CBC::Source>]
70
+ property :sources, [GOBL::CBC::Source]
61
71
 
62
72
  # @!attribute [r] ext
63
- # Extensions key-value pairs that will be copied to the tax combo if this category is used.
73
+ # Extension key-value pairs that will be copied to the tax combo if this category is used.
64
74
  # @return [GOBL::Tax::Extensions]
65
75
  property :ext, GOBL::Tax::Extensions
66
76
 
@@ -21,6 +21,10 @@ module GOBL
21
21
  # @return [Boolean]
22
22
  property :retained, Boolean
23
23
 
24
+ # @!attribute [r] informative
25
+ # @return [Boolean]
26
+ property :informative, Boolean
27
+
24
28
  # @!attribute [r] rates
25
29
  # @return [Array<RateTotal>]
26
30
  property :rates, [RateTotal]