gobl 0.8.0 → 0.10.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.
- checksums.yaml +4 -4
- data/data/regimes/co.json +55 -1
- data/data/regimes/es.json +570 -64
- data/data/regimes/it.json +1182 -0
- data/lib/gobl/bill/charge.rb +1 -1
- data/lib/gobl/bill/delivery.rb +1 -1
- data/lib/gobl/bill/discount.rb +1 -1
- data/lib/gobl/bill/document_reference.rb +1 -1
- data/lib/gobl/bill/invoice.rb +19 -8
- data/lib/gobl/bill/line.rb +3 -3
- data/lib/gobl/bill/line_charge.rb +1 -1
- data/lib/gobl/bill/line_discount.rb +1 -1
- data/lib/gobl/bill/ordering.rb +1 -1
- data/lib/gobl/bill/outlay.rb +3 -3
- data/lib/gobl/bill/payment.rb +1 -1
- data/lib/gobl/bill/preceding.rb +23 -23
- data/lib/gobl/bill/tax.rb +4 -4
- data/lib/gobl/bill/totals.rb +5 -5
- data/lib/gobl/cal/date.rb +2 -2
- data/lib/gobl/cal/period.rb +3 -3
- data/lib/gobl/cbc/code.rb +3 -3
- data/lib/gobl/cbc/key.rb +2 -2
- data/lib/gobl/cbc/meta.rb +1 -1
- data/lib/gobl/cbc/note.rb +6 -6
- data/lib/gobl/cbc/stamp.rb +3 -3
- data/lib/gobl/currency/code.rb +4 -3
- data/lib/gobl/currency/exchange_rate.rb +3 -3
- data/lib/gobl/document.rb +5 -2
- data/lib/gobl/dsig/digest.rb +3 -3
- data/lib/gobl/dsig/signature.rb +2 -2
- data/lib/gobl/enum.rb +9 -67
- data/lib/gobl/envelope.rb +5 -5
- data/lib/gobl/header.rb +4 -4
- data/lib/gobl/i18n/string.rb +1 -1
- data/lib/gobl/l10n/code.rb +2 -2
- data/lib/gobl/l10n/country_code.rb +4 -3
- data/lib/gobl/note/message.rb +4 -4
- data/lib/gobl/org/address.rb +2 -2
- data/lib/gobl/org/coordinates.rb +1 -1
- data/lib/gobl/org/email.rb +2 -2
- data/lib/gobl/org/identity.rb +38 -0
- data/lib/gobl/org/image.rb +1 -1
- data/lib/gobl/org/inbox.rb +3 -3
- data/lib/gobl/org/item.rb +10 -10
- data/lib/gobl/org/name.rb +3 -3
- data/lib/gobl/org/party.rb +7 -7
- data/lib/gobl/org/person.rb +2 -7
- data/lib/gobl/org/registration.rb +1 -1
- data/lib/gobl/org/telephone.rb +2 -2
- data/lib/gobl/org/unit.rb +8 -3
- data/lib/gobl/org/website.rb +2 -2
- data/lib/gobl/pay/advance.rb +3 -3
- data/lib/gobl/pay/card.rb +3 -3
- data/lib/gobl/pay/credit_transfer.rb +1 -1
- data/lib/gobl/pay/direct_debit.rb +1 -1
- data/lib/gobl/pay/due_date.rb +3 -3
- data/lib/gobl/pay/instructions.rb +19 -4
- data/lib/gobl/pay/online.rb +2 -2
- data/lib/gobl/pay/terms.rb +19 -4
- data/lib/gobl/tax/category.rb +14 -4
- data/lib/gobl/tax/category_total.rb +5 -5
- data/lib/gobl/tax/combo.rb +7 -2
- data/lib/gobl/tax/identity.rb +16 -6
- data/lib/gobl/tax/key_definition.rb +38 -0
- data/lib/gobl/tax/preceding_definitions.rb +27 -0
- data/lib/gobl/tax/rate.rb +11 -4
- data/lib/gobl/tax/rate_total.rb +4 -4
- data/lib/gobl/tax/rate_total_surcharge.rb +3 -3
- data/lib/gobl/tax/rate_value.rb +2 -2
- data/lib/gobl/tax/regime.rb +19 -9
- data/lib/gobl/tax/scenario.rb +37 -0
- data/lib/gobl/tax/scenario_set.rb +29 -0
- data/lib/gobl/tax/set.rb +1 -1
- data/lib/gobl/tax/tag.rb +33 -0
- data/lib/gobl/tax/total.rb +2 -2
- data/lib/gobl/tax/zone.rb +2 -2
- data/lib/gobl/uuid/uuid.rb +2 -2
- data/lib/gobl/version.rb +1 -1
- metadata +10 -11
- data/lib/gobl/bill/invoice_type.rb +0 -32
- data/lib/gobl/cbc/note_key.rb +0 -50
- data/lib/gobl/org/item_code.rb +0 -28
- data/lib/gobl/pay/method_key.rb +0 -32
- data/lib/gobl/pay/term_key.rb +0 -35
- data/lib/gobl/tax/scheme.rb +0 -44
- data/lib/gobl/tax/source_key.rb +0 -30
- data/lib/gobl/value.rb +0 -77
data/lib/gobl/pay/due_date.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,7 +17,7 @@ module GOBL
|
|
17
17
|
# When the payment is due.
|
18
18
|
# @return [GOBL::Cal::Date]
|
19
19
|
property :date, GOBL::Cal::Date
|
20
|
-
|
20
|
+
validates_presence_of :date
|
21
21
|
|
22
22
|
# @!attribute [r] notes
|
23
23
|
# Other details to take into account for the due date.
|
@@ -28,7 +28,7 @@ module GOBL
|
|
28
28
|
# How much needs to be paid by the date.
|
29
29
|
# @return [GOBL::Num::Amount]
|
30
30
|
property :amount, GOBL::Num::Amount
|
31
|
-
|
31
|
+
validates_presence_of :amount
|
32
32
|
|
33
33
|
# @!attribute [r] percent
|
34
34
|
# Percentage of the total that should be paid by the date.
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -13,11 +13,26 @@ module GOBL
|
|
13
13
|
# The Schema ID of the GOBL Instructions structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/pay/instructions'
|
15
15
|
|
16
|
+
# Enumeration of possible values for {#key} with their corresponding descriptions
|
17
|
+
KEY_ENUM = {
|
18
|
+
'any' => 'Any method available, no preference',
|
19
|
+
'card' => 'Credit or debit card',
|
20
|
+
'credit-transfer' => 'Sender initiated bank or wire transfer',
|
21
|
+
'debit-transfer' => 'Receiver initiated bank or wire transfer',
|
22
|
+
'cash' => 'Cash',
|
23
|
+
'cheque' => 'Cheque',
|
24
|
+
'credit' => 'Credit',
|
25
|
+
'bank-draft' => 'Bankers Draft or Bank Cheque',
|
26
|
+
'direct-debit' => 'Direct debit',
|
27
|
+
'online' => 'Online or web payment'
|
28
|
+
}.freeze
|
29
|
+
|
16
30
|
# @!attribute [r] key
|
17
31
|
# How payment is expected or has been arranged to be collected
|
18
|
-
# @return [
|
19
|
-
property :key,
|
20
|
-
|
32
|
+
# @return [GOBL::CBC::Key]
|
33
|
+
property :key, GOBL::CBC::Key
|
34
|
+
validates_presence_of :key
|
35
|
+
validates_inclusion_of :key, in: KEY_ENUM.keys
|
21
36
|
|
22
37
|
# @!attribute [r] detail
|
23
38
|
# Optional text description of the payment method
|
data/lib/gobl/pay/online.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -22,7 +22,7 @@ module GOBL
|
|
22
22
|
# Full URL to be used for payment.
|
23
23
|
# @return [String]
|
24
24
|
property :addr, String
|
25
|
-
|
25
|
+
validates_presence_of :addr
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/gobl/pay/terms.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -13,11 +13,26 @@ module GOBL
|
|
13
13
|
# The Schema ID of the GOBL Terms structure
|
14
14
|
SCHEMA_ID = 'https://gobl.org/draft-0/pay/terms'
|
15
15
|
|
16
|
+
# Enumeration of possible values for {#key} with their corresponding descriptions
|
17
|
+
KEY_ENUM = {
|
18
|
+
'' => 'Not yet defined',
|
19
|
+
'end-of-month' => 'End of month',
|
20
|
+
'due-date' => 'Due on a specific date',
|
21
|
+
'deferred' => 'Deferred until after the due date',
|
22
|
+
'proximo' => 'Month after the present',
|
23
|
+
'instant' => 'On receipt of invoice',
|
24
|
+
'elective' => 'Chosen by the buyer',
|
25
|
+
'pending' => 'Seller to advise buyer in separate transaction',
|
26
|
+
'advance' => 'Payment made in advance',
|
27
|
+
'delivery' => 'Payment on Delivery'
|
28
|
+
}.freeze
|
29
|
+
|
16
30
|
# @!attribute [r] key
|
17
31
|
# Type of terms to be applied.
|
18
|
-
# @return [
|
19
|
-
property :key,
|
20
|
-
|
32
|
+
# @return [GOBL::CBC::Key]
|
33
|
+
property :key, GOBL::CBC::Key
|
34
|
+
validates_presence_of :key
|
35
|
+
validates_inclusion_of :key, in: KEY_ENUM.keys
|
21
36
|
|
22
37
|
# @!attribute [r] detail
|
23
38
|
# Text detail of the chosen payment terms.
|
data/lib/gobl/tax/category.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -16,12 +16,12 @@ module GOBL
|
|
16
16
|
# @!attribute [r] code
|
17
17
|
# @return [GOBL::CBC::Code]
|
18
18
|
property :code, GOBL::CBC::Code
|
19
|
-
|
19
|
+
validates_presence_of :code
|
20
20
|
|
21
21
|
# @!attribute [r] name
|
22
22
|
# @return [GOBL::I18n::String]
|
23
23
|
property :name, GOBL::I18n::String
|
24
|
-
|
24
|
+
validates_presence_of :name
|
25
25
|
|
26
26
|
# @!attribute [r] desc
|
27
27
|
# @return [GOBL::I18n::String]
|
@@ -36,7 +36,17 @@ module GOBL
|
|
36
36
|
# Specific tax definitions inside this category.
|
37
37
|
# @return [Array<Rate>]
|
38
38
|
property :rates, [Rate]
|
39
|
-
|
39
|
+
validates_presence_of :rates
|
40
|
+
|
41
|
+
# @!attribute [r] tags
|
42
|
+
# Tags contains a set of tag definitions that can be applied for this tax category.
|
43
|
+
# @return [Array<Tag>]
|
44
|
+
property :tags, [Tag]
|
45
|
+
|
46
|
+
# @!attribute [r] meta
|
47
|
+
# Meta contains additional information about the category that is relevant for local frequently used formats.
|
48
|
+
# @return [GOBL::CBC::Meta]
|
49
|
+
property :meta, GOBL::CBC::Meta
|
40
50
|
end
|
41
51
|
end
|
42
52
|
end
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -16,7 +16,7 @@ module GOBL
|
|
16
16
|
# @!attribute [r] code
|
17
17
|
# @return [GOBL::CBC::Code]
|
18
18
|
property :code, GOBL::CBC::Code
|
19
|
-
|
19
|
+
validates_presence_of :code
|
20
20
|
|
21
21
|
# @!attribute [r] retained
|
22
22
|
# @return [Boolean]
|
@@ -25,17 +25,17 @@ module GOBL
|
|
25
25
|
# @!attribute [r] rates
|
26
26
|
# @return [Array<RateTotal>]
|
27
27
|
property :rates, [RateTotal]
|
28
|
-
|
28
|
+
validates_presence_of :rates
|
29
29
|
|
30
30
|
# @!attribute [r] base
|
31
31
|
# @return [GOBL::Num::Amount]
|
32
32
|
property :base, GOBL::Num::Amount
|
33
|
-
|
33
|
+
validates_presence_of :base
|
34
34
|
|
35
35
|
# @!attribute [r] amount
|
36
36
|
# @return [GOBL::Num::Amount]
|
37
37
|
property :amount, GOBL::Num::Amount
|
38
|
-
|
38
|
+
validates_presence_of :amount
|
39
39
|
|
40
40
|
# @!attribute [r] surcharge
|
41
41
|
# @return [GOBL::Num::Amount]
|
data/lib/gobl/tax/combo.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,7 +17,7 @@ module GOBL
|
|
17
17
|
# Tax category code from those available inside a region.
|
18
18
|
# @return [GOBL::CBC::Code]
|
19
19
|
property :cat, GOBL::CBC::Code
|
20
|
-
|
20
|
+
validates_presence_of :cat
|
21
21
|
|
22
22
|
# @!attribute [r] rate
|
23
23
|
# Rate within a category to apply.
|
@@ -33,6 +33,11 @@ module GOBL
|
|
33
33
|
# Some countries require an additional surcharge (calculated if rate present).
|
34
34
|
# @return [GOBL::Num::Percentage]
|
35
35
|
property :surcharge, GOBL::Num::Percentage
|
36
|
+
|
37
|
+
# @!attribute [r] tags
|
38
|
+
# Additional data may be required in some regimes, the tags property helps reference them.
|
39
|
+
# @return [Array<GOBL::CBC::Key>]
|
40
|
+
property :tags, [GOBL::CBC::Key]
|
36
41
|
end
|
37
42
|
end
|
38
43
|
end
|
data/lib/gobl/tax/identity.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -22,22 +22,32 @@ module GOBL
|
|
22
22
|
# ISO country code for Where the tax identity was issued.
|
23
23
|
# @return [GOBL::L10n::CountryCode]
|
24
24
|
property :country, GOBL::L10n::CountryCode
|
25
|
-
|
25
|
+
validates_presence_of :country
|
26
26
|
|
27
27
|
# @!attribute [r] zone
|
28
28
|
# Where inside the country the tax identity holder is based for tax purposes like a village, town, district, city, county, state or province. For some areas, this could be a regular post or zip code. See the regime packages for specific validation rules.
|
29
29
|
# @return [GOBL::L10n::Code]
|
30
30
|
property :zone, GOBL::L10n::Code
|
31
31
|
|
32
|
+
# Enumeration of possible values for {#source} with their corresponding descriptions
|
33
|
+
SOURCE_ENUM = {
|
34
|
+
'tax-agency' => 'Sourced directly from a tax agency',
|
35
|
+
'passport' => 'A passport document',
|
36
|
+
'national' => 'National ID Card or similar',
|
37
|
+
'permit' => 'Residential or similar permit',
|
38
|
+
'other' => 'An other type of source not listed'
|
39
|
+
}.freeze
|
40
|
+
|
32
41
|
# @!attribute [r] source
|
33
42
|
# What is the source document of the tax identity.
|
34
|
-
# @return [
|
35
|
-
property :source,
|
43
|
+
# @return [GOBL::CBC::Key]
|
44
|
+
property :source, GOBL::CBC::Key
|
45
|
+
validates_inclusion_of :source, in: SOURCE_ENUM.keys, allow_blank: true
|
36
46
|
|
37
47
|
# @!attribute [r] code
|
38
48
|
# Normalized code shown on the original identity document.
|
39
|
-
# @return [
|
40
|
-
property :code,
|
49
|
+
# @return [GOBL::CBC::Code]
|
50
|
+
property :code, GOBL::CBC::Code
|
41
51
|
|
42
52
|
# @!attribute [r] meta
|
43
53
|
# Additional details that may be required.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.38.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Tax
|
11
|
+
# KeyDefinition defines properties of a key that is specific for a regime.
|
12
|
+
class KeyDefinition < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL KeyDefinition structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/KeyDefinition'
|
15
|
+
|
16
|
+
# @!attribute [r] key
|
17
|
+
# Actual key value.
|
18
|
+
# @return [GOBL::CBC::Key]
|
19
|
+
property :key, GOBL::CBC::Key
|
20
|
+
validates_presence_of :key
|
21
|
+
|
22
|
+
# @!attribute [r] name
|
23
|
+
# Short name for the key, 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 key should be used.
|
29
|
+
# @return [GOBL::I18n::String]
|
30
|
+
property :desc, GOBL::I18n::String
|
31
|
+
|
32
|
+
# @!attribute [r] meta
|
33
|
+
# Any additional data that might be relevant in some regimes?
|
34
|
+
# @return [GOBL::CBC::Meta]
|
35
|
+
property :meta, GOBL::CBC::Meta
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.38.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Tax
|
11
|
+
# PrecedingDefinitions contains details about what can be defined in Invoice preceding document data.
|
12
|
+
class PrecedingDefinitions < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL PrecedingDefinitions structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/PrecedingDefinitions'
|
15
|
+
|
16
|
+
# @!attribute [r] corrections
|
17
|
+
# Corrections contains a list of all the keys that can be used to identify a correction.
|
18
|
+
# @return [Array<KeyDefinition>]
|
19
|
+
property :corrections, [KeyDefinition]
|
20
|
+
|
21
|
+
# @!attribute [r] correction_methods
|
22
|
+
# CorrectionMethods describe the methods used to correct an invoice.
|
23
|
+
# @return [Array<KeyDefinition>]
|
24
|
+
property :correction_methods, [KeyDefinition]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/gobl/tax/rate.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,14 +17,16 @@ module GOBL
|
|
17
17
|
# Key identifies this rate within the system
|
18
18
|
# @return [GOBL::CBC::Key]
|
19
19
|
property :key, GOBL::CBC::Key
|
20
|
-
|
20
|
+
validates_presence_of :key
|
21
21
|
|
22
22
|
# @!attribute [r] name
|
23
|
+
# Human name of the rate
|
23
24
|
# @return [GOBL::I18n::String]
|
24
25
|
property :name, GOBL::I18n::String
|
25
|
-
|
26
|
+
validates_presence_of :name
|
26
27
|
|
27
28
|
# @!attribute [r] desc
|
29
|
+
# Useful description of the rate.
|
28
30
|
# @return [GOBL::I18n::String]
|
29
31
|
property :desc, GOBL::I18n::String
|
30
32
|
|
@@ -32,7 +34,12 @@ module GOBL
|
|
32
34
|
# 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.
|
33
35
|
# @return [Array<RateValue>]
|
34
36
|
property :values, [RateValue]
|
35
|
-
|
37
|
+
validates_presence_of :values
|
38
|
+
|
39
|
+
# @!attribute [r] meta
|
40
|
+
# Meta contains additional information about the rate that is relevant for local frequently used implementations.
|
41
|
+
# @return [GOBL::CBC::Meta]
|
42
|
+
property :meta, GOBL::CBC::Meta
|
36
43
|
end
|
37
44
|
end
|
38
45
|
end
|
data/lib/gobl/tax/rate_total.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -20,18 +20,18 @@ module GOBL
|
|
20
20
|
# @!attribute [r] base
|
21
21
|
# @return [GOBL::Num::Amount]
|
22
22
|
property :base, GOBL::Num::Amount
|
23
|
-
|
23
|
+
validates_presence_of :base
|
24
24
|
|
25
25
|
# @!attribute [r] percent
|
26
26
|
# @return [GOBL::Num::Percentage]
|
27
27
|
property :percent, GOBL::Num::Percentage
|
28
|
-
|
28
|
+
validates_presence_of :percent
|
29
29
|
|
30
30
|
# @!attribute [r] amount
|
31
31
|
# Total amount of rate, excluding surcharges
|
32
32
|
# @return [GOBL::Num::Amount]
|
33
33
|
property :amount, GOBL::Num::Amount
|
34
|
-
|
34
|
+
validates_presence_of :amount
|
35
35
|
|
36
36
|
# @!attribute [r] surcharge
|
37
37
|
# @return [RateTotalSurcharge]
|
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -16,12 +16,12 @@ module GOBL
|
|
16
16
|
# @!attribute [r] percent
|
17
17
|
# @return [GOBL::Num::Percentage]
|
18
18
|
property :percent, GOBL::Num::Percentage
|
19
|
-
|
19
|
+
validates_presence_of :percent
|
20
20
|
|
21
21
|
# @!attribute [r] amount
|
22
22
|
# @return [GOBL::Num::Amount]
|
23
23
|
property :amount, GOBL::Num::Amount
|
24
|
-
|
24
|
+
validates_presence_of :amount
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
data/lib/gobl/tax/rate_value.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -27,7 +27,7 @@ module GOBL
|
|
27
27
|
# Percent rate that should be applied
|
28
28
|
# @return [GOBL::Num::Percentage]
|
29
29
|
property :percent, GOBL::Num::Percentage
|
30
|
-
|
30
|
+
validates_presence_of :percent
|
31
31
|
|
32
32
|
# @!attribute [r] surcharge
|
33
33
|
# An additional surcharge to apply.
|
data/lib/gobl/tax/regime.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,13 +17,13 @@ module GOBL
|
|
17
17
|
# Name of the country
|
18
18
|
# @return [GOBL::I18n::String]
|
19
19
|
property :name, GOBL::I18n::String
|
20
|
-
|
20
|
+
validates_presence_of :name
|
21
21
|
|
22
22
|
# @!attribute [r] country
|
23
23
|
# Country code for the region
|
24
24
|
# @return [GOBL::L10n::CountryCode]
|
25
25
|
property :country, GOBL::L10n::CountryCode
|
26
|
-
|
26
|
+
validates_presence_of :country
|
27
27
|
|
28
28
|
# @!attribute [r] zone
|
29
29
|
# Specific Locality, region, city, province, county, or similar code inside the country, if needed.
|
@@ -39,18 +39,28 @@ module GOBL
|
|
39
39
|
# Currency used by the country.
|
40
40
|
# @return [GOBL::Currency::Code]
|
41
41
|
property :currency, GOBL::Currency::Code
|
42
|
-
|
42
|
+
validates_presence_of :currency
|
43
43
|
|
44
|
-
# @!attribute [r]
|
45
|
-
#
|
46
|
-
# @return [Array<
|
47
|
-
property :
|
44
|
+
# @!attribute [r] tags
|
45
|
+
# Tags that can be applied at the document level to identify additional considerations.
|
46
|
+
# @return [Array<Tag>]
|
47
|
+
property :tags, [Tag]
|
48
|
+
|
49
|
+
# @!attribute [r] scenarios
|
50
|
+
# Sets of scenario definitions for the regime.
|
51
|
+
# @return [Array<ScenarioSet>]
|
52
|
+
property :scenarios, [ScenarioSet]
|
53
|
+
|
54
|
+
# @!attribute [r] preceding
|
55
|
+
# Configuration details for preceding options.
|
56
|
+
# @return [PrecedingDefinitions]
|
57
|
+
property :preceding, PrecedingDefinitions
|
48
58
|
|
49
59
|
# @!attribute [r] categories
|
50
60
|
# List of tax categories.
|
51
61
|
# @return [Array<Category>]
|
52
62
|
property :categories, [Category]
|
53
|
-
|
63
|
+
validates_presence_of :categories
|
54
64
|
end
|
55
65
|
end
|
56
66
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.38.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Tax
|
11
|
+
# Scenario is used to describe a tax scenario of a document based on the combination of document type and tag used.
|
12
|
+
class Scenario < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL Scenario structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/Scenario'
|
15
|
+
|
16
|
+
# @!attribute [r] type
|
17
|
+
# Type of document, if present.
|
18
|
+
# @return [Array<GOBL::CBC::Key>]
|
19
|
+
property :type, [GOBL::CBC::Key]
|
20
|
+
|
21
|
+
# @!attribute [r] tags
|
22
|
+
# Tag that was applied to the document
|
23
|
+
# @return [Array<GOBL::CBC::Key>]
|
24
|
+
property :tags, [GOBL::CBC::Key]
|
25
|
+
|
26
|
+
# @!attribute [r] note
|
27
|
+
# A note to be added to the document if the scenario is applied.
|
28
|
+
# @return [GOBL::CBC::Note]
|
29
|
+
property :note, GOBL::CBC::Note
|
30
|
+
|
31
|
+
# @!attribute [r] meta
|
32
|
+
# Any additional local meta data that may be useful in integrations.
|
33
|
+
# @return [GOBL::CBC::Meta]
|
34
|
+
property :meta, GOBL::CBC::Meta
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.38.0
|
7
|
+
##
|
8
|
+
|
9
|
+
module GOBL
|
10
|
+
module Tax
|
11
|
+
# 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
|
+
class ScenarioSet < GOBL::Object
|
13
|
+
# The Schema ID of the GOBL ScenarioSet structure
|
14
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/regime#/$defs/ScenarioSet'
|
15
|
+
|
16
|
+
# @!attribute [r] schema
|
17
|
+
# Partial or complete schema URL for the document type
|
18
|
+
# @return [String]
|
19
|
+
property :schema, String
|
20
|
+
validates_presence_of :schema
|
21
|
+
|
22
|
+
# @!attribute [r] list
|
23
|
+
# List of scenarios for the schema
|
24
|
+
# @return [Array<Scenario>]
|
25
|
+
property :list, [Scenario]
|
26
|
+
validates_presence_of :list
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/gobl/tax/set.rb
CHANGED
data/lib/gobl/tax/tag.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
##
|
4
|
+
## DO NOT EDIT - This file was generated automatically.
|
5
|
+
##
|
6
|
+
## Generated with GOBL v0.38.0
|
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
|
data/lib/gobl/tax/total.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -22,7 +22,7 @@ module GOBL
|
|
22
22
|
# Total value of all the taxes applied.
|
23
23
|
# @return [GOBL::Num::Amount]
|
24
24
|
property :sum, GOBL::Num::Amount
|
25
|
-
|
25
|
+
validates_presence_of :sum
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/lib/gobl/tax/zone.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
##
|
4
4
|
## DO NOT EDIT - This file was generated automatically.
|
5
5
|
##
|
6
|
-
## Generated with GOBL v0.
|
6
|
+
## Generated with GOBL v0.38.0
|
7
7
|
##
|
8
8
|
|
9
9
|
module GOBL
|
@@ -17,7 +17,7 @@ module GOBL
|
|
17
17
|
# Unique zone code.
|
18
18
|
# @return [GOBL::L10n::Code]
|
19
19
|
property :code, GOBL::L10n::Code
|
20
|
-
|
20
|
+
validates_presence_of :code
|
21
21
|
|
22
22
|
# @!attribute [r] name
|
23
23
|
# Name of the zone to be use if a locality or region is not applicable.
|