gobl 0.20.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/data/regimes/at.json +160 -0
- data/data/regimes/be.json +169 -0
- data/data/regimes/ca.json +10 -1
- data/data/regimes/ch.json +158 -0
- data/data/regimes/co.json +179 -169
- data/data/regimes/de.json +63 -49
- data/data/regimes/el.json +204 -0
- data/data/regimes/es.json +84 -557
- data/data/regimes/fr.json +57 -52
- data/data/regimes/gb.json +67 -50
- data/data/regimes/gr.json +591 -0
- data/data/regimes/it.json +62 -1298
- data/data/regimes/mx.json +38 -627
- data/data/regimes/nl.json +63 -50
- data/data/regimes/pl.json +161 -101
- data/data/regimes/pt.json +44 -365
- data/data/regimes/us.json +63 -49
- data/lib/generated/gobl/bill/charge.rb +6 -7
- data/lib/generated/gobl/bill/correction_options.rb +5 -1
- data/lib/generated/gobl/bill/delivery.rb +0 -1
- data/lib/generated/gobl/bill/discount.rb +5 -6
- data/lib/generated/gobl/bill/invoice.rb +51 -12
- data/lib/generated/gobl/bill/line.rb +3 -4
- data/lib/generated/gobl/bill/line_charge.rb +0 -1
- data/lib/generated/gobl/bill/line_discount.rb +0 -1
- data/lib/generated/gobl/bill/ordering.rb +34 -35
- data/lib/generated/gobl/bill/outlay.rb +3 -4
- data/lib/generated/gobl/bill/payment.rb +0 -1
- data/lib/generated/gobl/bill/tax.rb +4 -5
- data/lib/generated/gobl/bill/totals.rb +0 -1
- data/lib/generated/gobl/cal/date.rb +0 -1
- data/lib/generated/gobl/cal/date_time.rb +0 -1
- data/lib/generated/gobl/cal/period.rb +0 -1
- data/lib/generated/gobl/cbc/code.rb +0 -1
- data/lib/generated/gobl/cbc/code_map.rb +0 -1
- data/lib/generated/gobl/cbc/key.rb +0 -1
- data/lib/generated/gobl/cbc/key_definition.rb +4 -10
- data/lib/generated/gobl/cbc/meta.rb +0 -1
- data/lib/generated/gobl/cbc/note.rb +0 -1
- data/lib/generated/gobl/cbc/value_definition.rb +37 -0
- data/lib/generated/gobl/currency/amount.rb +33 -0
- data/lib/generated/gobl/currency/code.rb +118 -105
- data/lib/generated/gobl/currency/exchange_rate.rb +17 -7
- data/lib/generated/gobl/dsig/digest.rb +0 -1
- data/lib/generated/gobl/dsig/signature.rb +0 -1
- data/lib/generated/gobl/envelope.rb +0 -1
- data/lib/generated/gobl/head/header.rb +7 -8
- data/lib/generated/gobl/head/link.rb +43 -0
- data/lib/generated/gobl/head/stamp.rb +0 -1
- data/lib/generated/gobl/i18n/string.rb +0 -1
- data/lib/generated/gobl/l10n/code.rb +0 -1
- data/lib/generated/gobl/l10n/{country_code.rb → iso_country_code.rb} +3 -4
- data/lib/generated/gobl/l10n/tax_country_code.rb +277 -0
- data/lib/generated/gobl/note/message.rb +5 -1
- data/lib/generated/gobl/org/address.rb +5 -7
- data/lib/generated/gobl/org/coordinates.rb +0 -1
- data/lib/generated/gobl/org/document_ref.rb +87 -0
- data/lib/generated/gobl/org/email.rb +3 -4
- data/lib/generated/gobl/org/identity.rb +8 -4
- data/lib/generated/gobl/org/image.rb +3 -4
- data/lib/generated/gobl/org/inbox.rb +3 -4
- data/lib/generated/gobl/org/item.rb +10 -6
- data/lib/generated/gobl/org/name.rb +3 -6
- data/lib/generated/gobl/org/party.rb +8 -5
- data/lib/generated/gobl/org/person.rb +8 -4
- data/lib/generated/gobl/org/registration.rb +11 -3
- data/lib/generated/gobl/org/telephone.rb +3 -4
- data/lib/generated/gobl/org/unit.rb +0 -1
- data/lib/generated/gobl/org/website.rb +4 -5
- data/lib/generated/gobl/pay/advance.rb +8 -4
- data/lib/generated/gobl/pay/card.rb +0 -1
- data/lib/generated/gobl/pay/credit_transfer.rb +0 -1
- data/lib/generated/gobl/pay/direct_debit.rb +0 -1
- data/lib/generated/gobl/pay/due_date.rb +0 -1
- data/lib/generated/gobl/pay/instructions.rb +5 -1
- data/lib/generated/gobl/pay/online.rb +12 -8
- data/lib/generated/gobl/pay/terms.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers_employee.rb +0 -1
- data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_balance.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_item.rb +0 -1
- data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +0 -2
- data/lib/generated/gobl/regimes/mx/fuel_account_tax.rb +11 -9
- data/lib/generated/gobl/schema/object.rb +0 -1
- data/lib/generated/gobl/tax/addon_def.rb +61 -0
- data/lib/generated/gobl/tax/{category.rb → category_def.rb} +11 -12
- data/lib/generated/gobl/tax/category_total.rb +0 -1
- data/lib/generated/gobl/tax/combo.rb +6 -2
- data/lib/generated/gobl/tax/correction_definition.rb +1 -2
- data/lib/generated/gobl/tax/correction_set.rb +13 -0
- data/lib/generated/gobl/tax/extensions.rb +0 -1
- data/lib/generated/gobl/tax/identity.rb +13 -19
- data/lib/generated/gobl/tax/{rate.rb → rate_def.rb} +11 -17
- data/lib/generated/gobl/tax/rate_total.rb +6 -2
- data/lib/generated/gobl/tax/rate_total_surcharge.rb +0 -1
- data/lib/generated/gobl/tax/{rate_value.rb → rate_value_def.rb} +9 -5
- data/lib/generated/gobl/tax/{regime.rb → regime_def.rb} +38 -24
- data/lib/generated/gobl/tax/scenario.rb +20 -11
- data/lib/generated/gobl/tax/scenario_set.rb +1 -2
- data/lib/generated/gobl/tax/set.rb +0 -1
- data/lib/generated/gobl/tax/source.rb +1 -2
- data/lib/generated/gobl/tax/tag_set.rb +28 -0
- data/lib/generated/gobl/tax/total.rb +0 -1
- data/lib/gobl/extensions/bill/invoice_helper.rb +6 -36
- data/lib/gobl/extensions/envelope_helper.rb +4 -0
- data/lib/gobl/version.rb +1 -1
- data/lib/gobl.rb +3 -2
- metadata +20 -12
- data/lib/generated/gobl/bill/document_reference.rb +0 -37
- data/lib/generated/gobl/bill/preceding.rb +0 -79
- data/lib/generated/gobl/cbc/code_definition.rb +0 -38
- data/lib/generated/gobl/uuid/uuid.rb +0 -17
- data/lib/gobl/extensions/bill/scenario_summary.rb +0 -25
@@ -3,21 +3,25 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
10
9
|
module Tax
|
11
|
-
#
|
12
|
-
class
|
13
|
-
# The Schema ID of the GOBL
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/
|
10
|
+
# RateValueDef contains a percentage rate or fixed amount for a given date range.
|
11
|
+
class RateValueDef < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL RateValueDef structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/RateValueDef'
|
15
14
|
|
16
15
|
# @!attribute [r] tags
|
17
16
|
# Only apply this rate if one of the tags is present in the invoice.
|
18
17
|
# @return [Array<GOBL::CBC::Key>]
|
19
18
|
property :tags, [GOBL::CBC::Key]
|
20
19
|
|
20
|
+
# @!attribute [r] ext
|
21
|
+
# Ext map of keys that can be used to filter to determine if the rate applies.
|
22
|
+
# @return [GOBL::Tax::Extensions]
|
23
|
+
property :ext, GOBL::Tax::Extensions
|
24
|
+
|
21
25
|
# @!attribute [r] since
|
22
26
|
# Date from which this value should be applied.
|
23
27
|
# @return [GOBL::Cal::Date]
|
@@ -3,18 +3,17 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
10
9
|
module Tax
|
11
|
-
#
|
12
|
-
class
|
13
|
-
# The Schema ID of the GOBL
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime'
|
10
|
+
# RegimeDef defines the holding structure for the definitions of taxes inside a country or territory.
|
11
|
+
class RegimeDef < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL RegimeDef structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def'
|
15
14
|
|
16
15
|
# @!attribute [r] name
|
17
|
-
# Name of the
|
16
|
+
# Name of the tax regime.
|
18
17
|
# @return [GOBL::I18n::String]
|
19
18
|
property :name, GOBL::I18n::String
|
20
19
|
validates_presence_of :name
|
@@ -32,10 +31,15 @@ module GOBL
|
|
32
31
|
|
33
32
|
# @!attribute [r] country
|
34
33
|
# Country code for the region
|
35
|
-
# @return [GOBL::L10n::
|
36
|
-
property :country, GOBL::L10n::
|
34
|
+
# @return [GOBL::L10n::TaxCountryCode]
|
35
|
+
property :country, GOBL::L10n::TaxCountryCode
|
37
36
|
validates_presence_of :country
|
38
37
|
|
38
|
+
# @!attribute [r] alt_country_codes
|
39
|
+
# Alternative localization codes that may be used to identify the tax regime in specific circumstances.
|
40
|
+
# @return [Array<GOBL::L10n::Code>]
|
41
|
+
property :alt_country_codes, [GOBL::L10n::Code]
|
42
|
+
|
39
43
|
# @!attribute [r] zone
|
40
44
|
# Specific Locality, region, city, province, county, or similar code inside the country, if needed.
|
41
45
|
# @return [GOBL::L10n::Code]
|
@@ -47,30 +51,40 @@ module GOBL
|
|
47
51
|
property :currency, GOBL::Currency::Code
|
48
52
|
validates_presence_of :currency
|
49
53
|
|
54
|
+
# @!attribute [r] calculator_rounding_rule
|
55
|
+
# Rounding rule to use when calculating the tax totals, default is always `sum-then-round`.
|
56
|
+
# @return [String]
|
57
|
+
property :calculator_rounding_rule, String
|
58
|
+
|
50
59
|
# @!attribute [r] tags
|
51
60
|
# Tags that can be applied at the document level to identify additional considerations.
|
52
|
-
# @return [Array<
|
53
|
-
property :tags, [
|
54
|
-
|
55
|
-
# @!attribute [r] identity_types
|
56
|
-
# Identity types specific for the regime and may be validated against.
|
57
|
-
# @return [Array<GOBL::CBC::KeyDefinition>]
|
58
|
-
property :identity_types, [GOBL::CBC::KeyDefinition]
|
61
|
+
# @return [Array<TagSet>]
|
62
|
+
property :tags, [TagSet]
|
59
63
|
|
60
64
|
# @!attribute [r] extensions
|
61
65
|
# 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.
|
62
66
|
# @return [Array<GOBL::CBC::KeyDefinition>]
|
63
67
|
property :extensions, [GOBL::CBC::KeyDefinition]
|
64
68
|
|
65
|
-
# @!attribute [r]
|
66
|
-
#
|
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]
|
78
|
+
|
79
|
+
# @!attribute [r] charge_keys
|
80
|
+
# Charge keys specific for the regime and may be validated or used in the UI as suggestions
|
67
81
|
# @return [Array<GOBL::CBC::KeyDefinition>]
|
68
|
-
property :
|
82
|
+
property :charge_keys, [GOBL::CBC::KeyDefinition]
|
69
83
|
|
70
|
-
# @!attribute [r]
|
84
|
+
# @!attribute [r] payment_means_keys
|
71
85
|
# PaymentMeansKeys specific for the regime that extend the original base payment means keys.
|
72
86
|
# @return [Array<GOBL::CBC::KeyDefinition>]
|
73
|
-
property :
|
87
|
+
property :payment_means_keys, [GOBL::CBC::KeyDefinition]
|
74
88
|
|
75
89
|
# @!attribute [r] inbox_keys
|
76
90
|
# InboxKeys specific to the regime that can be used to identify where a document should be forwarded to.
|
@@ -83,13 +97,13 @@ module GOBL
|
|
83
97
|
|
84
98
|
# @!attribute [r] corrections
|
85
99
|
# Configuration details for corrections to be used with correction options.
|
86
|
-
# @return [
|
87
|
-
property :corrections,
|
100
|
+
# @return [CorrectionSet]
|
101
|
+
property :corrections, CorrectionSet
|
88
102
|
|
89
103
|
# @!attribute [r] categories
|
90
104
|
# List of tax categories.
|
91
|
-
# @return [Array<
|
92
|
-
property :categories, [
|
105
|
+
# @return [Array<CategoryDef>]
|
106
|
+
property :categories, [CategoryDef]
|
93
107
|
validates_presence_of :categories
|
94
108
|
end
|
95
109
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -11,7 +10,12 @@ module GOBL
|
|
11
10
|
# Scenario is used to describe a tax scenario of a document based on the combination of document type and tag used.
|
12
11
|
class Scenario < GOBL::Object
|
13
12
|
# The Schema ID of the GOBL Scenario structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/Scenario'
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/Scenario'
|
14
|
+
|
15
|
+
# @!attribute [r] name
|
16
|
+
# Name of the scenario for further information.
|
17
|
+
# @return [GOBL::I18n::String]
|
18
|
+
property :name, GOBL::I18n::String
|
15
19
|
|
16
20
|
# @!attribute [r] type
|
17
21
|
# Type of document, if present.
|
@@ -19,14 +23,19 @@ module GOBL
|
|
19
23
|
property :type, [GOBL::CBC::Key]
|
20
24
|
|
21
25
|
# @!attribute [r] tags
|
22
|
-
#
|
26
|
+
# Array of tags that have been applied to the document.
|
23
27
|
# @return [Array<GOBL::CBC::Key>]
|
24
28
|
property :tags, [GOBL::CBC::Key]
|
25
29
|
|
26
|
-
# @!attribute [r]
|
27
|
-
#
|
28
|
-
# @return [GOBL::
|
29
|
-
property :
|
30
|
+
# @!attribute [r] ext_key
|
31
|
+
# Extension key that must be present in the document.
|
32
|
+
# @return [GOBL::CBC::Key]
|
33
|
+
property :ext_key, GOBL::CBC::Key
|
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
|
30
39
|
|
31
40
|
# @!attribute [r] note
|
32
41
|
# A note to be added to the document if the scenario is applied.
|
@@ -38,10 +47,10 @@ module GOBL
|
|
38
47
|
# @return [GOBL::CBC::CodeMap]
|
39
48
|
property :codes, GOBL::CBC::CodeMap
|
40
49
|
|
41
|
-
# @!attribute [r]
|
42
|
-
#
|
43
|
-
# @return [GOBL::
|
44
|
-
property :
|
50
|
+
# @!attribute [r] ext
|
51
|
+
# Ext represents a set of tax extensions that should be applied to the document in the appropriate "tax" context.
|
52
|
+
# @return [GOBL::Tax::Extensions]
|
53
|
+
property :ext, GOBL::Tax::Extensions
|
45
54
|
end
|
46
55
|
end
|
47
56
|
end
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -11,7 +10,7 @@ module GOBL
|
|
11
10
|
# ScenarioSet is a collection of tax scenarios for a given schema that can be used to determine special codes or notes that need to be included in the final document.
|
12
11
|
class ScenarioSet < GOBL::Object
|
13
12
|
# The Schema ID of the GOBL ScenarioSet structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/ScenarioSet'
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/ScenarioSet'
|
15
14
|
|
16
15
|
# @!attribute [r] schema
|
17
16
|
# Partial or complete schema URL for the document type
|
@@ -3,7 +3,6 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
6
|
##
|
8
7
|
|
9
8
|
module GOBL
|
@@ -11,7 +10,7 @@ module GOBL
|
|
11
10
|
# Source describes where the information for the taxes comes from.
|
12
11
|
class Source < GOBL::Object
|
13
12
|
# The Schema ID of the GOBL Source structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/Source'
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/Source'
|
15
14
|
|
16
15
|
# @!attribute [r] title
|
17
16
|
# Title of the linked source to help distinguish between this and other links.
|
@@ -0,0 +1,28 @@
|
|
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
|
+
# TagSet defines a set of tags and their descriptions that can be used for a specific schema in the context of a Regime or Addon.
|
11
|
+
class TagSet < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL TagSet structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime-def#/$defs/TagSet'
|
14
|
+
|
15
|
+
# @!attribute [r] schema
|
16
|
+
# Schema that the tags are associated with.
|
17
|
+
# @return [String]
|
18
|
+
property :schema, String
|
19
|
+
validates_presence_of :schema
|
20
|
+
|
21
|
+
# @!attribute [r] list
|
22
|
+
# List of tags for the schema
|
23
|
+
# @return [Array<GOBL::CBC::KeyDefinition>]
|
24
|
+
property :list, [GOBL::CBC::KeyDefinition]
|
25
|
+
validates_presence_of :list
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -5,15 +5,14 @@ module GOBL
|
|
5
5
|
module Bill
|
6
6
|
# Additional methods for the generated {GOBL::Bill::Invoice} class
|
7
7
|
module InvoiceHelper
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
def self.included(klass)
|
9
|
+
klass.alias_method :tags, '$tags'
|
10
|
+
klass.alias_method :tags=, '$tags='
|
11
11
|
end
|
12
12
|
|
13
|
-
#
|
14
|
-
|
15
|
-
|
16
|
-
ScenarioSummary.new(matching_scenarios)
|
13
|
+
# Returns the applicable regime based on the supplier’s tax ID
|
14
|
+
def regime
|
15
|
+
regime_country && GOBL::Tax::RegimeDef.fetch(regime_country)
|
17
16
|
end
|
18
17
|
|
19
18
|
private
|
@@ -21,35 +20,6 @@ module GOBL
|
|
21
20
|
def regime_country
|
22
21
|
supplier&.tax_id&.country
|
23
22
|
end
|
24
|
-
|
25
|
-
def matching_scenarios
|
26
|
-
return [] unless scenario_set
|
27
|
-
|
28
|
-
scenario_set.list.select do |scenario|
|
29
|
-
matches_scenario?(scenario)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def matches_scenario?(scenario)
|
34
|
-
matches_scenario_tags?(scenario) && matches_scenario_type?(scenario)
|
35
|
-
end
|
36
|
-
|
37
|
-
def matches_scenario_type?(scenario)
|
38
|
-
scenario.type.blank? || scenario.type.include?(type)
|
39
|
-
end
|
40
|
-
|
41
|
-
def matches_scenario_tags?(scenario)
|
42
|
-
scenario_tags = scenario.tags || []
|
43
|
-
tax_tags = tax&.tags || []
|
44
|
-
|
45
|
-
(scenario_tags - tax_tags).empty?
|
46
|
-
end
|
47
|
-
|
48
|
-
def scenario_set
|
49
|
-
regime&.scenarios&.find do |scenario_set|
|
50
|
-
self.class::SCHEMA_ID.include?(scenario_set.schema)
|
51
|
-
end
|
52
|
-
end
|
53
23
|
end
|
54
24
|
end
|
55
25
|
end
|
data/lib/gobl/version.rb
CHANGED
data/lib/gobl.rb
CHANGED
@@ -18,7 +18,8 @@ loader.inflector.inflect(
|
|
18
18
|
'tax_id' => 'TaxID',
|
19
19
|
'dsig' => 'DSig',
|
20
20
|
'id' => 'ID',
|
21
|
-
'cbc' => 'CBC'
|
21
|
+
'cbc' => 'CBC',
|
22
|
+
'iso_country_code' => 'ISOCountryCode'
|
22
23
|
)
|
23
24
|
loader.ignore("#{__dir__}/ext")
|
24
25
|
loader.setup
|
@@ -49,5 +50,5 @@ GOBL::I18n::String.include GOBL::Extensions::I18n::ValueKeysHelper
|
|
49
50
|
GOBL::Schema::Object.include GOBL::Extensions::Schema::ObjectHelper
|
50
51
|
GOBL::Schema::Object.extend GOBL::Extensions::Schema::ObjectHelper::ClassMethods
|
51
52
|
GOBL::Envelope.include GOBL::Extensions::EnvelopeHelper
|
52
|
-
GOBL::Tax::
|
53
|
+
GOBL::Tax::RegimeDef.extend GOBL::Extensions::Tax::RegimeHelper::ClassMethods
|
53
54
|
GOBL::Bill::Invoice.include GOBL::Extensions::Bill::InvoiceHelper
|
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.
|
4
|
+
version: 0.22.0
|
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: 2024-
|
14
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|
@@ -62,12 +62,17 @@ extensions: []
|
|
62
62
|
extra_rdoc_files: []
|
63
63
|
files:
|
64
64
|
- README.md
|
65
|
+
- data/regimes/at.json
|
66
|
+
- data/regimes/be.json
|
65
67
|
- data/regimes/ca.json
|
68
|
+
- data/regimes/ch.json
|
66
69
|
- data/regimes/co.json
|
67
70
|
- data/regimes/de.json
|
71
|
+
- data/regimes/el.json
|
68
72
|
- data/regimes/es.json
|
69
73
|
- data/regimes/fr.json
|
70
74
|
- data/regimes/gb.json
|
75
|
+
- data/regimes/gr.json
|
71
76
|
- data/regimes/it.json
|
72
77
|
- data/regimes/mx.json
|
73
78
|
- data/regimes/nl.json
|
@@ -78,7 +83,6 @@ files:
|
|
78
83
|
- lib/generated/gobl/bill/correction_options.rb
|
79
84
|
- lib/generated/gobl/bill/delivery.rb
|
80
85
|
- lib/generated/gobl/bill/discount.rb
|
81
|
-
- lib/generated/gobl/bill/document_reference.rb
|
82
86
|
- lib/generated/gobl/bill/invoice.rb
|
83
87
|
- lib/generated/gobl/bill/line.rb
|
84
88
|
- lib/generated/gobl/bill/line_charge.rb
|
@@ -86,32 +90,35 @@ files:
|
|
86
90
|
- lib/generated/gobl/bill/ordering.rb
|
87
91
|
- lib/generated/gobl/bill/outlay.rb
|
88
92
|
- lib/generated/gobl/bill/payment.rb
|
89
|
-
- lib/generated/gobl/bill/preceding.rb
|
90
93
|
- lib/generated/gobl/bill/tax.rb
|
91
94
|
- lib/generated/gobl/bill/totals.rb
|
92
95
|
- lib/generated/gobl/cal/date.rb
|
93
96
|
- lib/generated/gobl/cal/date_time.rb
|
94
97
|
- lib/generated/gobl/cal/period.rb
|
95
98
|
- lib/generated/gobl/cbc/code.rb
|
96
|
-
- lib/generated/gobl/cbc/code_definition.rb
|
97
99
|
- lib/generated/gobl/cbc/code_map.rb
|
98
100
|
- lib/generated/gobl/cbc/key.rb
|
99
101
|
- lib/generated/gobl/cbc/key_definition.rb
|
100
102
|
- lib/generated/gobl/cbc/meta.rb
|
101
103
|
- lib/generated/gobl/cbc/note.rb
|
104
|
+
- lib/generated/gobl/cbc/value_definition.rb
|
105
|
+
- lib/generated/gobl/currency/amount.rb
|
102
106
|
- lib/generated/gobl/currency/code.rb
|
103
107
|
- lib/generated/gobl/currency/exchange_rate.rb
|
104
108
|
- lib/generated/gobl/dsig/digest.rb
|
105
109
|
- lib/generated/gobl/dsig/signature.rb
|
106
110
|
- lib/generated/gobl/envelope.rb
|
107
111
|
- lib/generated/gobl/head/header.rb
|
112
|
+
- lib/generated/gobl/head/link.rb
|
108
113
|
- lib/generated/gobl/head/stamp.rb
|
109
114
|
- lib/generated/gobl/i18n/string.rb
|
110
115
|
- lib/generated/gobl/l10n/code.rb
|
111
|
-
- lib/generated/gobl/l10n/
|
116
|
+
- lib/generated/gobl/l10n/iso_country_code.rb
|
117
|
+
- lib/generated/gobl/l10n/tax_country_code.rb
|
112
118
|
- lib/generated/gobl/note/message.rb
|
113
119
|
- lib/generated/gobl/org/address.rb
|
114
120
|
- lib/generated/gobl/org/coordinates.rb
|
121
|
+
- lib/generated/gobl/org/document_ref.rb
|
115
122
|
- lib/generated/gobl/org/email.rb
|
116
123
|
- lib/generated/gobl/org/identity.rb
|
117
124
|
- lib/generated/gobl/org/image.rb
|
@@ -140,28 +147,29 @@ files:
|
|
140
147
|
- lib/generated/gobl/regimes/mx/fuel_account_line.rb
|
141
148
|
- lib/generated/gobl/regimes/mx/fuel_account_tax.rb
|
142
149
|
- lib/generated/gobl/schema/object.rb
|
143
|
-
- lib/generated/gobl/tax/
|
150
|
+
- lib/generated/gobl/tax/addon_def.rb
|
151
|
+
- lib/generated/gobl/tax/category_def.rb
|
144
152
|
- lib/generated/gobl/tax/category_total.rb
|
145
153
|
- lib/generated/gobl/tax/combo.rb
|
146
154
|
- lib/generated/gobl/tax/correction_definition.rb
|
155
|
+
- lib/generated/gobl/tax/correction_set.rb
|
147
156
|
- lib/generated/gobl/tax/extensions.rb
|
148
157
|
- lib/generated/gobl/tax/identity.rb
|
149
|
-
- lib/generated/gobl/tax/
|
158
|
+
- lib/generated/gobl/tax/rate_def.rb
|
150
159
|
- lib/generated/gobl/tax/rate_total.rb
|
151
160
|
- lib/generated/gobl/tax/rate_total_surcharge.rb
|
152
|
-
- lib/generated/gobl/tax/
|
153
|
-
- lib/generated/gobl/tax/
|
161
|
+
- lib/generated/gobl/tax/rate_value_def.rb
|
162
|
+
- lib/generated/gobl/tax/regime_def.rb
|
154
163
|
- lib/generated/gobl/tax/scenario.rb
|
155
164
|
- lib/generated/gobl/tax/scenario_set.rb
|
156
165
|
- lib/generated/gobl/tax/set.rb
|
157
166
|
- lib/generated/gobl/tax/source.rb
|
167
|
+
- lib/generated/gobl/tax/tag_set.rb
|
158
168
|
- lib/generated/gobl/tax/total.rb
|
159
|
-
- lib/generated/gobl/uuid/uuid.rb
|
160
169
|
- lib/gobl.rb
|
161
170
|
- lib/gobl/config.rb
|
162
171
|
- lib/gobl/enum.rb
|
163
172
|
- lib/gobl/extensions/bill/invoice_helper.rb
|
164
|
-
- lib/gobl/extensions/bill/scenario_summary.rb
|
165
173
|
- lib/gobl/extensions/envelope_helper.rb
|
166
174
|
- lib/gobl/extensions/i18n/value_keys_helper.rb
|
167
175
|
- lib/gobl/extensions/schema/object_helper.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
##
|
4
|
-
## DO NOT EDIT - This file was generated automatically.
|
5
|
-
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
|
-
##
|
8
|
-
|
9
|
-
module GOBL
|
10
|
-
module Bill
|
11
|
-
# DocumentReference provides a link to a existing document.
|
12
|
-
class DocumentReference < GOBL::Object
|
13
|
-
# The Schema ID of the GOBL DocumentReference structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/DocumentReference'
|
15
|
-
|
16
|
-
# @!attribute [r] uuid
|
17
|
-
# Unique ID copied from the source document.
|
18
|
-
# @return [GOBL::UUID::UUID]
|
19
|
-
property :uuid, GOBL::UUID::UUID
|
20
|
-
|
21
|
-
# @!attribute [r] series
|
22
|
-
# Series the reference document belongs to.
|
23
|
-
# @return [String]
|
24
|
-
property :series, String
|
25
|
-
|
26
|
-
# @!attribute [r] code
|
27
|
-
# Source document's code or other identifier.
|
28
|
-
# @return [String]
|
29
|
-
property :code, String
|
30
|
-
|
31
|
-
# @!attribute [r] url
|
32
|
-
# Link to the source document.
|
33
|
-
# @return [String]
|
34
|
-
property :url, String
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
##
|
4
|
-
## DO NOT EDIT - This file was generated automatically.
|
5
|
-
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
|
-
##
|
8
|
-
|
9
|
-
module GOBL
|
10
|
-
module Bill
|
11
|
-
# Preceding allows for information to be provided about a previous invoice that this one will replace, subtract from, or add to.
|
12
|
-
class Preceding < GOBL::Object
|
13
|
-
# The Schema ID of the GOBL Preceding structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/bill/invoice#/$defs/Preceding'
|
15
|
-
|
16
|
-
# @!attribute [r] uuid
|
17
|
-
# Preceding document's UUID if available can be useful for tracing.
|
18
|
-
# @return [GOBL::UUID::UUID]
|
19
|
-
property :uuid, GOBL::UUID::UUID
|
20
|
-
|
21
|
-
# Enumeration of possible values for {#type} with their corresponding descriptions
|
22
|
-
TYPE_ENUM = {
|
23
|
-
'standard' => 'A regular commercial invoice document between a supplier and customer.',
|
24
|
-
'proforma' => 'For a clients validation before sending a final invoice.',
|
25
|
-
'corrective' => 'Corrected invoice that completely *replaces* the preceding document.',
|
26
|
-
'credit-note' => 'Reflects a refund either partial or complete of the preceding document. A
|
27
|
-
credit note effectively *extends* the previous document.',
|
28
|
-
'debit-note' => 'An additional set of charges to be added to the preceding document.'
|
29
|
-
}.freeze
|
30
|
-
|
31
|
-
# @!attribute [r] type
|
32
|
-
# Type of the preceding document
|
33
|
-
# @return [GOBL::CBC::Key]
|
34
|
-
property :type, GOBL::CBC::Key
|
35
|
-
validates_inclusion_of :type, in: TYPE_ENUM.keys, allow_blank: true
|
36
|
-
|
37
|
-
# @!attribute [r] series
|
38
|
-
# Series identification code
|
39
|
-
# @return [String]
|
40
|
-
property :series, String
|
41
|
-
|
42
|
-
# @!attribute [r] code
|
43
|
-
# Code of the previous document.
|
44
|
-
# @return [String]
|
45
|
-
property :code, String
|
46
|
-
validates_presence_of :code
|
47
|
-
|
48
|
-
# @!attribute [r] issue_date
|
49
|
-
# The issue date of the previous document.
|
50
|
-
# @return [GOBL::Cal::Date]
|
51
|
-
property :issue_date, GOBL::Cal::Date
|
52
|
-
|
53
|
-
# @!attribute [r] reason
|
54
|
-
# Human readable description on why the preceding invoice is being replaced.
|
55
|
-
# @return [String]
|
56
|
-
property :reason, String
|
57
|
-
|
58
|
-
# @!attribute [r] stamps
|
59
|
-
# Seals of approval from other organisations that may need to be listed.
|
60
|
-
# @return [Array<GOBL::Head::Stamp>]
|
61
|
-
property :stamps, [GOBL::Head::Stamp]
|
62
|
-
|
63
|
-
# @!attribute [r] period
|
64
|
-
# Tax period in which the previous invoice had an effect required by some tax regimes and formats.
|
65
|
-
# @return [GOBL::Cal::Period]
|
66
|
-
property :period, GOBL::Cal::Period
|
67
|
-
|
68
|
-
# @!attribute [r] ext
|
69
|
-
# Extensions for region specific requirements.
|
70
|
-
# @return [GOBL::Tax::Extensions]
|
71
|
-
property :ext, GOBL::Tax::Extensions
|
72
|
-
|
73
|
-
# @!attribute [r] meta
|
74
|
-
# Additional semi-structured data that may be useful in specific regions
|
75
|
-
# @return [GOBL::CBC::Meta]
|
76
|
-
property :meta, GOBL::CBC::Meta
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
##
|
4
|
-
## DO NOT EDIT - This file was generated automatically.
|
5
|
-
##
|
6
|
-
## Generated with GOBL v0.69.0
|
7
|
-
##
|
8
|
-
|
9
|
-
module GOBL
|
10
|
-
module CBC
|
11
|
-
# CodeDefinition describes a specific code and how it maps to a human name and description if appropriate.
|
12
|
-
class CodeDefinition < GOBL::Object
|
13
|
-
# The Schema ID of the GOBL CodeDefinition structure
|
14
|
-
SCHEMA_ID = 'https://gobl.org/draft-0/cbc/code-definition'
|
15
|
-
|
16
|
-
# @!attribute [r] code
|
17
|
-
# Code for which the definition is for.
|
18
|
-
# @return [GOBL::CBC::Code]
|
19
|
-
property :code, GOBL::CBC::Code
|
20
|
-
validates_presence_of :code
|
21
|
-
|
22
|
-
# @!attribute [r] name
|
23
|
-
# Short name for the code, if relevant.
|
24
|
-
# @return [GOBL::I18n::String]
|
25
|
-
property :name, GOBL::I18n::String
|
26
|
-
|
27
|
-
# @!attribute [r] desc
|
28
|
-
# Description offering more details about when the code should be used.
|
29
|
-
# @return [GOBL::I18n::String]
|
30
|
-
property :desc, GOBL::I18n::String
|
31
|
-
|
32
|
-
# @!attribute [r] meta
|
33
|
-
# Meta defines any additional details that may be useful or associated with the code.
|
34
|
-
# @return [GOBL::CBC::Meta]
|
35
|
-
property :meta, GOBL::CBC::Meta
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|