e-invoice-api 0.6.0 → 0.7.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.
@@ -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
- attr_reader :attachments
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
- attr_reader :items
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
- attr_reader :payment_details
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
- attr_reader :tax_details
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::Array[EInvoiceAPI::Documents::DocumentAttachment::OrHash],
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: T::Array[EInvoiceAPI::DocumentResponse::Item::OrHash],
232
+ items:
233
+ T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item::OrHash]),
234
234
  note: T.nilable(String),
235
235
  payment_details:
236
- T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail::OrHash],
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::Array[EInvoiceAPI::DocumentResponse::TaxDetail::OrHash],
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: T::Array[EInvoiceAPI::Documents::DocumentAttachment],
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: T::Array[EInvoiceAPI::DocumentResponse::TaxDetail],
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,49 @@ module EInvoiceAPI
381
758
  )
382
759
  end
383
760
 
761
+ # The allowances of the line item.
762
+ sig do
763
+ returns(
764
+ T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item::Allowance])
765
+ )
766
+ end
767
+ attr_accessor :allowances
768
+
769
+ # The total amount of the line item, exclusive of VAT, after subtracting line
770
+ # level allowances and adding line level charges. Must be rounded to maximum 2
771
+ # decimals
384
772
  sig { returns(T.nilable(String)) }
385
773
  attr_accessor :amount
386
774
 
775
+ # The charges of the line item.
776
+ sig do
777
+ returns(
778
+ T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Item::Charge])
779
+ )
780
+ end
781
+ attr_accessor :charges
782
+
387
783
  sig { returns(NilClass) }
388
784
  attr_accessor :date
389
785
 
786
+ # The description of the line item.
390
787
  sig { returns(T.nilable(String)) }
391
788
  attr_accessor :description
392
789
 
790
+ # The product code of the line item.
393
791
  sig { returns(T.nilable(String)) }
394
792
  attr_accessor :product_code
395
793
 
794
+ # The quantity of items (goods or services) that is the subject of the line item.
795
+ # Must be rounded to maximum 4 decimals
396
796
  sig { returns(T.nilable(String)) }
397
797
  attr_accessor :quantity
398
798
 
799
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
399
800
  sig { returns(T.nilable(String)) }
400
801
  attr_accessor :tax
401
802
 
803
+ # The VAT rate of the line item expressed as percentage with 2 decimals
402
804
  sig { returns(T.nilable(String)) }
403
805
  attr_accessor :tax_rate
404
806
 
@@ -406,12 +808,21 @@ module EInvoiceAPI
406
808
  sig { returns(T.nilable(EInvoiceAPI::UnitOfMeasureCode::TaggedSymbol)) }
407
809
  attr_accessor :unit
408
810
 
811
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
409
812
  sig { returns(T.nilable(String)) }
410
813
  attr_accessor :unit_price
411
814
 
412
815
  sig do
413
816
  params(
817
+ allowances:
818
+ T.nilable(
819
+ T::Array[EInvoiceAPI::DocumentResponse::Item::Allowance::OrHash]
820
+ ),
414
821
  amount: T.nilable(String),
822
+ charges:
823
+ T.nilable(
824
+ T::Array[EInvoiceAPI::DocumentResponse::Item::Charge::OrHash]
825
+ ),
415
826
  date: NilClass,
416
827
  description: T.nilable(String),
417
828
  product_code: T.nilable(String),
@@ -423,15 +834,29 @@ module EInvoiceAPI
423
834
  ).returns(T.attached_class)
424
835
  end
