gobl 0.14.1 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/data/regimes/co.json +1143 -1148
  3. data/data/regimes/es.json +181 -176
  4. data/data/regimes/it.json +649 -349
  5. data/data/regimes/pt.json +159 -38
  6. data/data/regimes/us.json +1 -2
  7. data/lib/generated/gobl/bill/charge.rb +1 -1
  8. data/lib/generated/gobl/bill/delivery.rb +1 -1
  9. data/lib/generated/gobl/bill/discount.rb +1 -1
  10. data/lib/generated/gobl/bill/document_reference.rb +1 -1
  11. data/lib/generated/gobl/bill/invoice.rb +1 -1
  12. data/lib/generated/gobl/bill/line.rb +1 -1
  13. data/lib/generated/gobl/bill/line_charge.rb +1 -1
  14. data/lib/generated/gobl/bill/line_discount.rb +1 -1
  15. data/lib/generated/gobl/bill/ordering.rb +1 -1
  16. data/lib/generated/gobl/bill/outlay.rb +1 -1
  17. data/lib/generated/gobl/bill/payment.rb +1 -1
  18. data/lib/generated/gobl/bill/preceding.rb +1 -1
  19. data/lib/generated/gobl/bill/tax.rb +1 -1
  20. data/lib/generated/gobl/bill/totals.rb +1 -1
  21. data/lib/generated/gobl/cal/date.rb +1 -1
  22. data/lib/generated/gobl/cal/period.rb +1 -1
  23. data/lib/generated/gobl/cbc/code.rb +1 -1
  24. data/lib/generated/gobl/cbc/code_set.rb +15 -0
  25. data/lib/generated/gobl/cbc/key.rb +1 -1
  26. data/lib/generated/gobl/cbc/meta.rb +1 -1
  27. data/lib/generated/gobl/cbc/note.rb +1 -1
  28. data/lib/generated/gobl/cbc/stamp.rb +1 -1
  29. data/lib/generated/gobl/currency/code.rb +1 -1
  30. data/lib/generated/gobl/currency/exchange_rate.rb +1 -1
  31. data/lib/generated/gobl/document.rb +1 -1
  32. data/lib/generated/gobl/dsig/digest.rb +1 -1
  33. data/lib/generated/gobl/dsig/signature.rb +1 -1
  34. data/lib/generated/gobl/envelope.rb +1 -1
  35. data/lib/generated/gobl/header.rb +1 -1
  36. data/lib/generated/gobl/i18n/string.rb +1 -1
  37. data/lib/generated/gobl/l10n/code.rb +1 -1
  38. data/lib/generated/gobl/l10n/country_code.rb +1 -1
  39. data/lib/generated/gobl/note/message.rb +1 -1
  40. data/lib/generated/gobl/org/address.rb +1 -1
  41. data/lib/generated/gobl/org/coordinates.rb +1 -1
  42. data/lib/generated/gobl/org/email.rb +1 -1
  43. data/lib/generated/gobl/org/identity.rb +1 -1
  44. data/lib/generated/gobl/org/image.rb +1 -1
  45. data/lib/generated/gobl/org/inbox.rb +1 -1
  46. data/lib/generated/gobl/org/item.rb +6 -1
  47. data/lib/generated/gobl/org/name.rb +1 -1
  48. data/lib/generated/gobl/org/party.rb +1 -1
  49. data/lib/generated/gobl/org/person.rb +1 -1
  50. data/lib/generated/gobl/org/registration.rb +3 -3
  51. data/lib/generated/gobl/org/telephone.rb +1 -1
  52. data/lib/generated/gobl/org/unit.rb +1 -1
  53. data/lib/generated/gobl/org/website.rb +1 -1
  54. data/lib/generated/gobl/pay/advance.rb +22 -1
  55. data/lib/generated/gobl/pay/card.rb +1 -1
  56. data/lib/generated/gobl/pay/credit_transfer.rb +1 -1
  57. data/lib/generated/gobl/pay/direct_debit.rb +1 -1
  58. data/lib/generated/gobl/pay/due_date.rb +1 -1
  59. data/lib/generated/gobl/pay/instructions.rb +8 -7
  60. data/lib/generated/gobl/pay/online.rb +1 -1
  61. data/lib/generated/gobl/pay/terms.rb +1 -1
  62. data/lib/generated/gobl/tax/category.rb +10 -6
  63. data/lib/generated/gobl/tax/category_total.rb +1 -6
  64. data/lib/generated/gobl/tax/combo.rb +1 -6
  65. data/lib/generated/gobl/tax/identity.rb +1 -1
  66. data/lib/generated/gobl/tax/key_definition.rb +7 -2
  67. data/lib/generated/gobl/tax/preceding_definitions.rb +1 -1
  68. data/lib/generated/gobl/tax/rate.rb +11 -2
  69. data/lib/generated/gobl/tax/rate_total.rb +9 -6
  70. data/lib/generated/gobl/tax/rate_total_surcharge.rb +1 -1
  71. data/lib/generated/gobl/tax/rate_value.rb +1 -1
  72. data/lib/generated/gobl/tax/regime.rb +17 -7
  73. data/lib/generated/gobl/tax/scenario.rb +11 -1
  74. data/lib/generated/gobl/tax/scenario_set.rb +1 -1
  75. data/lib/generated/gobl/tax/set.rb +1 -1
  76. data/lib/generated/gobl/tax/total.rb +1 -1
  77. data/lib/generated/gobl/tax/zone.rb +6 -1
  78. data/lib/generated/gobl/uuid/uuid.rb +1 -1
  79. data/lib/gobl/extensions/bill/scenario_summary.rb +4 -4
  80. data/lib/gobl/version.rb +1 -1
  81. metadata +3 -4
  82. data/lib/generated/gobl/tax/identity_type.rb +0 -33
  83. data/lib/generated/gobl/tax/tag.rb +0 -33
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -30,11 +30,20 @@ module GOBL
30
30
  # @return [GOBL::I18n::String]
