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
|
@@ -11,21 +11,20 @@ module EInvoiceAPI
|
|
|
11
11
|
sig { returns(String) }
|
|
12
12
|
attr_accessor :id
|
|
13
13
|
|
|
14
|
+
sig do
|
|
15
|
+
returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Allowance]))
|
|
16
|
+
end
|
|
17
|
+
attr_accessor :allowances
|
|
18
|
+
|
|
19
|
+
# The amount due of the invoice. Must be positive and rounded to maximum 2
|
|
20
|
+
# decimals
|
|
14
21
|
sig { returns(T.nilable(String)) }
|
|
15
22
|
attr_accessor :amount_due
|
|
16
23
|
|
|
17
24
|
sig do
|
|
18
25
|
returns(T.nilable(T::Array[EInvoiceAPI::Documents::DocumentAttachment]))
|
|
19
26
|
end
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
sig do
|
|
23
|
-
params(
|
|
24
|
-
attachments:
|
|
25
|
-
T::Array[EInvoiceAPI::Documents::DocumentAttachment::OrHash]
|
|
26
|
-
).void
|
|
27
|
-
end
|
|
28
|
-
attr_writer :attachments
|
|
27
|
+
attr_accessor :attachments
|
|
29
28
|
|
|
30
29
|
sig { returns(T.nilable(String)) }
|
|
31
30
|
attr_accessor :billing_address
|
|
@@ -33,6 +32,11 @@ module EInvoiceAPI
|
|
|
33
32
|
sig { returns(T.nilable(String)) }
|
|
34
33
|
attr_accessor :billing_address_recipient
|
|
35
34
|
|
|
35
|
+
sig do
|
|
36
|
+
returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge]))
|
|
37
|
+
end
|
|
38
|
+
attr_accessor :charges
|
|
39
|
+
|
|
36
40
|
# Currency of the invoice
|
|
37
41
|
sig { returns(T.nilable(EInvoiceAPI::CurrencyCode::TaggedSymbol)) }
|
|
38
42
|
attr_reader :currency
|
|
@@ -79,18 +83,13 @@ module EInvoiceAPI
|
|
|
79
83
|
sig { returns(T.nilable(String)) }
|
|
80
84
|
attr_accessor :invoice_id
|
|
81
85
|
|
|
86
|
+
# The total amount of the invoice (so invoice_total = subtotal + total_tax +
|
|
87
|
+
# total_discount). Must be positive and rounded to maximum 2 decimals
|
|
82
88
|
sig { returns(T.nilable(String)) }
|
|
83
89
|
attr_accessor :invoice_total
|
|
84
90
|
|
|
85
91
|
sig { returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item])) }
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
sig do
|
|
89
|
-
params(
|
|
90
|
-
items: T::Array[EInvoiceAPI::DocumentResponse::Item::OrHash]
|
|
91
|
-
).void
|
|
92
|
-
end
|
|
93
|
-
attr_writer :items
|
|
92
|
+
attr_accessor :items
|
|
94
93
|
|
|
95
94
|
sig { returns(T.nilable(String)) }
|
|
96
95
|
attr_accessor :note
|
|
@@ -100,19 +99,13 @@ module EInvoiceAPI
|
|
|
100
99
|
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail])
|
|
101
100
|
)
|
|
102
101
|
end
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
sig do
|
|
106
|
-
params(
|
|
107
|
-
payment_details:
|
|
108
|
-
T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail::OrHash]
|
|
109
|
-
).void
|
|
110
|
-
end
|
|
111
|
-
attr_writer :payment_details
|
|
102
|
+
attr_accessor :payment_details
|
|
112
103
|
|
|
113
104
|
sig { returns(T.nilable(String)) }
|
|
114
105
|
attr_accessor :payment_term
|
|
115
106
|
|
|
107
|
+
# The previous unpaid balance of the invoice, if any. Must be positive and rounded
|
|
108
|
+
# to maximum 2 decimals
|
|
116
109
|
sig { returns(T.nilable(String)) }
|
|
117
110
|
attr_accessor :previous_unpaid_balance
|
|
118
111
|
|
|
@@ -149,6 +142,9 @@ module EInvoiceAPI
|
|
|
149
142
|
sig { params(state: EInvoiceAPI::DocumentState::OrSymbol).void }
|
|
150
143
|
attr_writer :state
|
|
151
144
|
|
|
145
|
+
# The taxable base of the invoice. Should be the sum of all line items -
|
|
146
|
+
# allowances (for example commercial discounts) + charges with impact on VAT. Must
|
|
147
|
+
# be positive and rounded to maximum 2 decimals
|
|
152
148
|
sig { returns(T.nilable(String)) }
|
|
153
149
|
attr_accessor :subtotal
|
|
154
150
|
|
|
@@ -166,19 +162,14 @@ module EInvoiceAPI
|
|
|
166
162
|
sig do
|
|
167
163
|
returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::TaxDetail]))
|
|
168
164
|
end
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
sig do
|
|
172
|
-
params(
|
|
173
|
-
tax_details:
|
|
174
|
-
T::Array[EInvoiceAPI::DocumentResponse::TaxDetail::OrHash]
|
|
175
|
-
).void
|
|
176
|
-
end
|
|
177
|
-
attr_writer :tax_details
|
|
165
|
+
attr_accessor :tax_details
|
|
178
166
|
|
|
167
|
+
# The total financial discount of the invoice (so discounts not subject to VAT).
|
|
168
|
+
# Must be positive and rounded to maximum 2 decimals
|
|
179
169
|
sig { returns(T.nilable(String)) }
|
|
180
170
|
attr_accessor :total_discount
|
|
181
171
|
|
|
172
|
+
# The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
|
|
182
173
|
sig { returns(T.nilable(String)) }
|
|
183
174
|
attr_accessor :total_tax
|
|
184
175
|
|
|
@@ -212,11 +203,19 @@ module EInvoiceAPI
|
|
|
212
203
|
sig do
|
|
213
204
|
params(
|
|
214
205
|
id: String,
|
|
206
|
+
allowances:
|
|
207
|
+
T.nilable(
|
|
208
|
+
T::Array[EInvoiceAPI::DocumentResponse::Allowance::OrHash]
|
|
209
|
+
),
|
|
215
210
|
amount_due: T.nilable(String),
|
|
216
211
|
attachments:
|
|
217
|
-
T
|
|
212
|
+
T.nilable(
|
|
213
|
+
T::Array[EInvoiceAPI::Documents::DocumentAttachment::OrHash]
|
|
214
|
+
),
|
|
218
215
|
billing_address: T.nilable(String),
|
|
219
216
|
billing_address_recipient: T.nilable(String),
|
|
217
|
+
charges:
|
|
218
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge::OrHash]),
|
|
220
219
|
currency: EInvoiceAPI::CurrencyCode::OrSymbol,
|
|
221
220
|
customer_address: T.nilable(String),
|
|
222
221
|
customer_address_recipient: T.nilable(String),
|
|
@@ -230,10 +229,13 @@ module EInvoiceAPI
|
|
|
230
229
|
invoice_date: T.nilable(Date),
|
|
231
230
|
invoice_id: T.nilable(String),
|
|
232
231
|
invoice_total: T.nilable(String),
|
|
233
|
-
items:
|
|
232
|
+
items:
|
|
233
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item::OrHash]),
|
|
234
234
|
note: T.nilable(String),
|
|
235
235
|
payment_details:
|
|
236
|
-
T
|
|
236
|
+
T.nilable(
|
|
237
|
+
T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail::OrHash]
|
|
238
|
+
),
|
|
237
239
|
payment_term: T.nilable(String),
|
|
238
240
|
previous_unpaid_balance: T.nilable(String),
|
|
239
241
|
purchase_order: T.nilable(String),
|
|
@@ -249,7 +251,9 @@ module EInvoiceAPI
|
|
|
249
251
|
subtotal: T.nilable(String),
|
|
250
252
|
tax_code: EInvoiceAPI::DocumentResponse::TaxCode::OrSymbol,
|
|
251
253
|
tax_details:
|
|
252
|
-
T
|
|
254
|
+
T.nilable(
|
|
255
|
+
T::Array[EInvoiceAPI::DocumentResponse::TaxDetail::OrHash]
|
|
256
|
+
),
|
|
253
257
|
total_discount: T.nilable(String),
|
|
254
258
|
total_tax: T.nilable(String),
|
|
255
259
|
vatex: T.nilable(EInvoiceAPI::DocumentResponse::Vatex::OrSymbol),
|
|
@@ -263,10 +267,14 @@ module EInvoiceAPI
|
|
|
263
267
|
end
|
|
264
268
|
def self.new(
|
|
265
269
|
id:,
|
|
270
|
+
allowances: nil,
|
|
271
|
+
# The amount due of the invoice. Must be positive and rounded to maximum 2
|
|
272
|
+
# decimals
|
|
266
273
|
amount_due: nil,
|
|
267
274
|
attachments: nil,
|
|
268
275
|
billing_address: nil,
|
|
269
276
|
billing_address_recipient: nil,
|
|
277
|
+
charges: nil,
|
|
270
278
|
# Currency of the invoice
|
|
271
279
|
currency: nil,
|
|
272
280
|
customer_address: nil,
|
|
@@ -280,11 +288,15 @@ module EInvoiceAPI
|
|
|
280
288
|
due_date: nil,
|
|
281
289
|
invoice_date: nil,
|
|
282
290
|
invoice_id: nil,
|
|
291
|
+
# The total amount of the invoice (so invoice_total = subtotal + total_tax +
|
|
292
|
+
# total_discount). Must be positive and rounded to maximum 2 decimals
|
|
283
293
|
invoice_total: nil,
|
|
284
294
|
items: nil,
|
|
285
295
|
note: nil,
|
|
286
296
|
payment_details: nil,
|
|
287
297
|
payment_term: nil,
|
|
298
|
+
# The previous unpaid balance of the invoice, if any. Must be positive and rounded
|
|
299
|
+
# to maximum 2 decimals
|
|
288
300
|
previous_unpaid_balance: nil,
|
|
289
301
|
purchase_order: nil,
|
|
290
302
|
remittance_address: nil,
|
|
@@ -296,11 +308,17 @@ module EInvoiceAPI
|
|
|
296
308
|
shipping_address: nil,
|
|
297
309
|
shipping_address_recipient: nil,
|
|
298
310
|
state: nil,
|
|
311
|
+
# The taxable base of the invoice. Should be the sum of all line items -
|
|
312
|
+
# allowances (for example commercial discounts) + charges with impact on VAT. Must
|
|
313
|
+
# be positive and rounded to maximum 2 decimals
|
|
299
314
|
subtotal: nil,
|
|
300
315
|
# Tax category code of the invoice
|
|
301
316
|
tax_code: nil,
|
|
302
317
|
tax_details: nil,
|
|
318
|
+
# The total financial discount of the invoice (so discounts not subject to VAT).
|
|
319
|
+
# Must be positive and rounded to maximum 2 decimals
|
|
303
320
|
total_discount: nil,
|
|
321
|
+
# The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
|
|
304
322
|
total_tax: nil,
|
|
305
323
|
# VATEX code list for VAT exemption reasons
|
|
306
324
|
#
|
|
@@ -320,10 +338,14 @@ module EInvoiceAPI
|
|
|
320
338
|
override.returns(
|
|
321
339
|
{
|
|
322
340
|
id: String,
|
|
341
|
+
allowances:
|
|
342
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Allowance]),
|
|
323
343
|
amount_due: T.nilable(String),
|
|
324
|
-
attachments:
|
|
344
|
+
attachments:
|
|
345
|
+
T.nilable(T::Array[EInvoiceAPI::Documents::DocumentAttachment]),
|
|
325
346
|
billing_address: T.nilable(String),
|
|
326
347
|
billing_address_recipient: T.nilable(String),
|
|
348
|
+
charges: T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge]),
|
|
327
349
|
currency: EInvoiceAPI::CurrencyCode::TaggedSymbol,
|
|
328
350
|
customer_address: T.nilable(String),
|
|
329
351
|
customer_address_recipient: T.nilable(String),
|
|
@@ -337,10 +359,10 @@ module EInvoiceAPI
|
|
|
337
359
|
invoice_date: T.nilable(Date),
|
|
338
360
|
invoice_id: T.nilable(String),
|
|
339
361
|
invoice_total: T.nilable(String),
|
|
340
|
-
items: T::Array[EInvoiceAPI::DocumentResponse::Item],
|
|
362
|
+
items: T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item]),
|
|
341
363
|
note: T.nilable(String),
|
|
342
364
|
payment_details:
|
|
343
|
-
T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail],
|
|
365
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail]),
|
|
344
366
|
payment_term: T.nilable(String),
|
|
345
367
|
previous_unpaid_balance: T.nilable(String),
|
|
346
368
|
purchase_order: T.nilable(String),
|
|
@@ -355,7 +377,8 @@ module EInvoiceAPI
|
|
|
355
377
|
state: EInvoiceAPI::DocumentState::TaggedSymbol,
|
|
356
378
|
subtotal: T.nilable(String),
|
|
357
379
|
tax_code: EInvoiceAPI::DocumentResponse::TaxCode::TaggedSymbol,
|
|
358
|
-
tax_details:
|
|
380
|
+
tax_details:
|
|
381
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentResponse::TaxDetail]),
|
|
359
382
|
total_discount: T.nilable(String),
|
|
360
383
|
total_tax: T.nilable(String),
|
|
361
384
|
vatex:
|
|
@@ -372,6 +395,360 @@ module EInvoiceAPI
|
|
|
372
395
|
def to_hash
|
|
373
396
|
end
|
|
374
397
|
|
|
398
|
+
class Allowance < EInvoiceAPI::Internal::Type::BaseModel
|
|
399
|
+
OrHash =
|
|
400
|
+
T.type_alias do
|
|
401
|
+
T.any(
|
|
402
|
+
EInvoiceAPI::DocumentResponse::Allowance,
|
|
403
|
+
EInvoiceAPI::Internal::AnyHash
|
|
404
|
+
)
|
|
405
|
+
end
|
|
406
|
+
|
|
407
|
+
# The allowance amount, without VAT. Must be rounded to maximum 2 decimals
|
|
408
|
+
sig { returns(T.nilable(String)) }
|
|
409
|
+
attr_accessor :amount
|
|
410
|
+
|
|
411
|
+
# The base amount that may be used, in conjunction with the allowance percentage,
|
|
412
|
+
# to calculate the allowance amount. Must be rounded to maximum 2 decimals
|
|
413
|
+
sig { returns(T.nilable(String)) }
|
|
414
|
+
attr_accessor :base_amount
|
|
415
|
+
|
|
416
|
+
# The percentage that may be used, in conjunction with the allowance base amount,
|
|
417
|
+
# to calculate the allowance amount. To state 20%, use value 20
|
|
418
|
+
sig { returns(T.nilable(String)) }
|
|
419
|
+
attr_accessor :multiplier_factor
|
|
420
|
+
|
|
421
|
+
# The reason for the allowance
|
|
422
|
+
sig { returns(T.nilable(String)) }
|
|
423
|
+
attr_accessor :reason
|
|
424
|
+
|
|
425
|
+
# The code for the allowance reason
|
|
426
|
+
sig { returns(T.nilable(String)) }
|
|
427
|
+
attr_accessor :reason_code
|
|
428
|
+
|
|
429
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
430
|
+
#
|
|
431
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
432
|
+
sig do
|
|
433
|
+
returns(
|
|
434
|
+
T.nilable(
|
|
435
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
436
|
+
)
|
|
437
|
+
)
|
|
438
|
+
end
|
|
439
|
+
attr_accessor :tax_code
|
|
440
|
+
|
|
441
|
+
# The VAT rate, represented as percentage that applies to the allowance
|
|
442
|
+
sig { returns(T.nilable(String)) }
|
|
443
|
+
attr_accessor :tax_rate
|
|
444
|
+
|
|
445
|
+
sig do
|
|
446
|
+
params(
|
|
447
|
+
amount: T.nilable(String),
|
|
448
|
+
base_amount: T.nilable(String),
|
|
449
|
+
multiplier_factor: T.nilable(String),
|
|
450
|
+
reason: T.nilable(String),
|
|
451
|
+
reason_code: T.nilable(String),
|
|
452
|
+
tax_code:
|
|
453
|
+
T.nilable(
|
|
454
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::OrSymbol
|
|
455
|
+
),
|
|
456
|
+
tax_rate: T.nilable(String)
|
|
457
|
+
).returns(T.attached_class)
|
|
458
|
+
end
|
|
459
|
+
def self.new(
|
|
460
|
+
# The allowance amount, without VAT. Must be rounded to maximum 2 decimals
|
|
461
|
+
amount: nil,
|
|
462
|
+
# The base amount that may be used, in conjunction with the allowance percentage,
|
|
463
|
+
# to calculate the allowance amount. Must be rounded to maximum 2 decimals
|
|
464
|
+
base_amount: nil,
|
|
465
|
+
# The percentage that may be used, in conjunction with the allowance base amount,
|
|
466
|
+
# to calculate the allowance amount. To state 20%, use value 20
|
|
467
|
+
multiplier_factor: nil,
|
|
468
|
+
# The reason for the allowance
|
|
469
|
+
reason: nil,
|
|
470
|
+
# The code for the allowance reason
|
|
471
|
+
reason_code: nil,
|
|
472
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
473
|
+
#
|
|
474
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
475
|
+
tax_code: nil,
|
|
476
|
+
# The VAT rate, represented as percentage that applies to the allowance
|
|
477
|
+
tax_rate: nil
|
|
478
|
+
)
|
|
479
|
+
end
|
|
480
|
+
|
|
481
|
+
sig do
|
|
482
|
+
override.returns(
|
|
483
|
+
{
|
|
484
|
+
amount: T.nilable(String),
|
|
485
|
+
base_amount: T.nilable(String),
|
|
486
|
+
multiplier_factor: T.nilable(String),
|
|
487
|
+
reason: T.nilable(String),
|
|
488
|
+
reason_code: T.nilable(String),
|
|
489
|
+
tax_code:
|
|
490
|
+
T.nilable(
|
|
491
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
492
|
+
),
|
|
493
|
+
tax_rate: T.nilable(String)
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
end
|
|
497
|
+
def to_hash
|
|
498
|
+
end
|
|
499
|
+
|
|
500
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
501
|
+
#
|
|
502
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
503
|
+
module TaxCode
|
|
504
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
505
|
+
|
|
506
|
+
TaggedSymbol =
|
|
507
|
+
T.type_alias do
|
|
508
|
+
T.all(Symbol, EInvoiceAPI::DocumentResponse::Allowance::TaxCode)
|
|
509
|
+
end
|
|
510
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
511
|
+
|
|
512
|
+
AE =
|
|
513
|
+
T.let(
|
|
514
|
+
:AE,
|
|
515
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
516
|
+
)
|
|
517
|
+
E =
|
|
518
|
+
T.let(
|
|
519
|
+
:E,
|
|
520
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
521
|
+
)
|
|
522
|
+
S =
|
|
523
|
+
T.let(
|
|
524
|
+
:S,
|
|
525
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
526
|
+
)
|
|
527
|
+
Z =
|
|
528
|
+
T.let(
|
|
529
|
+
:Z,
|
|
530
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
531
|
+
)
|
|
532
|
+
G =
|
|
533
|
+
T.let(
|
|
534
|
+
:G,
|
|
535
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
536
|
+
)
|
|
537
|
+
O =
|
|
538
|
+
T.let(
|
|
539
|
+
:O,
|
|
540
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
541
|
+
)
|
|
542
|
+
K =
|
|
543
|
+
T.let(
|
|
544
|
+
:K,
|
|
545
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
546
|
+
)
|
|
547
|
+
L =
|
|
548
|
+
T.let(
|
|
549
|
+
:L,
|
|
550
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
551
|
+
)
|
|
552
|
+
M =
|
|
553
|
+
T.let(
|
|
554
|
+
:M,
|
|
555
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
556
|
+
)
|
|
557
|
+
B =
|
|
558
|
+
T.let(
|
|
559
|
+
:B,
|
|
560
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
561
|
+
)
|
|
562
|
+
|
|
563
|
+
sig do
|
|
564
|
+
override.returns(
|
|
565
|
+
T::Array[
|
|
566
|
+
EInvoiceAPI::DocumentResponse::Allowance::TaxCode::TaggedSymbol
|
|
567
|
+
]
|
|
568
|
+
)
|
|
569
|
+
end
|
|
570
|
+
def self.values
|
|
571
|
+
end
|
|
572
|
+
end
|
|
573
|
+
end
|
|
574
|
+
|
|
575
|
+
class Charge < EInvoiceAPI::Internal::Type::BaseModel
|
|
576
|
+
OrHash =
|
|
577
|
+
T.type_alias do
|
|
578
|
+
T.any(
|
|
579
|
+
EInvoiceAPI::DocumentResponse::Charge,
|
|
580
|
+
EInvoiceAPI::Internal::AnyHash
|
|
581
|
+
)
|
|
582
|
+
end
|
|
583
|
+
|
|
584
|
+
# The charge amount, without VAT. Must be rounded to maximum 2 decimals
|
|
585
|
+
sig { returns(T.nilable(String)) }
|
|
586
|
+
attr_accessor :amount
|
|
587
|
+
|
|
588
|
+
# The base amount that may be used, in conjunction with the charge percentage, to
|
|
589
|
+
# calculate the charge amount. Must be rounded to maximum 2 decimals
|
|
590
|
+
sig { returns(T.nilable(String)) }
|
|
591
|
+
attr_accessor :base_amount
|
|
592
|
+
|
|
593
|
+
# The percentage that may be used, in conjunction with the charge base amount, to
|
|
594
|
+
# calculate the charge amount. To state 20%, use value 20
|
|
595
|
+
sig { returns(T.nilable(String)) }
|
|
596
|
+
attr_accessor :multiplier_factor
|
|
597
|
+
|
|
598
|
+
# The reason for the charge
|
|
599
|
+
sig { returns(T.nilable(String)) }
|
|
600
|
+
attr_accessor :reason
|
|
601
|
+
|
|
602
|
+
# The code for the charge reason
|
|
603
|
+
sig { returns(T.nilable(String)) }
|
|
604
|
+
attr_accessor :reason_code
|
|
605
|
+
|
|
606
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
607
|
+
#
|
|
608
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
609
|
+
sig do
|
|
610
|
+
returns(
|
|
611
|
+
T.nilable(
|
|
612
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
613
|
+
)
|
|
614
|
+
)
|
|
615
|
+
end
|
|
616
|
+
attr_accessor :tax_code
|
|
617
|
+
|
|
618
|
+
# The VAT rate, represented as percentage that applies to the charge
|
|
619
|
+
sig { returns(T.nilable(String)) }
|
|
620
|
+
attr_accessor :tax_rate
|
|
621
|
+
|
|
622
|
+
sig do
|
|
623
|
+
params(
|
|
624
|
+
amount: T.nilable(String),
|
|
625
|
+
base_amount: T.nilable(String),
|
|
626
|
+
multiplier_factor: T.nilable(String),
|
|
627
|
+
reason: T.nilable(String),
|
|
628
|
+
reason_code: T.nilable(String),
|
|
629
|
+
tax_code:
|
|
630
|
+
T.nilable(
|
|
631
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::OrSymbol
|
|
632
|
+
),
|
|
633
|
+
tax_rate: T.nilable(String)
|
|
634
|
+
).returns(T.attached_class)
|
|
635
|
+
end
|
|
636
|
+
def self.new(
|
|
637
|
+
# The charge amount, without VAT. Must be rounded to maximum 2 decimals
|
|
638
|
+
amount: nil,
|
|
639
|
+
# The base amount that may be used, in conjunction with the charge percentage, to
|
|
640
|
+
# calculate the charge amount. Must be rounded to maximum 2 decimals
|
|
641
|
+
base_amount: nil,
|
|
642
|
+
# The percentage that may be used, in conjunction with the charge base amount, to
|
|
643
|
+
# calculate the charge amount. To state 20%, use value 20
|
|
644
|
+
multiplier_factor: nil,
|
|
645
|
+
# The reason for the charge
|
|
646
|
+
reason: nil,
|
|
647
|
+
# The code for the charge reason
|
|
648
|
+
reason_code: nil,
|
|
649
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
650
|
+
#
|
|
651
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
652
|
+
tax_code: nil,
|
|
653
|
+
# The VAT rate, represented as percentage that applies to the charge
|
|
654
|
+
tax_rate: nil
|
|
655
|
+
)
|
|
656
|
+
end
|
|
657
|
+
|
|
658
|
+
sig do
|
|
659
|
+
override.returns(
|
|
660
|
+
{
|
|
661
|
+
amount: T.nilable(String),
|
|
662
|
+
base_amount: T.nilable(String),
|
|
663
|
+
multiplier_factor: T.nilable(String),
|
|
664
|
+
reason: T.nilable(String),
|
|
665
|
+
reason_code: T.nilable(String),
|
|
666
|
+
tax_code:
|
|
667
|
+
T.nilable(
|
|
668
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
669
|
+
),
|
|
670
|
+
tax_rate: T.nilable(String)
|
|
671
|
+
}
|
|
672
|
+
)
|
|
673
|
+
end
|
|
674
|
+
def to_hash
|
|
675
|
+
end
|
|
676
|
+
|
|
677
|
+
# Duty or tax or fee category codes (Subset of UNCL5305)
|
|
678
|
+
#
|
|
679
|
+
# Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
|
|
680
|
+
module TaxCode
|
|
681
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
682
|
+
|
|
683
|
+
TaggedSymbol =
|
|
684
|
+
T.type_alias do
|
|
685
|
+
T.all(Symbol, EInvoiceAPI::DocumentResponse::Charge::TaxCode)
|
|
686
|
+
end
|
|
687
|
+
OrSymbol = T.type_alias { T.any(Symbol, String) }
|
|
688
|
+
|
|
689
|
+
AE =
|
|
690
|
+
T.let(
|
|
691
|
+
:AE,
|
|
692
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
693
|
+
)
|
|
694
|
+
E =
|
|
695
|
+
T.let(
|
|
696
|
+
:E,
|
|
697
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
698
|
+
)
|
|
699
|
+
S =
|
|
700
|
+
T.let(
|
|
701
|
+
:S,
|
|
702
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
703
|
+
)
|
|
704
|
+
Z =
|
|
705
|
+
T.let(
|
|
706
|
+
:Z,
|
|
707
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
708
|
+
)
|
|
709
|
+
G =
|
|
710
|
+
T.let(
|
|
711
|
+
:G,
|
|
712
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
713
|
+
)
|
|
714
|
+
O =
|
|
715
|
+
T.let(
|
|
716
|
+
:O,
|
|
717
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
718
|
+
)
|
|
719
|
+
K =
|
|
720
|
+
T.let(
|
|
721
|
+
:K,
|
|
722
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
723
|
+
)
|
|
724
|
+
L =
|
|
725
|
+
T.let(
|
|
726
|
+
:L,
|
|
727
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
728
|
+
)
|
|
729
|
+
M =
|
|
730
|
+
T.let(
|
|
731
|
+
:M,
|
|
732
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
733
|
+
)
|
|
734
|
+
B =
|
|
735
|
+
T.let(
|
|
736
|
+
:B,
|
|
737
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
738
|
+
)
|
|
739
|
+
|
|
740
|
+
sig do
|
|
741
|
+
override.returns(
|
|
742
|
+
T::Array[
|
|
743
|
+
EInvoiceAPI::DocumentResponse::Charge::TaxCode::TaggedSymbol
|
|
744
|
+
]
|
|
745
|
+
)
|
|
746
|
+
end
|
|
747
|
+
def self.values
|
|
748
|
+
end
|
|
749
|
+
end
|
|
750
|
+
end
|
|
751
|
+
|
|
375
752
|
class Item < EInvoiceAPI::Internal::Type::BaseModel
|
|
376
753
|
OrHash =
|
|
377
754
|
T.type_alias do
|
|
@@ -381,24 +758,41 @@ module EInvoiceAPI
|
|
|
381
758
|
)
|
|
382
759
|
end
|
|
383
760
|
|
|
761
|
+
# The allowances of the line item.
|
|
762
|
+
sig { returns(T.nilable(T::Array[EInvoiceAPI::Allowance])) }
|
|
763
|
+
attr_accessor :allowances
|
|
764
|
+
|
|
765
|
+
# The total amount of the line item, exclusive of VAT, after subtracting line
|
|
766
|
+
# level allowances and adding line level charges. Must be rounded to maximum 2
|
|
767
|
+
# decimals
|
|
384
768
|
sig { returns(T.nilable(String)) }
|
|
385
769
|
attr_accessor :amount
|
|
386
770
|
|
|
771
|
+
# The charges of the line item.
|
|
772
|
+
sig { returns(T.nilable(T::Array[EInvoiceAPI::Charge])) }
|
|
773
|
+
attr_accessor :charges
|
|
774
|
+
|
|
387
775
|
sig { returns(NilClass) }
|
|
388
776
|
attr_accessor :date
|
|
389
777
|
|
|
778
|
+
# The description of the line item.
|
|
390
779
|
sig { returns(T.nilable(String)) }
|
|
391
780
|
attr_accessor :description
|
|
392
781
|
|
|
782
|
+
# The product code of the line item.
|
|
393
783
|
sig { returns(T.nilable(String)) }
|
|
394
784
|
attr_accessor :product_code
|
|
395
785
|
|
|
786
|
+
# The quantity of items (goods or services) that is the subject of the line item.
|
|
787
|
+
# Must be rounded to maximum 4 decimals
|
|
396
788
|
sig { returns(T.nilable(String)) }
|
|
397
789
|
attr_accessor :quantity
|
|
398
790
|
|
|
791
|
+
# The total VAT amount for the line item. Must be rounded to maximum 2 decimals
|
|
399
792
|
sig { returns(T.nilable(String)) }
|
|
400
793
|
attr_accessor :tax
|
|
401
794
|
|
|
795
|
+
# The VAT rate of the line item expressed as percentage with 2 decimals
|
|
402
796
|
sig { returns(T.nilable(String)) }
|
|
403
797
|
attr_accessor :tax_rate
|
|
404
798
|
|
|
@@ -406,12 +800,15 @@ module EInvoiceAPI
|
|
|
406
800
|
sig { returns(T.nilable(EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)) }
|
|
407
801
|
attr_accessor :unit
|
|
408
802
|
|
|
803
|
+
# The unit price of the line item. Must be rounded to maximum 2 decimals
|
|
409
804
|
sig { returns(T.nilable(String)) }
|
|
410
805
|
attr_accessor :unit_price
|
|
411
806
|
|
|
412
807
|
sig do
|
|
413
808
|
params(
|
|
809
|
+
allowances: T.nilable(T::Array[EInvoiceAPI::Allowance::OrHash]),
|
|
414
810
|
amount: T.nilable(String),
|
|
811
|
+
charges: T.nilable(T::Array[EInvoiceAPI::Charge::OrHash]),
|
|
415
812
|
date: NilClass,
|
|
416
813
|
description: T.nilable(String),
|
|
417
814
|
product_code: T.nilable(String),
|
|
@@ -423,15 +820,29 @@ module EInvoiceAPI
|
|
|
423
820
|
).returns(T.attached_class)
|
|
424
821
|
end
|
|
425
822
|
def self.new(
|
|
823
|
+
# The allowances of the line item.
|
|
824
|
+
allowances: nil,
|
|
825
|
+
# The total amount of the line item, exclusive of VAT, after subtracting line
|
|
826
|
+
# level allowances and adding line level charges. Must be rounded to maximum 2
|
|
827
|
+
# decimals
|
|
426
828
|
amount: nil,
|
|
829
|
+
# The charges of the line item.
|
|
830
|
+
charges: nil,
|
|
427
831
|
date: nil,
|
|
832
|
+
# The description of the line item.
|
|
428
833
|
description: nil,
|
|
834
|
+
# The product code of the line item.
|
|
429
835
|
product_code: nil,
|
|
836
|
+
# The quantity of items (goods or services) that is the subject of the line item.
|
|
837
|
+
# Must be rounded to maximum 4 decimals
|
|
430
838
|
quantity: nil,
|
|
839
|
+
# The total VAT amount for the line item. Must be rounded to maximum 2 decimals
|
|
431
840
|
tax: nil,
|
|
841
|
+
# The VAT rate of the line item expressed as percentage with 2 decimals
|
|
432
842
|
tax_rate: nil,
|
|
433
843
|
# Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
|
|
434
844
|
unit: nil,
|
|
845
|
+
# The unit price of the line item. Must be rounded to maximum 2 decimals
|
|
435
846
|
unit_price: nil
|
|
436
847
|
)
|
|
437
848
|
end
|
|
@@ -439,7 +850,9 @@ module EInvoiceAPI
|
|
|
439
850
|
sig do
|
|
440
851
|
override.returns(
|
|
441
852
|
{
|
|
853
|
+
allowances: T.nilable(T::Array[EInvoiceAPI::Allowance]),
|
|
442
854
|
amount: T.nilable(String),
|
|
855
|
+
charges: T.nilable(T::Array[EInvoiceAPI::Charge]),
|
|
443
856
|
date: NilClass,
|
|
444
857
|
description: T.nilable(String),
|
|
445
858
|
product_code: T.nilable(String),
|