425
836
  def self.new(
837
+ # The allowances of the line item.
838
+ allowances: nil,
839
+ # The total amount of the line item, exclusive of VAT, after subtracting line
840
+ # level allowances and adding line level charges. Must be rounded to maximum 2
841
+ # decimals
426
842
  amount: nil,
843
+ # The charges of the line item.
844
+ charges: nil,
427
845
  date: nil,
846
+ # The description of the line item.
428
847
  description: nil,
848
+ # The product code of the line item.
429
849
  product_code: nil,
850
+ # The quantity of items (goods or services) that is the subject of the line item.
851
+ # Must be rounded to maximum 4 decimals
430
852
  quantity: nil,
853
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
431
854
  tax: nil,
855
+ # The VAT rate of the line item expressed as percentage with 2 decimals
432
856
  tax_rate: nil,
433
857
  # Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
434
858
  unit: nil,
859
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
435
860
  unit_price: nil
436
861
  )
437
862
  end
@@ -439,7 +864,15 @@ module EInvoiceAPI
439
864
  sig do
440
865
  override.returns(
441
866
  {
867
+ allowances:
868
+ T.nilable(
869
+ T::Array[EInvoiceAPI::DocumentResponse::Item::Allowance]
870
+ ),
442
871
  amount: T.nilable(String),
872
+ charges:
873
+ T.nilable(
874
+ T::Array[EInvoiceAPI::DocumentResponse::Item::Charge]
875
+ ),
443
876
  date: NilClass,
444
877
  description: T.nilable(String),
445
878
  product_code: T.nilable(String),
@@ -453,6 +886,368 @@ module EInvoiceAPI
453
886
  end
454
887
  def to_hash
455
888
  end
889
+
890
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
891
+ OrHash =
892
+ T.type_alias do
893
+ T.any(
894
+ EInvoiceAPI::DocumentResponse::Item::Allowance,
895
+ EInvoiceAPI::Internal::AnyHash
896
+ )
897
+ end
898
+
899
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
900
+ sig { returns(T.nilable(String)) }
901
+ attr_accessor :amount
902
+
903
+ # The base amount that may be used, in conjunction with the allowance percentage,
904
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
905
+ sig { returns(T.nilable(String)) }
906
+ attr_accessor :base_amount
907
+
908
+ # The percentage that may be used, in conjunction with the allowance base amount,
909
+ # to calculate the allowance amount. To state 20%, use value 20
910
+ sig { returns(T.nilable(String)) }
911
+ attr_accessor :multiplier_factor
912
+
913
+ # The reason for the allowance
914
+ sig { returns(T.nilable(String)) }
915
+ attr_accessor :reason
916
+
917
+ # The code for the allowance reason
918
+ sig { returns(T.nilable(String)) }
919
+ attr_accessor :reason_code
920
+
921
+ # Duty or tax or fee category codes (Subset of UNCL5305)
922
+ #
923
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
924
+ sig do
925
+ returns(
926
+ T.nilable(
927
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
928
+ )
929
+ )
930
+ end
931
+ attr_accessor :tax_code
932
+
933
+ # The VAT rate, represented as percentage that applies to the allowance
934
+ sig { returns(T.nilable(String)) }
935
+ attr_accessor :tax_rate
936
+
937
+ # An allowance is a discount for example for early payment, volume discount, etc.
938
+ sig do
939
+ params(
940
+ amount: T.nilable(String),
941
+ base_amount: T.nilable(String),
942
+ multiplier_factor: T.nilable(String),
943
+ reason: T.nilable(String),
944
+ reason_code: T.nilable(String),
945
+ tax_code:
946
+ T.nilable(
947
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::OrSymbol
948
+ ),
949
+ tax_rate: T.nilable(String)
950
+ ).returns(T.attached_class)
951
+ end
952
+ def self.new(
953
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
954
+ amount: nil,
955
+ # The base amount that may be used, in conjunction with the allowance percentage,
956
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
957
+ base_amount: nil,
958
+ # The percentage that may be used, in conjunction with the allowance base amount,
959
+ # to calculate the allowance amount. To state 20%, use value 20
960
+ multiplier_factor: nil,
961
+ # The reason for the allowance
962
+ reason: nil,
963
+ # The code for the allowance reason
964
+ reason_code: nil,
965
+ # Duty or tax or fee category codes (Subset of UNCL5305)
966
+ #
967
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
968
+ tax_code: nil,
969
+ # The VAT rate, represented as percentage that applies to the allowance
970
+ tax_rate: nil
971
+ )
972
+ end
973
+
974
+ sig do
975
+ override.returns(
976
+ {
977
+ amount: T.nilable(String),
978
+ base_amount: T.nilable(String),
979
+ multiplier_factor: T.nilable(String),
980
+ reason: T.nilable(String),
981
+ reason_code: T.nilable(String),
982
+ tax_code:
983
+ T.nilable(
984
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
985
+ ),
986
+ tax_rate: T.nilable(String)
987
+ }
988
+ )
989
+ end
990
+ def to_hash
991
+ end
992
+
993
+ # Duty or tax or fee category codes (Subset of UNCL5305)
994
+ #
995
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
996
+ module TaxCode
997
+ extend EInvoiceAPI::Internal::Type::Enum
998
+
999
+ TaggedSymbol =
1000
+ T.type_alias do
1001
+ T.all(
1002
+ Symbol,
1003
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode
1004
+ )
1005
+ end
1006
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1007
+
1008
+ AE =
1009
+ T.let(
1010
+ :AE,
1011
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1012
+ )
1013
+ E =
1014
+ T.let(
1015
+ :E,
1016
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1017
+ )
1018
+ S =
1019
+ T.let(
1020
+ :S,
1021
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1022
+ )
1023
+ Z =
1024
+ T.let(
1025
+ :Z,
1026
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1027
+ )
1028
+ G =
1029
+ T.let(
1030
+ :G,
1031
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1032
+ )
1033
+ O =
1034
+ T.let(
1035
+ :O,
1036
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1037
+ )
1038
+ K =
1039
+ T.let(
1040
+ :K,
1041
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1042
+ )
1043
+ L =
1044
+ T.let(
1045
+ :L,
1046
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1047
+ )
1048
+ M =
1049
+ T.let(
1050
+ :M,
1051
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1052
+ )
1053
+ B =
1054
+ T.let(
1055
+ :B,
1056
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1057
+ )
1058
+
1059
+ sig do
1060
+ override.returns(
1061
+ T::Array[
1062
+ EInvoiceAPI::DocumentResponse::Item::Allowance::TaxCode::TaggedSymbol
1063
+ ]
1064
+ )
1065
+ end
1066
+ def self.values
1067
+ end
1068
+ end
1069
+ end
1070
+
1071
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
1072
+ OrHash =
1073
+ T.type_alias do
1074
+ T.any(
1075
+ EInvoiceAPI::DocumentResponse::Item::Charge,
1076
+ EInvoiceAPI::Internal::AnyHash
1077
+ )
1078
+ end
1079
+
1080
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
1081
+ sig { returns(T.nilable(String)) }
1082
+ attr_accessor :amount
1083
+
1084
+ # The base amount that may be used, in conjunction with the charge percentage, to
1085
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1086
+ sig { returns(T.nilable(String)) }
1087
+ attr_accessor :base_amount
1088
+
1089
+ # The percentage that may be used, in conjunction with the charge base amount, to
1090
+ # calculate the charge amount. To state 20%, use value 20
1091
+ sig { returns(T.nilable(String)) }
1092
+ attr_accessor :multiplier_factor
1093
+
1094
+ # The reason for the charge
1095
+ sig { returns(T.nilable(String)) }
1096
+ attr_accessor :reason
1097
+
1098
+ # The code for the charge reason
1099
+ sig { returns(T.nilable(String)) }
1100
+ attr_accessor :reason_code
1101
+
1102
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1103
+ #
1104
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1105
+ sig do
1106
+ returns(
1107
+ T.nilable(
1108
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1109
+ )
1110
+ )
1111
+ end
1112
+ attr_accessor :tax_code
1113
+
1114
+ # The VAT rate, represented as percentage that applies to the charge
1115
+ sig { returns(T.nilable(String)) }
1116
+ attr_accessor :tax_rate
1117
+
1118
+ # A charge is an additional fee for example for late payment, late delivery, etc.
1119
+ sig do
1120
+ params(
1121
+ amount: T.nilable(String),
1122
+ base_amount: T.nilable(String),
1123
+ multiplier_factor: T.nilable(String),
1124
+ reason: T.nilable(String),
1125
+ reason_code: T.nilable(String),
1126
+ tax_code:
1127
+ T.nilable(
1128
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::OrSymbol
1129
+ ),
1130
+ tax_rate: T.nilable(String)
1131
+ ).returns(T.attached_class)
1132
+ end
1133
+ def self.new(
1134
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
1135
+ amount: nil,
1136
+ # The base amount that may be used, in conjunction with the charge percentage, to
1137
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1138
+ base_amount: nil,
1139
+ # The percentage that may be used, in conjunction with the charge base amount, to
1140
+ # calculate the charge amount. To state 20%, use value 20
1141
+ multiplier_factor: nil,
1142
+ # The reason for the charge
1143
+ reason: nil,
1144
+ # The code for the charge reason
1145
+ reason_code: nil,
1146
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1147
+ #
1148
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1149
+ tax_code: nil,
1150
+ # The VAT rate, represented as percentage that applies to the charge
1151
+ tax_rate: nil
1152
+ )
1153
+ end
1154
+
1155
+ sig do
1156
+ override.returns(
1157
+ {
1158
+ amount: T.nilable(String),
1159
+ base_amount: T.nilable(String),
1160
+ multiplier_factor: T.nilable(String),
1161
+ reason: T.nilable(String),
1162
+ reason_code: T.nilable(String),
1163
+ tax_code:
1164
+ T.nilable(
1165
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1166
+ ),
1167
+ tax_rate: T.nilable(String)
1168
+ }
1169
+ )
1170
+ end
1171
+ def to_hash
1172
+ end
1173
+
1174
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1175
+ #
1176
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1177
+ module TaxCode
1178
+ extend EInvoiceAPI::Internal::Type::Enum
1179
+
1180
+ TaggedSymbol =
1181
+ T.type_alias do
1182
+ T.all(
1183
+ Symbol,
1184
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode
1185
+ )
1186
+ end
1187
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1188
+
1189
+ AE =
1190
+ T.let(
1191
+ :AE,
1192
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1193
+ )
1194
+ E =
1195
+ T.let(
1196
+ :E,
1197
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1198
+ )
1199
+ S =
1200
+ T.let(
1201
+ :S,
1202
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1203
+ )
1204
+ Z =
1205
+ T.let(
1206
+ :Z,
1207
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1208
+ )
1209
+ G =
1210
+ T.let(
1211
+ :G,
1212
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1213
+ )
1214
+ O =
1215
+ T.let(
1216
+ :O,
1217
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1218
+ )
1219
+ K =
1220
+ T.let(
1221
+ :K,
1222
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1223
+ )
1224
+ L =
1225
+ T.let(
1226
+ :L,
1227
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1228
+ )
1229
+ M =
1230
+ T.let(
1231
+ :M,
1232
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1233
+ )
1234
+ B =
1235
+ T.let(
1236
+ :B,
1237
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1238
+ )
1239
+
1240
+ sig do
1241
+ override.returns(
1242
+ T::Array[
1243
+ EInvoiceAPI::DocumentResponse::Item::Charge::TaxCode::TaggedSymbol
1244
+ ]
1245
+ )
1246
+ end
1247
+ def self.values
1248
+ end
1249
+ end
1250
+ end
456
1251
  end
457
1252
 
458
1253
  class PaymentDetail < EInvoiceAPI::Internal::Type::BaseModel