e-invoice-api 0.6.0 → 0.8.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/CHANGELOG.md +16 -0
- data/README.md +5 -5
- data/lib/e_invoice_api/client.rb +4 -0
- data/lib/e_invoice_api/internal/type/base_model.rb +5 -5
- data/lib/e_invoice_api/models/allowance.rb +96 -0
- data/lib/e_invoice_api/models/charge.rb +96 -0
- data/lib/e_invoice_api/models/document_create.rb +666 -19
- data/lib/e_invoice_api/models/document_create_from_pdf_params.rb +32 -0
- data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +584 -0
- data/lib/e_invoice_api/models/document_response.rb +265 -23
- data/lib/e_invoice_api/models/document_validate_params.rb +14 -0
- data/lib/e_invoice_api/models/documents/ubl_create_from_ubl_params.rb +22 -0
- data/lib/e_invoice_api/models/me_retrieve_params.rb +14 -0
- data/lib/e_invoice_api/models/me_retrieve_response.rb +149 -0
- data/lib/e_invoice_api/models.rb +10 -0
- data/lib/e_invoice_api/resources/documents/ubl.rb +22 -0
- data/lib/e_invoice_api/resources/documents.rb +64 -8
- data/lib/e_invoice_api/resources/me.rb +32 -0
- data/lib/e_invoice_api/resources/validate.rb +12 -8
- data/lib/e_invoice_api/version.rb +1 -1
- data/lib/e_invoice_api.rb +9 -0
- data/rbi/e_invoice_api/client.rbi +3 -0
- data/rbi/e_invoice_api/models/allowance.rbi +124 -0
- data/rbi/e_invoice_api/models/charge.rbi +122 -0
- data/rbi/e_invoice_api/models/document_create.rbi +1180 -3
- data/rbi/e_invoice_api/models/document_create_from_pdf_params.rbi +56 -0
- data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +1014 -0
- data/rbi/e_invoice_api/models/document_response.rbi +456 -43
- data/rbi/e_invoice_api/models/document_validate_params.rbi +30 -0
- data/rbi/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbi +43 -0
- data/rbi/e_invoice_api/models/me_retrieve_params.rbi +27 -0
- data/rbi/e_invoice_api/models/me_retrieve_response.rbi +195 -0
- data/rbi/e_invoice_api/models.rbi +10 -0
- data/rbi/e_invoice_api/resources/documents/ubl.rbi +10 -0
- data/rbi/e_invoice_api/resources/documents.rbi +54 -1
- data/rbi/e_invoice_api/resources/me.rbi +21 -0
- data/rbi/e_invoice_api/resources/validate.rbi +20 -1
- data/sig/e_invoice_api/client.rbs +2 -0
- data/sig/e_invoice_api/models/allowance.rbs +69 -0
- data/sig/e_invoice_api/models/charge.rbs +69 -0
- data/sig/e_invoice_api/models/document_create.rbs +388 -4
- data/sig/e_invoice_api/models/document_create_from_pdf_params.rbs +36 -0
- data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +512 -0
- data/sig/e_invoice_api/models/document_response.rbs +168 -32
- data/sig/e_invoice_api/models/document_validate_params.rbs +15 -0
- data/sig/e_invoice_api/models/documents/ubl_create_from_ubl_params.rbs +26 -0
- data/sig/e_invoice_api/models/me_retrieve_params.rbs +15 -0
- data/sig/e_invoice_api/models/me_retrieve_response.rbs +107 -0
- data/sig/e_invoice_api/models.rbs +10 -0
- data/sig/e_invoice_api/resources/documents/ubl.rbs +5 -0
- data/sig/e_invoice_api/resources/documents.rbs +15 -1
- data/sig/e_invoice_api/resources/me.rbs +11 -0
- data/sig/e_invoice_api/resources/validate.rbs +3 -1
- metadata +28 -1
data/lib/e_invoice_api/models.rb
CHANGED
|
@@ -39,14 +39,20 @@ module EInvoiceAPI
|
|
|
39
39
|
mod.define_sorbet_constant!(const) { T.type_alias { mod.to_sorbet_type } }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
+
Allowance = EInvoiceAPI::Models::Allowance
|
|
43
|
+
|
|
42
44
|
Certificate = EInvoiceAPI::Models::Certificate
|
|
43
45
|
|
|
46
|
+
Charge = EInvoiceAPI::Models::Charge
|
|
47
|
+
|
|
44
48
|
CurrencyCode = EInvoiceAPI::Models::CurrencyCode
|
|
45
49
|
|
|
46
50
|
DocumentAttachmentCreate = EInvoiceAPI::Models::DocumentAttachmentCreate
|
|
47
51
|
|
|
48
52
|
DocumentCreate = EInvoiceAPI::Models::DocumentCreate
|
|
49
53
|
|
|
54
|
+
DocumentCreateFromPdfParams = EInvoiceAPI::Models::DocumentCreateFromPdfParams
|
|
55
|
+
|
|
50
56
|
DocumentCreateParams = EInvoiceAPI::Models::DocumentCreateParams
|
|
51
57
|
|
|
52
58
|
DocumentDeleteParams = EInvoiceAPI::Models::DocumentDeleteParams
|
|
@@ -65,6 +71,8 @@ module EInvoiceAPI
|
|
|
65
71
|
|
|
66
72
|
DocumentType = EInvoiceAPI::Models::DocumentType
|
|
67
73
|
|
|
74
|
+
DocumentValidateParams = EInvoiceAPI::Models::DocumentValidateParams
|
|
75
|
+
|
|
68
76
|
InboxListCreditNotesParams = EInvoiceAPI::Models::InboxListCreditNotesParams
|
|
69
77
|
|
|
70
78
|
InboxListInvoicesParams = EInvoiceAPI::Models::InboxListInvoicesParams
|
|
@@ -75,6 +83,8 @@ module EInvoiceAPI
|
|
|
75
83
|
|
|
76
84
|
LookupRetrieveParticipantsParams = EInvoiceAPI::Models::LookupRetrieveParticipantsParams
|
|
77
85
|
|
|
86
|
+
MeRetrieveParams = EInvoiceAPI::Models::MeRetrieveParams
|
|
87
|
+
|
|
78
88
|
OutboxListDraftDocumentsParams = EInvoiceAPI::Models::OutboxListDraftDocumentsParams
|
|
79
89
|
|
|
80
90
|
OutboxListReceivedDocumentsParams = EInvoiceAPI::Models::OutboxListReceivedDocumentsParams
|
|
@@ -4,6 +4,28 @@ module EInvoiceAPI
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Documents
|
|
6
6
|
class Ubl
|
|
7
|
+
# Create a new invoice or credit note from a UBL file
|
|
8
|
+
#
|
|
9
|
+
# @overload create_from_ubl(file:, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart]
|
|
12
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
13
|
+
#
|
|
14
|
+
# @return [EInvoiceAPI::Models::DocumentResponse]
|
|
15
|
+
#
|
|
16
|
+
# @see EInvoiceAPI::Models::Documents::UblCreateFromUblParams
|
|
17
|
+
def create_from_ubl(params)
|
|
18
|
+
parsed, options = EInvoiceAPI::Documents::UblCreateFromUblParams.dump_request(params)
|
|
19
|
+
@client.request(
|
|
20
|
+
method: :post,
|
|
21
|
+
path: "api/documents/ubl",
|
|
22
|
+
headers: {"content-type" => "multipart/form-data"},
|
|
23
|
+
body: parsed,
|
|
24
|
+
model: EInvoiceAPI::DocumentResponse,
|
|
25
|
+
options: options
|
|
26
|
+
)
|
|
27
|
+
end
|
|
28
|
+
|
|
7
29
|
# Get the UBL for an invoice or credit note
|
|
8
30
|
#
|
|
9
31
|
# @overload get(document_id, request_options: {})
|
|
@@ -14,9 +14,11 @@ module EInvoiceAPI
|
|
|
14
14
|
#
|
|
15
15
|
# Create a new invoice or credit note
|
|
16
16
|
#
|
|
17
|
-
# @overload create(amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
|
|
17
|
+
# @overload create(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
|
|
18
18
|
#
|
|
19
|
-
# @param
|
|
19
|
+
# @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
|
|
20
|
+
#
|
|
21
|
+
# @param amount_due [Float, String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
|
|
20
22
|
#
|
|
21
23
|
# @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
|
|
22
24
|
#
|
|
@@ -24,6 +26,8 @@ module EInvoiceAPI
|
|
|
24
26
|
#
|
|
25
27
|
# @param billing_address_recipient [String, nil]
|
|
26
28
|
#
|
|
29
|
+
# @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
|
|
30
|
+
#
|
|
27
31
|
# @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
|
|
28
32
|
#
|
|
29
33
|
# @param customer_address [String, nil]
|
|
@@ -48,9 +52,9 @@ module EInvoiceAPI
|
|
|
48
52
|
#
|
|
49
53
|
# @param invoice_id [String, nil]
|
|
50
54
|
#
|
|
51
|
-
# @param invoice_total [Float, String, nil]
|
|
55
|
+
# @param invoice_total [Float, String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
|
|
52
56
|
#
|
|
53
|
-
# @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item
|
|
57
|
+
# @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
|
|
54
58
|
#
|
|
55
59
|
# @param note [String, nil]
|
|
56
60
|
#
|
|
@@ -58,7 +62,7 @@ module EInvoiceAPI
|
|
|
58
62
|
#
|
|
59
63
|
# @param payment_term [String, nil]
|
|
60
64
|
#
|
|
61
|
-
# @param previous_unpaid_balance [Float, String, nil]
|
|
65
|
+
# @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
|
|
62
66
|
#
|
|
63
67
|
# @param purchase_order [String, nil]
|
|
64
68
|
#
|
|
@@ -80,15 +84,15 @@ module EInvoiceAPI
|
|
|
80
84
|
#
|
|
81
85
|
# @param state [Symbol, EInvoiceAPI::Models::DocumentState]
|
|
82
86
|
#
|
|
83
|
-
# @param subtotal [Float, String, nil]
|
|
87
|
+
# @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
|
|
84
88
|
#
|
|
85
89
|
# @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice
|
|
86
90
|
#
|
|
87
91
|
# @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
|
|
88
92
|
#
|
|
89
|
-
# @param total_discount [Float, String, nil]
|
|
93
|
+
# @param total_discount [Float, String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
|
|
90
94
|
#
|
|
91
|
-
# @param total_tax [Float, String, nil]
|
|
95
|
+
# @param total_tax [Float, String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
|
|
92
96
|
#
|
|
93
97
|
# @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
|
|
94
98
|
#
|
|
@@ -158,6 +162,39 @@ module EInvoiceAPI
|
|
|
158
162
|
)
|
|
159
163
|
end
|
|
160
164
|
|
|
165
|
+
# Create a new invoice or credit note from a PDF file. If the 'ubl_document' field
|
|
166
|
+
# is set in the response, it indicates that sufficient details were extracted from
|
|
167
|
+
# the PDF to automatically generate a valid UBL document ready for sending. If
|
|
168
|
+
# 'ubl_document' is not set, human intervention may be required to ensure
|
|
169
|
+
# compliance.
|
|
170
|
+
#
|
|
171
|
+
# @overload create_from_pdf(file:, customer_tax_id: nil, vendor_tax_id: nil, request_options: {})
|
|
172
|
+
#
|
|
173
|
+
# @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart] Body param:
|
|
174
|
+
#
|
|
175
|
+
# @param customer_tax_id [String, nil] Query param:
|
|
176
|
+
#
|
|
177
|
+
# @param vendor_tax_id [String, nil] Query param:
|
|
178
|
+
#
|
|
179
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
180
|
+
#
|
|
181
|
+
# @return [EInvoiceAPI::Models::DocumentCreateFromPdfResponse]
|
|
182
|
+
#
|
|
183
|
+
# @see EInvoiceAPI::Models::DocumentCreateFromPdfParams
|
|
184
|
+
def create_from_pdf(params)
|
|
185
|
+
parsed, options = EInvoiceAPI::DocumentCreateFromPdfParams.dump_request(params)
|
|
186
|
+
query_params = [:customer_tax_id, :vendor_tax_id]
|
|
187
|
+
@client.request(
|
|
188
|
+
method: :post,
|
|
189
|
+
path: "api/documents/pdf",
|
|
190
|
+
query: parsed.slice(*query_params),
|
|
191
|
+
headers: {"content-type" => "multipart/form-data"},
|
|
192
|
+
body: parsed.except(*query_params),
|
|
193
|
+
model: EInvoiceAPI::Models::DocumentCreateFromPdfResponse,
|
|
194
|
+
options: options
|
|
195
|
+
)
|
|
196
|
+
end
|
|
197
|
+
|
|
161
198
|
# Send an invoice or credit note via Peppol
|
|
162
199
|
#
|
|
163
200
|
# @overload send_(document_id, email: nil, receiver_peppol_id: nil, receiver_peppol_scheme: nil, sender_peppol_id: nil, sender_peppol_scheme: nil, request_options: {})
|
|
@@ -184,6 +221,25 @@ module EInvoiceAPI
|
|
|
184
221
|
)
|
|
185
222
|
end
|
|
186
223
|
|
|
224
|
+
# Validate a UBL document according to Peppol BIS Billing 3.0
|
|
225
|
+
#
|
|
226
|
+
# @overload validate(document_id, request_options: {})
|
|
227
|
+
#
|
|
228
|
+
# @param document_id [String]
|
|
229
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
230
|
+
#
|
|
231
|
+
# @return [EInvoiceAPI::Models::UblDocumentValidation]
|
|
232
|
+
#
|
|
233
|
+
# @see EInvoiceAPI::Models::DocumentValidateParams
|
|
234
|
+
def validate(document_id, params = {})
|
|
235
|
+
@client.request(
|
|
236
|
+
method: :post,
|
|
237
|
+
path: ["api/documents/%1$s/validate", document_id],
|
|
238
|
+
model: EInvoiceAPI::UblDocumentValidation,
|
|
239
|
+
options: params[:request_options]
|
|
240
|
+
)
|
|
241
|
+
end
|
|
242
|
+
|
|
187
243
|
# @api private
|
|
188
244
|
#
|
|
189
245
|
# @param client [EInvoiceAPI::Client]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Me
|
|
6
|
+
# Retrieve information about your account.
|
|
7
|
+
#
|
|
8
|
+
# @overload retrieve(request_options: {})
|
|
9
|
+
#
|
|
10
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
11
|
+
#
|
|
12
|
+
# @return [EInvoiceAPI::Models::MeRetrieveResponse]
|
|
13
|
+
#
|
|
14
|
+
# @see EInvoiceAPI::Models::MeRetrieveParams
|
|
15
|
+
def retrieve(params = {})
|
|
16
|
+
@client.request(
|
|
17
|
+
method: :get,
|
|
18
|
+
path: "api/me/",
|
|
19
|
+
model: EInvoiceAPI::Models::MeRetrieveResponse,
|
|
20
|
+
options: params[:request_options]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @api private
|
|
25
|
+
#
|
|
26
|
+
# @param client [EInvoiceAPI::Client]
|
|
27
|
+
def initialize(client:)
|
|
28
|
+
@client = client
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -8,9 +8,11 @@ module EInvoiceAPI
|
|
|
8
8
|
#
|
|
9
9
|
# Validate if the JSON document can be converted to a valid UBL document
|
|
10
10
|
#
|
|
11
|
-
# @overload validate_json(amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
|
|
11
|
+
# @overload validate_json(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
|
|
12
12
|
#
|
|
13
|
-
# @param
|
|
13
|
+
# @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
|
|
14
|
+
#
|
|
15
|
+
# @param amount_due [Float, String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
|
|
14
16
|
#
|
|
15
17
|
# @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
|
|
16
18
|
#
|
|
@@ -18,6 +20,8 @@ module EInvoiceAPI
|
|
|
18
20
|
#
|
|
19
21
|
# @param billing_address_recipient [String, nil]
|
|
20
22
|
#
|
|
23
|
+
# @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
|
|
24
|
+
#
|
|
21
25
|
# @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
|
|
22
26
|
#
|
|
23
27
|
# @param customer_address [String, nil]
|
|
@@ -42,9 +46,9 @@ module EInvoiceAPI
|
|
|
42
46
|
#
|
|
43
47
|
# @param invoice_id [String, nil]
|
|
44
48
|
#
|
|
45
|
-
# @param invoice_total [Float, String, nil]
|
|
49
|
+
# @param invoice_total [Float, String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
|
|
46
50
|
#
|
|
47
|
-
# @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item
|
|
51
|
+
# @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
|
|
48
52
|
#
|
|
49
53
|
# @param note [String, nil]
|
|
50
54
|
#
|
|
@@ -52,7 +56,7 @@ module EInvoiceAPI
|
|
|
52
56
|
#
|
|
53
57
|
# @param payment_term [String, nil]
|
|
54
58
|
#
|
|
55
|
-
# @param previous_unpaid_balance [Float, String, nil]
|
|
59
|
+
# @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
|
|
56
60
|
#
|
|
57
61
|
# @param purchase_order [String, nil]
|
|
58
62
|
#
|
|
@@ -74,15 +78,15 @@ module EInvoiceAPI
|
|
|
74
78
|
#
|
|
75
79
|
# @param state [Symbol, EInvoiceAPI::Models::DocumentState]
|
|
76
80
|
#
|
|
77
|
-
# @param subtotal [Float, String, nil]
|
|
81
|
+
# @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
|
|
78
82
|
#
|
|
79
83
|
# @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice
|
|
80
84
|
#
|
|
81
85
|
# @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
|
|
82
86
|
#
|
|
83
|
-
# @param total_discount [Float, String, nil]
|
|
87
|
+
# @param total_discount [Float, String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
|
|
84
88
|
#
|
|
85
|
-
# @param total_tax [Float, String, nil]
|
|
89
|
+
# @param total_tax [Float, String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
|
|
86
90
|
#
|
|
87
91
|
# @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
|
|
88
92
|
#
|
data/lib/e_invoice_api.rb
CHANGED
|
@@ -52,9 +52,13 @@ require_relative "e_invoice_api/internal/transport/pooled_net_requester"
|
|
|
52
52
|
require_relative "e_invoice_api/client"
|
|
53
53
|
require_relative "e_invoice_api/internal/documents_number_page"
|
|
54
54
|
require_relative "e_invoice_api/models/document_create"
|
|
55
|
+
require_relative "e_invoice_api/models/allowance"
|
|
55
56
|
require_relative "e_invoice_api/models/certificate"
|
|
57
|
+
require_relative "e_invoice_api/models/charge"
|
|
56
58
|
require_relative "e_invoice_api/models/currency_code"
|
|
57
59
|
require_relative "e_invoice_api/models/document_attachment_create"
|
|
60
|
+
require_relative "e_invoice_api/models/document_create_from_pdf_params"
|
|
61
|
+
require_relative "e_invoice_api/models/document_create_from_pdf_response"
|
|
58
62
|
require_relative "e_invoice_api/models/document_create_params"
|
|
59
63
|
require_relative "e_invoice_api/models/document_delete_params"
|
|
60
64
|
require_relative "e_invoice_api/models/document_delete_response"
|
|
@@ -68,11 +72,13 @@ require_relative "e_invoice_api/models/documents/attachment_list_params"
|
|
|
68
72
|
require_relative "e_invoice_api/models/documents/attachment_list_response"
|
|
69
73
|
require_relative "e_invoice_api/models/documents/attachment_retrieve_params"
|
|
70
74
|
require_relative "e_invoice_api/models/documents/document_attachment"
|
|
75
|
+
require_relative "e_invoice_api/models/documents/ubl_create_from_ubl_params"
|
|
71
76
|
require_relative "e_invoice_api/models/documents/ubl_get_params"
|
|
72
77
|
require_relative "e_invoice_api/models/documents/ubl_get_response"
|
|
73
78
|
require_relative "e_invoice_api/models/document_send_params"
|
|
74
79
|
require_relative "e_invoice_api/models/document_state"
|
|
75
80
|
require_relative "e_invoice_api/models/document_type"
|
|
81
|
+
require_relative "e_invoice_api/models/document_validate_params"
|
|
76
82
|
require_relative "e_invoice_api/models/inbox_list_credit_notes_params"
|
|
77
83
|
require_relative "e_invoice_api/models/inbox_list_invoices_params"
|
|
78
84
|
require_relative "e_invoice_api/models/inbox_list_params"
|
|
@@ -80,6 +86,8 @@ require_relative "e_invoice_api/models/lookup_retrieve_params"
|
|
|
80
86
|
require_relative "e_invoice_api/models/lookup_retrieve_participants_params"
|
|
81
87
|
require_relative "e_invoice_api/models/lookup_retrieve_participants_response"
|
|
82
88
|
require_relative "e_invoice_api/models/lookup_retrieve_response"
|
|
89
|
+
require_relative "e_invoice_api/models/me_retrieve_params"
|
|
90
|
+
require_relative "e_invoice_api/models/me_retrieve_response"
|
|
83
91
|
require_relative "e_invoice_api/models/outbox_list_draft_documents_params"
|
|
84
92
|
require_relative "e_invoice_api/models/outbox_list_received_documents_params"
|
|
85
93
|
require_relative "e_invoice_api/models/paginated_document_response"
|
|
@@ -104,6 +112,7 @@ require_relative "e_invoice_api/resources/documents/attachments"
|
|
|
104
112
|
require_relative "e_invoice_api/resources/documents/ubl"
|
|
105
113
|
require_relative "e_invoice_api/resources/inbox"
|
|
106
114
|
require_relative "e_invoice_api/resources/lookup"
|
|
115
|
+
require_relative "e_invoice_api/resources/me"
|
|
107
116
|
require_relative "e_invoice_api/resources/outbox"
|
|
108
117
|
require_relative "e_invoice_api/resources/validate"
|
|
109
118
|
require_relative "e_invoice_api/resources/webhooks"
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class Allowance < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(EInvoiceAPI::Allowance, EInvoiceAPI::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The allowance amount, without VAT. Must be rounded to maximum 2 decimals
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :amount
|
|
14
|
+
|
|
15
|
+
# The base amount that may be used, in conjunction with the allowance percentage,
|
|
16
|
+
# to calculate the allowance amount. Must be rounded to maximum 2 decimals
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_accessor :base_amount
|
|
19
|
+
|
|
20
|
+
# The percentage that may be used, in conjunction with the allowance base amount,
|
|
21
|
+
# to calculate the allowance amount. To state 20%, use value 20
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :multiplier_factor
|
|
24
|
+
|
|
25
|
+
# The reason for the allowance
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_accessor :reason
|
|
28
|
+
|
|
29
|
+
# The code for the allowance reason
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :reason_code
|
|
32
|
+
|
|
33
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
34
|
+
#
|
|
35
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
36
|
+
sig { returns(T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)) }
|
|
37
|
+
attr_accessor :tax_code
|
|
38
|
+
|
|
39
|
+
# The VAT rate, represented as percentage that applies to the allowance
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_accessor :tax_rate
|
|
42
|
+
|
|
43
|
+
# An allowance is a discount for example for early payment, volume discount, etc.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
amount: T.nilable(String),
|
|
47
|
+
base_amount: T.nilable(String),
|
|
48
|
+
multiplier_factor: T.nilable(String),
|
|
49
|
+
reason: T.nilable(String),
|
|
50
|
+
reason_code: T.nilable(String),
|
|
51
|
+
tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::OrSymbol),
|
|
52
|
+
tax_rate: T.nilable(String)
|
|
53
|
+
).returns(T.attached_class)
|
|
54
|
+
end
|
|
55
|
+
def self.new(
|
|
56
|
+
# The allowance amount, without VAT. Must be rounded to maximum 2 decimals
|
|
57
|
+
amount: nil,
|
|
58
|
+
# The base amount that may be used, in conjunction with the allowance percentage,
|
|
59
|
+
# to calculate the allowance amount. Must be rounded to maximum 2 decimals
|
|
60
|
+
base_amount: nil,
|
|
61
|
+
# The percentage that may be used, in conjunction with the allowance base amount,
|
|
62
|
+
# to calculate the allowance amount. To state 20%, use value 20
|
|
63
|
+
multiplier_factor: nil,
|
|
64
|
+
# The reason for the allowance
|
|
65
|
+
reason: nil,
|
|
66
|
+
# The code for the allowance reason
|
|
67
|
+
reason_code: nil,
|
|
68
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
69
|
+
#
|
|
70
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
71
|
+
tax_code: nil,
|
|
72
|
+
# The VAT rate, represented as percentage that applies to the allowance
|
|
73
|
+
tax_rate: nil
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
amount: T.nilable(String),
|
|
81
|
+
base_amount: T.nilable(String),
|
|
82
|
+
multiplier_factor: T.nilable(String),
|
|
83
|
+
reason: T.nilable(String),
|
|
84
|
+
reason_code: T.nilable(String),
|
|
85
|
+
tax_code: T.nilable(EInvoiceAPI::Allowance::TaxCode::TaggedSymbol),
|
|
86
|
+
tax_rate: T.nilable(String)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
def to_hash
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
94
|
+
#
|
|
95
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
96
|
+
module TaxCode
|
|
97
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
98
|
+
|
|
99
|
+
TaggedSymbol =
|
|
100
|
+
T.type_alias { T.all(Symbol, EInvoiceAPI::Allowance::TaxCode) }
|
|
101
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
102
|
+
|
|
103
|
+
AE = T.let(:AE, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
104
|
+
E = T.let(:E, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
105
|
+
S = T.let(:S, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
106
|
+
Z = T.let(:Z, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
107
|
+
G = T.let(:G, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
108
|
+
O = T.let(:O, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
109
|
+
K = T.let(:K, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
110
|
+
L = T.let(:L, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
111
|
+
M = T.let(:M, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
112
|
+
B = T.let(:B, EInvoiceAPI::Allowance::TaxCode::TaggedSymbol)
|
|
113
|
+
|
|
114
|
+
sig do
|
|
115
|
+
override.returns(
|
|
116
|
+
T::Array[EInvoiceAPI::Allowance::TaxCode::TaggedSymbol]
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
def self.values
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class Charge < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(EInvoiceAPI::Charge, EInvoiceAPI::Internal::AnyHash)
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# The charge amount, without VAT. Must be rounded to maximum 2 decimals
|
|
12
|
+
sig { returns(T.nilable(String)) }
|
|
13
|
+
attr_accessor :amount
|
|
14
|
+
|
|
15
|
+
# The base amount that may be used, in conjunction with the charge percentage, to
|
|
16
|
+
# calculate the charge amount. Must be rounded to maximum 2 decimals
|
|
17
|
+
sig { returns(T.nilable(String)) }
|
|
18
|
+
attr_accessor :base_amount
|
|
19
|
+
|
|
20
|
+
# The percentage that may be used, in conjunction with the charge base amount, to
|
|
21
|
+
# calculate the charge amount. To state 20%, use value 20
|
|
22
|
+
sig { returns(T.nilable(String)) }
|
|
23
|
+
attr_accessor :multiplier_factor
|
|
24
|
+
|
|
25
|
+
# The reason for the charge
|
|
26
|
+
sig { returns(T.nilable(String)) }
|
|
27
|
+
attr_accessor :reason
|
|
28
|
+
|
|
29
|
+
# The code for the charge reason
|
|
30
|
+
sig { returns(T.nilable(String)) }
|
|
31
|
+
attr_accessor :reason_code
|
|
32
|
+
|
|
33
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
34
|
+
#
|
|
35
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
36
|
+
sig { returns(T.nilable(EInvoiceAPI::Charge::TaxCode::TaggedSymbol)) }
|
|
37
|
+
attr_accessor :tax_code
|
|
38
|
+
|
|
39
|
+
# The VAT rate, represented as percentage that applies to the charge
|
|
40
|
+
sig { returns(T.nilable(String)) }
|
|
41
|
+
attr_accessor :tax_rate
|
|
42
|
+
|
|
43
|
+
# A charge is an additional fee for example for late payment, late delivery, etc.
|
|
44
|
+
sig do
|
|
45
|
+
params(
|
|
46
|
+
amount: T.nilable(String),
|
|
47
|
+
base_amount: T.nilable(String),
|
|
48
|
+
multiplier_factor: T.nilable(String),
|
|
49
|
+
reason: T.nilable(String),
|
|
50
|
+
reason_code: T.nilable(String),
|
|
51
|
+
tax_code: T.nilable(EInvoiceAPI::Charge::TaxCode::OrSymbol),
|
|
52
|
+
tax_rate: T.nilable(String)
|
|
53
|
+
).returns(T.attached_class)
|
|
54
|
+
end
|
|
55
|
+
def self.new(
|
|
56
|
+
# The charge amount, without VAT. Must be rounded to maximum 2 decimals
|
|
57
|
+
amount: nil,
|
|
58
|
+
# The base amount that may be used, in conjunction with the charge percentage, to
|
|
59
|
+
# calculate the charge amount. Must be rounded to maximum 2 decimals
|
|
60
|
+
base_amount: nil,
|
|
61
|
+
# The percentage that may be used, in conjunction with the charge base amount, to
|
|
62
|
+
# calculate the charge amount. To state 20%, use value 20
|
|
63
|
+
multiplier_factor: nil,
|
|
64
|
+
# The reason for the charge
|
|
65
|
+
reason: nil,
|
|
66
|
+
# The code for the charge reason
|
|
67
|
+
reason_code: nil,
|
|
68
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
69
|
+
#
|
|
70
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
71
|
+
tax_code: nil,
|
|
72
|
+
# The VAT rate, represented as percentage that applies to the charge
|
|
73
|
+
tax_rate: nil
|
|
74
|
+
)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
sig do
|
|
78
|
+
override.returns(
|
|
79
|
+
{
|
|
80
|
+
amount: T.nilable(String),
|
|
81
|
+
base_amount: T.nilable(String),
|
|
82
|
+
multiplier_factor: T.nilable(String),
|
|
83
|
+
reason: T.nilable(String),
|
|
84
|
+
reason_code: T.nilable(String),
|
|
85
|
+
tax_code: T.nilable(EInvoiceAPI::Charge::TaxCode::TaggedSymbol),
|
|
86
|
+
tax_rate: T.nilable(String)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
end
|
|
90
|
+
def to_hash
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
94
|
+
#
|
|
95
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
96
|
+
module TaxCode
|
|
97
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
98
|
+
|
|
99
|
+
TaggedSymbol =
|
|
100
|
+
T.type_alias { T.all(Symbol, EInvoiceAPI::Charge::TaxCode) }
|
|
101
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
102
|
+
|
|
103
|
+
AE = T.let(:AE, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
104
|
+
E = T.let(:E, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
105
|
+
S = T.let(:S, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
106
|
+
Z = T.let(:Z, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
107
|
+
G = T.let(:G, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
108
|
+
O = T.let(:O, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
109
|
+
K = T.let(:K, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
110
|
+
L = T.let(:L, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
111
|
+
M = T.let(:M, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
112
|
+
B = T.let(:B, EInvoiceAPI::Charge::TaxCode::TaggedSymbol)
|
|
113
|
+
|
|
114
|
+
sig do
|
|
115
|
+
override.returns(T::Array[EInvoiceAPI::Charge::TaxCode::TaggedSymbol])
|
|
116
|
+
end
|
|
117
|
+
def self.values
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|