31
31
  property :desc, GOBL::I18n::String
32
32
 
33
+ # @!attribute [r] exempt
34
+ # Exempt when true implies that the rate when used in a tax Combo should not define a percent value.
35
+ # @return [Boolean]
36
+ property :exempt, Boolean
37
+
33
38
  # @!attribute [r] values
34
39
  # Values contains a list of Value objects that contain the current and historical percentage values for the rate and additional filters. Order is important, newer values should come before older values.
35
40
  # @return [Array<RateValue>]
36
41
  property :values, [RateValue]
37
- validates_presence_of :values
42
+
43
+ # @!attribute [r] codes
44
+ # Codes defines a set of regime specific code mappings.
45
+ # @return [GOBL::CBC::CodeSet]
46
+ property :codes, GOBL::CBC::CodeSet
38
47
 
39
48
  # @!attribute [r] meta
40
49
  # Meta contains additional information about the rate that is relevant for local frequently used implementations.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -14,28 +14,31 @@ module GOBL
14
14
  SCHEMA_ID = 'https://gobl.org/draft-0/tax/total#/$defs/RateTotal'
15
15
 
16
16
  # @!attribute [r] key
17
+ # Optional rate key is required when grouping.
17
18
  # @return [GOBL::CBC::Key]
18
19
  property :key, GOBL::CBC::Key
19
20
 
20
21
  # @!attribute [r] base
22
+ # Base amount that the percentage is applied to.
21
23
  # @return [GOBL::Num::Amount]
22
24
  property :base, GOBL::Num::Amount
23
25
  validates_presence_of :base
24
26
 
25
27
  # @!attribute [r] percent
28
+ # Percentage of the rate, which may be nil for exempt rates.
26
29
  # @return [GOBL::Num::Percentage]
27
30
  property :percent, GOBL::Num::Percentage
28
- validates_presence_of :percent
31
+
32
+ # @!attribute [r] surcharge
33
+ # Surcharge applied to the rate.
34
+ # @return [RateTotalSurcharge]
35
+ property :surcharge, RateTotalSurcharge
29
36
 
30
37
  # @!attribute [r] amount
31
38
  # Total amount of rate, excluding surcharges
