gobl 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/data/regimes/ae.json +173 -0
- data/data/regimes/at.json +56 -50
- data/data/regimes/be.json +56 -50
- data/data/regimes/br.json +135 -0
- data/data/regimes/ca.json +2 -1
- data/data/regimes/ch.json +56 -50
- data/data/regimes/co.json +34 -203
- data/data/regimes/de.json +74 -47
- data/data/regimes/el.json +211 -0
- data/data/regimes/es.json +69 -550
- data/data/regimes/fr.json +56 -50
- data/data/regimes/gb.json +60 -50
- data/data/regimes/in.json +128 -0
- data/data/regimes/it.json +48 -1311
- data/data/regimes/mx.json +39 -639
- data/data/regimes/nl.json +56 -50
- data/data/regimes/pl.json +101 -97
- data/data/regimes/pt.json +1459 -227
- data/data/regimes/us.json +55 -50
- data/lib/generated/gobl/bill/charge.rb +34 -19
- data/lib/generated/gobl/bill/correction_options.rb +8 -3
- data/lib/generated/gobl/bill/delivery.rb +184 -16
- data/lib/generated/gobl/bill/delivery_details.rb +41 -0
- data/lib/generated/gobl/bill/discount.rb +36 -13
- data/lib/generated/gobl/bill/invoice.rb +88 -41
- data/lib/generated/gobl/bill/line.rb +39 -4
- data/lib/generated/gobl/bill/line_charge.rb +56 -11
- data/lib/generated/gobl/bill/line_discount.rb +45 -12
- data/lib/generated/gobl/bill/order.rb +208 -0
- data/lib/generated/gobl/bill/ordering.rb +40 -35
- data/lib/generated/gobl/bill/payment.rb +155 -15
- data/lib/generated/gobl/bill/payment_details.rb +36 -0
- data/lib/generated/gobl/bill/payment_line.rb +77 -0
- data/lib/generated/gobl/bill/sub_line.rb +83 -0
- data/lib/generated/gobl/bill/tax.rb +19 -5
- data/lib/generated/gobl/bill/totals.rb +18 -18
- data/lib/generated/gobl/bill/tracking.rb +26 -0
- data/lib/generated/gobl/cal/date_time.rb +1 -1
- data/lib/generated/gobl/cal/time.rb +16 -0
- data/lib/generated/gobl/cbc/code.rb +2 -1
- data/lib/generated/gobl/cbc/{key_definition.rb → definition.rb} +18 -14
- data/lib/generated/gobl/cbc/source.rb +37 -0
- data/lib/generated/gobl/currency/code.rb +16 -16
- data/lib/generated/gobl/currency/exchange_rate.rb +10 -5
- data/lib/generated/gobl/head/header.rb +5 -5
- data/lib/generated/gobl/head/link.rb +43 -0
- data/lib/generated/gobl/l10n/{country_code.rb → iso_country_code.rb} +3 -3
- data/lib/generated/gobl/l10n/tax_country_code.rb +277 -0
- data/lib/generated/gobl/org/address.rb +11 -7
- data/lib/generated/gobl/org/attachment.rb +62 -0
- data/lib/generated/gobl/org/document_ref.rb +102 -0
- data/lib/generated/gobl/org/identity.rb +11 -1
- data/lib/generated/gobl/org/inbox.rb +22 -14
- data/lib/generated/gobl/org/item.rb +4 -5
- data/lib/generated/gobl/org/name.rb +0 -2
- data/lib/generated/gobl/{cbc → org}/note.rb +16 -5
- data/lib/generated/gobl/org/party.rb +9 -6
- data/lib/generated/gobl/org/person.rb +5 -0
- data/lib/generated/gobl/org/registration.rb +4 -0
- data/lib/generated/gobl/org/telephone.rb +1 -1
- data/lib/generated/gobl/org/unit.rb +2 -1
- data/lib/generated/gobl/pay/advance.rb +8 -1
- data/lib/generated/gobl/pay/card.rb +5 -2
- data/lib/generated/gobl/pay/instructions.rb +10 -3
- data/lib/generated/gobl/pay/terms.rb +7 -2
- data/lib/generated/gobl/regimes/mx/food_vouchers_line.rb +5 -0
- data/lib/generated/gobl/regimes/mx/fuel_account_line.rb +5 -0
- data/lib/generated/gobl/tax/addon_def.rb +76 -0
- data/lib/generated/gobl/tax/catalogue_def.rb +39 -0
- data/lib/generated/gobl/tax/{category.rb → category_def.rb} +14 -14
- data/lib/generated/gobl/tax/combo.rb +5 -0
- data/lib/generated/gobl/tax/correction_definition.rb +6 -1
- data/lib/generated/gobl/tax/correction_set.rb +13 -0
- data/lib/generated/gobl/tax/identity.rb +8 -3
- data/lib/generated/gobl/tax/{rate.rb → rate_def.rb} +11 -16
- data/lib/generated/gobl/tax/rate_total.rb +5 -0
- data/lib/generated/gobl/tax/{rate_value.rb → rate_value_def.rb} +4 -4
- data/lib/generated/gobl/tax/{regime.rb → regime_def.rb} +38 -33
- data/lib/generated/gobl/tax/scenario.rb +22 -12
- data/lib/generated/gobl/tax/scenario_note.rb +42 -0
- data/lib/generated/gobl/tax/scenario_set.rb +1 -1
- data/lib/generated/gobl/tax/tag_set.rb +28 -0
- data/lib/generated/gobl/tax/total.rb +6 -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 +36 -21
- data/lib/generated/gobl/bill/document_reference.rb +0 -36
- data/lib/generated/gobl/bill/outlay.rb +0 -58
- data/lib/generated/gobl/bill/preceding.rb +0 -78
- data/lib/generated/gobl/cbc/code_definition.rb +0 -37
- data/lib/generated/gobl/tax/source.rb +0 -27
- data/lib/gobl/extensions/bill/scenario_summary.rb +0 -25
@@ -0,0 +1,62 @@
|
|
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
|
+
|
56
|
+
# @!attribute [r] data
|
57
|
+
# Data is the base64 encoded data of the attachment directly embedded inside the GOBL document. This should only be used when the URL cannot be used as it can dramatically increase the size of the JSON document, thus effecting usability and performance.
|
58
|
+
# @return [String]
|
59
|
+
property :data, String
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,102 @@
|
|
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
|
+
# DocumentRef is used to describe an existing document or a specific part of it's contents.
|
11
|
+
class DocumentRef < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL DocumentRef structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/org/document-ref'
|
14
|
+
|
15
|
+
# @!attribute [r] uuid
|
16
|
+
# Universally Unique Identifier.
|
17
|
+
# @return [String]
|
18
|
+
property :uuid, String
|
19
|
+
|
20
|
+
# @!attribute [r] type
|
21
|
+
# Type of the document referenced.
|
22
|
+
# @return [GOBL::CBC::Key]
|
23
|
+
property :type, GOBL::CBC::Key
|
24
|
+
|
25
|
+
# @!attribute [r] issue_date
|
26
|
+
# IssueDate reflects the date the document was issued.
|
27
|
+
# @return [GOBL::Cal::Date]
|
28
|
+
property :issue_date, GOBL::Cal::Date
|
29
|
+
|
30
|
+
# @!attribute [r] series
|
31
|
+
# Series the referenced document belongs to.
|
32
|
+
# @return [GOBL::CBC::Code]
|
33
|
+
property :series, GOBL::CBC::Code
|
34
|
+
|
35
|
+
# @!attribute [r] code
|
36
|
+
# Source document's code or other identifier.
|
37
|
+
# @return [GOBL::CBC::Code]
|
38
|
+
property :code, GOBL::CBC::Code
|
39
|
+
validates_presence_of :code
|
40
|
+
|
41
|
+
# @!attribute [r] currency
|
42
|
+
# Currency used in the document, if different from the parent's currency.
|
43
|
+
# @return [GOBL::Currency::Code]
|
44
|
+
property :currency, GOBL::Currency::Code
|
45
|
+
|
46
|
+
# @!attribute [r] lines
|
47
|
+
# Line index numbers inside the document, if relevant.
|
48
|
+
# @return [Array<Integer>]
|
49
|
+
property :lines, [Integer]
|
50
|
+
|
51
|
+
# @!attribute [r] identities
|
52
|
+
# List of additional codes, IDs, or SKUs which can be used to identify the document or its contents, agreed upon by the supplier and customer.
|
53
|
+
# @return [Array<GOBL::Org::Identity>]
|
54
|
+
property :identities, [GOBL::Org::Identity]
|
55
|
+
|
56
|
+
# @!attribute [r] period
|
57
|
+
# Tax period in which the referred document had an effect required by some tax regimes and formats.
|
58
|
+
# @return [GOBL::Cal::Period]
|
59
|
+
property :period, GOBL::Cal::Period
|
60
|
+
|
61
|
+
# @!attribute [r] reason
|
62
|
+
# Human readable description on why this reference is here or needs to be used.
|
63
|
+
# @return [String]
|
64
|
+
property :reason, String
|
65
|
+
|
66
|
+
# @!attribute [r] description
|
67
|
+
# Additional details about the document.
|
68
|
+
# @return [String]
|
69
|
+
property :description, String
|
70
|
+
|
71
|
+
# @!attribute [r] stamps
|
72
|
+
# Seals of approval from other organizations that may need to be listed.
|
73
|
+
# @return [Array<GOBL::Head::Stamp>]
|
74
|
+
property :stamps, [GOBL::Head::Stamp]
|
75
|
+
|
76
|
+
# @!attribute [r] url
|
77
|
+
# Link to the source document.
|
78
|
+
# @return [String]
|
79
|
+
property :url, String
|
80
|
+
|
81
|
+
# @!attribute [r] tax
|
82
|
+
# Tax total breakdown from the original document in the provided currency. Should only be included if required by a specific tax regime or addon.
|
83
|
+
# @return [GOBL::Tax::Total]
|
84
|
+
property :tax, GOBL::Tax::Total
|
85
|
+
|
86
|
+
# @!attribute [r] payable
|
87
|
+
# Payable is the total amount that is payable in the referenced document. Only needed for specific tax regimes or addons. This may also be used in some scenarios to determine the proportion of the referenced document that has been paid, and calculate the remaining amount due and taxes.
|
88
|
+
# @return [GOBL::Num::Amount]
|
89
|
+
property :payable, GOBL::Num::Amount
|
90
|
+
|
91
|
+
# @!attribute [r] ext
|
92
|
+
# Extensions for additional codes that may be required.
|
93
|
+
# @return [GOBL::Tax::Extensions]
|
94
|
+
property :ext, GOBL::Tax::Extensions
|
95
|
+
|
96
|
+
# @!attribute [r] meta
|
97
|
+
# Meta contains additional information about the document.
|
98
|
+
# @return [GOBL::CBC::Meta]
|
99
|
+
property :meta, GOBL::CBC::Meta
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -22,8 +22,13 @@ module GOBL
|
|
22
22
|
# @return [String]
|
23
23
|
property :label, String
|
24
24
|
|
25
|
+
# @!attribute [r] country
|
26
|
+
# Country from which the identity was issued.
|
27
|
+
# @return [GOBL::L10n::ISOCountryCode]
|
28
|
+
property :country, GOBL::L10n::ISOCountryCode
|
29
|
+
|
25
30
|
# @!attribute [r] key
|
26
|
-
# Uniquely classify this identity using a key instead of a
|
31
|
+
# Uniquely classify this identity using a key instead of a type.
|
27
32
|
# @return [GOBL::CBC::Key]
|
28
33
|
property :key, GOBL::CBC::Key
|
29
34
|
|
@@ -42,6 +47,11 @@ module GOBL
|
|
42
47
|
# Description adds details about what the code could mean or imply
|
43
48
|
# @return [String]
|
44
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
|
45
55
|
end
|
46
56
|
end
|
47
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
|
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]
|
27
|
-
#
|
28
|
-
# @return [GOBL::CBC::
|
29
|
-
property :
|
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]
|
32
|
-
#
|
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 :
|
43
|
+
property :url, String
|
35
44
|
|
36
|
-
# @!attribute [r]
|
37
|
-
#
|
45
|
+
# @!attribute [r] email
|
46
|
+
# Email address for the inbox. Mutually exclusive with Code and URL.
|
38
47
|
# @return [String]
|
39
|
-
property :
|
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 [
|
23
|
-
property :ref,
|
22
|
+
# @return [GOBL::CBC::Code]
|
23
|
+
property :ref, GOBL::CBC::Code
|
24
24
|
|
25
25
|
# @!attribute [r] key
|
26
26
|
# Special key used to classify the item sometimes required by some regimes.
|
@@ -52,7 +52,6 @@ module GOBL
|
|
52
52
|
# Base price of a single unit to be sold.
|
53
53
|
# @return [GOBL::Num::Amount]
|
54
54
|
property :price, GOBL::Num::Amount
|
55
|
-
validates_presence_of :price
|
56
55
|
|
57
56
|
# @!attribute [r] alt_prices
|
58
57
|
# AltPrices defines a list of prices with their currencies that may be used as an alternative to the item's base price.
|
@@ -66,8 +65,8 @@ module GOBL
|
|
66
65
|
|
67
66
|
# @!attribute [r] origin
|
68
67
|
# Country code of where this item was from originally.
|
69
|
-
# @return [GOBL::L10n::
|
70
|
-
property :origin, GOBL::L10n::
|
68
|
+
# @return [GOBL::L10n::ISOCountryCode]
|
69
|
+
property :origin, GOBL::L10n::ISOCountryCode
|
71
70
|
|
72
71
|
# @!attribute [r] ext
|
73
72
|
# Extension code map for any additional regime specific codes that may be required.
|
@@ -31,7 +31,6 @@ module GOBL
|
|
31
31
|
# Person's given or first name
|
32
32
|
# @return [String]
|
33
33
|
property :given, String
|
34
|
-
validates_presence_of :given
|
35
34
|
|
36
35
|
# @!attribute [r] middle
|
37
36
|
# Middle names or initials
|
@@ -42,7 +41,6 @@ module GOBL
|
|
42
41
|
# Second or Family name.
|
43
42
|
# @return [String]
|
44
43
|
property :surname, String
|
45
|
-
validates_presence_of :surname
|
46
44
|
|
47
45
|
# @!attribute [r] surname2
|
48
46
|
# Additional second of family name.
|
@@ -6,11 +6,16 @@
|
|
6
6
|
##
|
7
7
|
|
8
8
|
module GOBL
|
9
|
-
module
|
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/
|
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 [
|
53
|
-
property :code,
|
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,27 +12,30 @@ 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]
|
18
22
|
property :uuid, String
|
19
23
|
|
24
|
+
# @!attribute [r] label
|
25
|
+
# Label can be used to provide a custom label for the party in a given context in a single language, for example "Supplier", "Host", or similar.
|
26
|
+
# @return [String]
|
27
|
+
property :label, String
|
28
|
+
|
20
29
|
# @!attribute [r] name
|
21
30
|
# Legal name or representation of the organization.
|
22
31
|
# @return [String]
|
23
32
|
property :name, String
|
24
|
-
validates_presence_of :name
|
25
33
|
|
26
34
|
# @!attribute [r] alias
|
27
35
|
# Alternate short name.
|
28
36
|
# @return [String]
|
29
37
|
property :alias, String
|
30
38
|
|
31
|
-
# @!attribute [r] label
|
32
|
-
# Label can be used to provide a custom label for the party in a given context in a single language, for example "Supplier", "Host", or similar.
|
33
|
-
# @return [String]
|
34
|
-
property :label, String
|
35
|
-
|
36
39
|
# @!attribute [r] tax_id
|
37
40
|
# The entity's legal ID code used for tax purposes. They may have other numbers, but we're only interested in those valid for tax purposes.
|
38
41
|
# @return [GOBL::Tax::Identity]
|
@@ -17,6 +17,11 @@ module GOBL
|
|
17
17
|
# @return [String]
|
18
18
|
property :uuid, String
|
19
19
|
|
20
|
+
# @!attribute [r] label
|
21
|
+
# Label can be used to identify the person in a given context in a single language, for example "Attn", "Contact", "Responsible", etc.
|
22
|
+
# @return [String]
|
23
|
+
property :label, String
|
24
|
+
|
20
25
|
# @!attribute [r] name
|
21
26
|
# Complete details on the name of the person
|
22
27
|
# @return [GOBL::Org::Name]
|
@@ -23,7 +23,7 @@ module GOBL
|
|
23
23
|
property :label, String
|
24
24
|
|
25
25
|
# @!attribute [r] num
|
26
|
-
#
|
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
|
10
|
+
# Unit defines how the quantity of the product should be interpreted either using a GOBL lower-case key (e.g. 'kg'), or UN/ECE code upper-case code (e.g. 'KGM').
|
11
11
|
class Unit < String
|
12
12
|
# The Schema ID of the GOBL Unit structure
|
13
13
|
SCHEMA_ID = 'https://gobl.org/draft-0/org/unit'
|
@@ -53,6 +53,7 @@ module GOBL
|
|
53
53
|
'kit' => 'A unit of count defining the number of kits (kit: tub, barrel or pail).',
|
54
54
|
'basebox' => 'A unit of area of 112 sheets of tin mil products (tin plate, tin free steel or black plate) 14 by 20 inches, or 31,360 square inches.',
|
55
55
|
'pk' => 'A unit of count defining the number of items per bulk pack.',
|
56
|
+
'one' => 'A single generic unit of a service or product.',
|
56
57
|
'bag' => 'Bags',
|
57
58
|
'box' => 'Boxes',
|
58
59
|
'bin' => 'Bins',
|
@@ -27,11 +27,13 @@ module GOBL
|
|
27
27
|
'any' => 'Any method available, no preference.',
|
28
28
|
'card' => 'Payment card.',
|
29
29
|
'credit-transfer' => 'Sender initiated bank or wire transfer.',
|
30
|
+
'credit-transfer+sepa' => 'Sender initiated bank or wire transfer via SEPA.',
|
30
31
|
'debit-transfer' => 'Receiver initiated bank or wire transfer.',
|
31
32
|
'cash' => 'Cash in hand.',
|
32
33
|
'cheque' => 'Cheque from bank.',
|
33
34
|
'bank-draft' => 'Bankers Draft or Bank Cheque.',
|
34
35
|
'direct-debit' => 'Direct debit from the customers bank account.',
|
36
|
+
'direct-debit+sepa' => 'Direct debit from the customers bank account via SEPA.',
|
35
37
|
'online' => 'Online or web payment.',
|
36
38
|
'promissory-note' => 'Promissory note contract.',
|
37
39
|
'netting' => 'Intercompany clearing or clearing between partners.',
|
@@ -60,7 +62,7 @@ module GOBL
|
|
60
62
|
validates_presence_of :description
|
61
63
|
|
62
64
|
# @!attribute [r] percent
|
63
|
-
#
|
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
|
|
@@ -85,6 +87,11 @@ module GOBL
|
|
85
87
|
# @return [CreditTransfer]
|
86
88
|
property :credit_transfer, CreditTransfer
|
87
89
|
|
90
|
+
# @!attribute [r] ext
|
91
|
+
# Tax extensions required by tax regimes or addons.
|
92
|
+
# @return [GOBL::Tax::Extensions]
|
93
|
+
property :ext, GOBL::Tax::Extensions
|
94
|
+
|
88
95
|
# @!attribute [r] meta
|
89
96
|
# Additional details useful for the parties involved.
|
90
97
|
# @return [GOBL::CBC::Meta]
|
@@ -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
|
44
|
-
# @return [
|
45
|
-
property :ref,
|
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.
|
@@ -69,6 +71,11 @@ module GOBL
|
|
69
71
|
# @return [String]
|
70
72
|
property :notes, String
|
71
73
|
|
74
|
+
# @!attribute [r] ext
|
75
|
+
# Extension key-pairs values defined by a tax regime.
|
76
|
+
# @return [GOBL::Tax::Extensions]
|
77
|
+
property :ext, GOBL::Tax::Extensions
|
78
|
+
|
72
79
|
# @!attribute [r] meta
|
73
80
|
# Non-structured additional data that may be useful.
|
74
81
|
# @return [GOBL::CBC::Meta]
|
@@ -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]
|
@@ -0,0 +1,76 @@
|
|
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
|
+
# AddonDef is an interface that defines the methods that a tax add-on must implement.
|
11
|
+
class AddonDef < GOBL::Object
|
12
|
+
# The Schema ID of the GOBL AddonDef structure
|
13
|
+
SCHEMA_ID = 'https://gobl.org/draft-0/tax/addon-def'
|
14
|
+
|
15
|
+
# @!attribute [r] key
|
16
|
+
# Key that defines how to uniquely idenitfy the add-on.
|
17
|
+
# @return [GOBL::CBC::Key]
|
18
|
+
property :key, GOBL::CBC::Key
|
19
|
+
validates_presence_of :key
|
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
|
+
|
26
|
+
# @!attribute [r] name
|
27
|
+
# Name of the add-on
|
28
|
+
# @return [GOBL::I18n::String]
|
29
|
+
property :name, GOBL::I18n::String
|
30
|
+
validates_presence_of :name
|
31
|
+
|
32
|
+
# @!attribute [r] description
|
33
|
+
# Description of the add-on
|
34
|
+
# @return [GOBL::I18n::String]
|
35
|
+
property :description, GOBL::I18n::String
|
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
|
+
|
42
|
+
# @!attribute [r] extensions
|
43
|
+
# Extensions defines the list of extensions that are associated with an add-on.
|
44
|
+
# @return [Array<GOBL::CBC::Definition>]
|
45
|
+
property :extensions, [GOBL::CBC::Definition]
|
46
|
+
validates_presence_of :extensions
|
47
|
+
|
48
|
+
# @!attribute [r] tags
|
49
|
+
# Tags is slice of tag sets that define what can be assigned to each document schema.
|
50
|
+
# @return [Array<TagSet>]
|
51
|
+
property :tags, [TagSet]
|
52
|
+
|
53
|
+
# @!attribute [r] scenarios
|
54
|
+
# Scenarios are applied to documents after normalization and before validation to ensure that form specific extensions have been added to the document.
|
55
|
+
# @return [Array<ScenarioSet>]
|
56
|
+
property :scenarios, [ScenarioSet]
|
57
|
+
validates_presence_of :scenarios
|
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
|
+
|
64
|
+
# @!attribute [r] inboxes
|
65
|
+
# Inboxes is a list of keys that are used to identify where copies of documents can be sent.
|
66
|
+
# @return [Array<GOBL::CBC::Definition>]
|
67
|
+
property :inboxes, [GOBL::CBC::Definition]
|
68
|
+
|
69
|
+
# @!attribute [r] corrections
|
70
|
+
# Corrections is used to provide a map of correction definitions that are supported by the add-on.
|
71
|
+
# @return [CorrectionSet]
|
72
|
+
property :corrections, CorrectionSet
|
73
|
+
validates_presence_of :corrections
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|