32
39
  # @return [GOBL::Num::Amount]
33
40
  property :amount, GOBL::Num::Amount
34
41
  validates_presence_of :amount
35
-
36
- # @!attribute [r] surcharge
37
- # @return [RateTotalSurcharge]
38
- property :surcharge, RateTotalSurcharge
39
42
  end
40
43
  end
41
44
  end
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -41,20 +41,30 @@ module GOBL
41
41
  property :currency, GOBL::Currency::Code
42
42
  validates_presence_of :currency
43
43
 
44
+ # @!attribute [r] tags
45
+ # Tags that can be applied at the document level to identify additional considerations.
46
+ # @return [Array<KeyDefinition>]
47
+ property :tags, [KeyDefinition]
48
+
44
49
  # @!attribute [r] identity_types
45
50
  # Identity types specific for the regime and may be validated against.
46
- # @return [Array<IdentityType>]
47
- property :identity_types, [IdentityType]
51
+ # @return [Array<KeyDefinition>]
52
+ property :identity_types, [KeyDefinition]
48
53
 
49
54
  # @!attribute [r] charge_types
50
55
  # Charge types specific for the regime and may be validated or used in the UI as suggestions
51
56
  # @return [Array<KeyDefinition>]
52
57
  property :charge_types, [KeyDefinition]
53
58
 
54
- # @!attribute [r] tags
55
- # Tags that can be applied at the document level to identify additional considerations.
56
- # @return [Array<Tag>]
57
- property :tags, [Tag]
59
+ # @!attribute [r] payment_means
60
+ # PaymentMeansKeys specific for the regime that extend the original base payment means keys.
61
+ # @return [Array<KeyDefinition>]
62
+ property :payment_means, [KeyDefinition]
63
+
64
+ # @!attribute [r] item_keys
65
+ # ItemKeys specific for the regime that need to be added to `org.Item` data in line rows.
66
+ # @return [Array<KeyDefinition>]
67
+ property :item_keys, [KeyDefinition]
58
68
 
59
69
  # @!attribute [r] scenarios
60
70
  # Sets of scenario definitions for the regime.
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -23,11 +23,21 @@ module GOBL
23
23
  # @return [Array<GOBL::CBC::Key>]
24
24
  property :tags, [GOBL::CBC::Key]
25
25
 
26
+ # @!attribute [r] name
27
+ # Name of the scenario for further information.
28
+ # @return [GOBL::I18n::String]
29
+ property :name, GOBL::I18n::String
30
+
26
31
  # @!attribute [r] note
27
32
  # A note to be added to the document if the scenario is applied.
28
33
  # @return [GOBL::CBC::Note]
29
34
  property :note, GOBL::CBC::Note
30
35
 
36
+ # @!attribute [r] codes
37
+ # Codes is used to define additional codes for regime specific situations.
38
+ # @return [GOBL::CBC::CodeSet]
39
+ property :codes, GOBL::CBC::CodeSet
40
+
31
41
  # @!attribute [r] meta
32
42
  # Any additional local meta data that may be useful in integrations.
33
43
  # @return [GOBL::CBC::Meta]
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -34,6 +34,11 @@ module GOBL
34
34
  # @return [GOBL::I18n::String]
35
35
  property :region, GOBL::I18n::String
36
36
 
37
+ # @!attribute [r] codes
38
+ # Codes defines a set of regime specific code mappings.
39
+ # @return [GOBL::CBC::CodeSet]
40
+ property :codes, GOBL::CBC::CodeSet
41
+
37
42
  # @!attribute [r] meta
38
43
  # Any additional information
39
44
  # @return [GOBL::CBC::Meta]
@@ -3,7 +3,7 @@
3
3
  ##
4
4
  ## DO NOT EDIT - This file was generated automatically.
5
5
  ##
6
- ## Generated with GOBL v0.42.8
6
+ ## Generated with GOBL v0.50.1
7
7
  ##
8
8
 
9
9
  module GOBL
@@ -9,10 +9,10 @@ module GOBL
9
9
  @scenarios = scenarios
10
10
  end
11
11
 
12
- # Returns the aggregated metadata of the scenarios
13
- def meta
14
- scenarios.inject({}) do |meta, scenario|
15
- meta.merge(scenario.meta.to_h)
12
+ # Returns the aggregated codes of the scenarios
13
+ def codes
14
+ scenarios.inject({}) do |codes, scenario|
15
+ codes.merge(scenario.codes.to_h)
16
16
  end
17
17
  end
18
18
 
data/lib/gobl/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GOBL
4
- VERSION = '0.14.1'
4
+ VERSION = '0.15.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gobl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luismi Cavalle
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2023-05-26 00:00:00.000000000 Z
14
+ date: 2023-05-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -87,6 +87,7 @@ files:
87
87
  - lib/generated/gobl/cal/date.rb
88
88
  - lib/generated/gobl/cal/period.rb
89
89
  - lib/generated/gobl/cbc/code.rb
90
+ - lib/generated/gobl/cbc/code_set.rb
90
91
  - lib/generated/gobl/cbc/key.rb
91
92
  - lib/generated/gobl/cbc/meta.rb
92
93
  - lib/generated/gobl/cbc/note.rb
@@ -128,7 +129,6 @@ files:
128
129
  - lib/generated/gobl/tax/category_total.rb
129
130
  - lib/generated/gobl/tax/combo.rb
130
131
  - lib/generated/gobl/tax/identity.rb
131
- - lib/generated/gobl/tax/identity_type.rb
132
132
  - lib/generated/gobl/tax/key_definition.rb
133
133
  - lib/generated/gobl/tax/preceding_definitions.rb
134
134
  - lib/generated/gobl/tax/rate.rb
@@ -139,7 +139,6 @@ files:
139
139
  - lib/generated/gobl/tax/scenario.rb
140
140
  - lib/generated/gobl/tax/scenario_set.rb
141
141
  - lib/generated/gobl/tax/set.rb
142
- - lib/generated/gobl/tax/tag.rb
143
142
  - lib/generated/gobl/tax/total.rb
144
143
  - lib/generated/gobl/tax/zone.rb
145
144
  - lib/generated/gobl/uuid/uuid.rb
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- ## DO NOT EDIT - This file was generated automatically.
5
- ##
6
- ## Generated with GOBL v0.42.8
7
- ##
8
-
9
- module GOBL
10
- module Tax
11
- # IdentityType describes a single possible value for a tax identity type.
12
- class IdentityType < GOBL::Object
13
- # The Schema ID of the GOBL IdentityType structure
14
- SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/IdentityType'
15
-
16
- # @!attribute [r] key
17
- # Key used to identify the type
18
- # @return [GOBL::CBC::Key]
19
- property :key, GOBL::CBC::Key
20
- validates_presence_of :key
21
-
22
- # @!attribute [r] name
23
- # Name for the identity type
24
- # @return [GOBL::I18n::String]
25
- property :name, GOBL::I18n::String
26
-
27
- # @!attribute [r] meta
28
- # Additional regime specific meta data
29
- # @return [GOBL::CBC::Meta]
30
- property :meta, GOBL::CBC::Meta
31
- end
32
- end
33
- end
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- ##
4
- ## DO NOT EDIT - This file was generated automatically.
5
- ##
6
- ## Generated with GOBL v0.42.8
7
- ##
8
-
9
- module GOBL
10
- module Tax
11
- # Tag describes a tax tag that can be used to identify additional requirements in an electronic invoice.
12
- class Tag < GOBL::Object
13
- # The Schema ID of the GOBL Tag structure
14
- SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/Tag'
15
-
16
- # @!attribute [r] key
17
- # Key used to identify the tag
18
- # @return [GOBL::CBC::Key]
19
- property :key, GOBL::CBC::Key
20
- validates_presence_of :key
21
-
22
- # @!attribute [r] name
23
- # Name of this tag.
24
- # @return [GOBL::I18n::String]
25
- property :name, GOBL::I18n::String
26
-
27
- # @!attribute [r] meta
28
- # Additional local
29
- # @return [GOBL::CBC::Meta]
30
- property :meta, GOBL::CBC::Meta
31
- end
32
- end
33
- end