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.
@@ -8,6 +8,13 @@ module EInvoiceAPI
8
8
  T.any(EInvoiceAPI::DocumentCreate, EInvoiceAPI::Internal::AnyHash)
9
9
  end
10
10
 
11
+ sig do
12
+ returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Allowance]))
13
+ end
14
+ attr_accessor :allowances
15
+
16
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
17
+ # decimals
11
18
  sig do
12
19
  returns(T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants))
13
20
  end
@@ -24,6 +31,9 @@ module EInvoiceAPI
24
31
  sig { returns(T.nilable(String)) }
25
32
  attr_accessor :billing_address_recipient
26
33
 
34
+ sig { returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge])) }
35
+ attr_accessor :charges
36
+
27
37
  # Currency of the invoice
28
38
  sig { returns(T.nilable(EInvoiceAPI::CurrencyCode::OrSymbol)) }
29
39
  attr_reader :currency
@@ -70,13 +80,21 @@ module EInvoiceAPI
70
80
  sig { returns(T.nilable(String)) }
71
81
  attr_accessor :invoice_id
72
82
 
83
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
84
+ # total_discount). Must be positive and rounded to maximum 2 decimals
73
85
  sig do
74
86
  returns(T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants))
75
87
  end
76
88
  attr_accessor :invoice_total
77
89
 
90
+ # At least one line item is required
78
91
  sig { returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item])) }
79
- attr_accessor :items
92
+ attr_reader :items
93
+
94
+ sig do
95
+ params(items: T::Array[EInvoiceAPI::DocumentCreate::Item::OrHash]).void
96
+ end
97
+ attr_writer :items
80
98
 
81
99
  sig { returns(T.nilable(String)) }
82
100
  attr_accessor :note
@@ -87,6 +105,8 @@ module EInvoiceAPI
87
105
  sig { returns(T.nilable(String)) }
88
106
  attr_accessor :payment_term
89
107
 
108
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
109
+ # to maximum 2 decimals
90
110
  sig do
91
111
  returns(
92
112
  T.nilable(
@@ -129,6 +149,9 @@ module EInvoiceAPI
129
149
  sig { params(state: EInvoiceAPI::DocumentState::OrSymbol).void }
130
150
  attr_writer :state
131
151
 
152
+ # The taxable base of the invoice. Should be the sum of all line items -
153
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
154
+ # be positive and rounded to maximum 2 decimals
132
155
  sig do
133
156
  returns(T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants))
134
157
  end
@@ -148,11 +171,14 @@ module EInvoiceAPI
148
171
  end
149
172
  attr_accessor :tax_details
150
173
 
174
+ # The total financial discount of the invoice (so discounts not subject to VAT).
175
+ # Must be positive and rounded to maximum 2 decimals
151
176
  sig do
152
177
  returns(T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants))
153
178
  end
154
179
  attr_accessor :total_discount
155
180
 
181
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
156
182
  sig do
157
183
  returns(T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants))
158
184
  end
@@ -185,12 +211,16 @@ module EInvoiceAPI
185
211
 
186
212
  sig do
187
213
  params(
214
+ allowances:
215
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Allowance::OrHash]),
188
216
  amount_due:
189
217
  T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants),
190
218
  attachments:
191
219
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
192
220
  billing_address: T.nilable(String),
193
221
  billing_address_recipient: T.nilable(String),
222
+ charges:
223
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge::OrHash]),
194
224
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
195
225
  customer_address: T.nilable(String),
196
226
  customer_address_recipient: T.nilable(String),
@@ -205,7 +235,7 @@ module EInvoiceAPI
205
235
  invoice_id: T.nilable(String),
206
236
  invoice_total:
207
237
  T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants),
208
- items: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::OrHash]),
238
+ items: T::Array[EInvoiceAPI::DocumentCreate::Item::OrHash],
209
239
  note: T.nilable(String),
210
240
  payment_details:
211
241
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
@@ -241,10 +271,14 @@ module EInvoiceAPI
241
271
  ).returns(T.attached_class)
242
272
  end
243
273
  def self.new(
274
+ allowances: nil,
275
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
276
+ # decimals
244
277
  amount_due: nil,
245
278
  attachments: nil,
246
279
  billing_address: nil,
247
280
  billing_address_recipient: nil,
281
+ charges: nil,
248
282
  # Currency of the invoice
249
283
  currency: nil,
250
284
  customer_address: nil,
@@ -258,11 +292,16 @@ module EInvoiceAPI
258
292
  due_date: nil,
259
293
  invoice_date: nil,
260
294
  invoice_id: nil,
295
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
296
+ # total_discount). Must be positive and rounded to maximum 2 decimals
261
297
  invoice_total: nil,
298
+ # At least one line item is required
262
299
  items: nil,
263
300
  note: nil,
264
301
  payment_details: nil,
265
302
  payment_term: nil,
303
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
304
+ # to maximum 2 decimals
266
305
  previous_unpaid_balance: nil,
267
306
  purchase_order: nil,
268
307
  remittance_address: nil,
@@ -274,11 +313,17 @@ module EInvoiceAPI
274
313
  shipping_address: nil,
275
314
  shipping_address_recipient: nil,
276
315
  state: nil,
316
+ # The taxable base of the invoice. Should be the sum of all line items -
317
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
318
+ # be positive and rounded to maximum 2 decimals
277
319
  subtotal: nil,
278
320
  # Tax category code of the invoice
279
321
  tax_code: nil,
280
322
  tax_details: nil,
323
+ # The total financial discount of the invoice (so discounts not subject to VAT).
324
+ # Must be positive and rounded to maximum 2 decimals
281
325
  total_discount: nil,
326
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
282
327
  total_tax: nil,
283
328
  # VATEX code list for VAT exemption reasons
284
329
  #
@@ -297,12 +342,15 @@ module EInvoiceAPI
297
342
  sig do
298
343
  override.returns(
299
344
  {
345
+ allowances:
346
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Allowance]),
300
347
  amount_due:
301
348
  T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants),
302
349
  attachments:
303
350
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate]),
304
351
  billing_address: T.nilable(String),
305
352
  billing_address_recipient: T.nilable(String),
353
+ charges: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge]),
306
354
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
307
355
  customer_address: T.nilable(String),
308
356
  customer_address_recipient: T.nilable(String),
@@ -317,7 +365,7 @@ module EInvoiceAPI
317
365
  invoice_id: T.nilable(String),
318
366
  invoice_total:
319
367
  T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants),
320
- items: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item]),
368
+ items: T::Array[EInvoiceAPI::DocumentCreate::Item],
321
369
  note: T.nilable(String),
322
370
  payment_details:
323
371
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate]),
@@ -358,6 +406,269 @@ module EInvoiceAPI
358
406
  def to_hash
359
407
  end
360
408
 
409
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
410
+ OrHash =
411
+ T.type_alias do
412
+ T.any(
413
+ EInvoiceAPI::DocumentCreate::Allowance,
414
+ EInvoiceAPI::Internal::AnyHash
415
+ )
416
+ end
417
+
418
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
419
+ sig do
420
+ returns(
421
+ T.nilable(EInvoiceAPI::DocumentCreate::Allowance::Amount::Variants)
422
+ )
423
+ end
424
+ attr_accessor :amount
425
+
426
+ # The base amount that may be used, in conjunction with the allowance percentage,
427
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
428
+ sig do
429
+ returns(
430
+ T.nilable(
431
+ EInvoiceAPI::DocumentCreate::Allowance::BaseAmount::Variants
432
+ )
433
+ )
434
+ end
435
+ attr_accessor :base_amount
436
+
437
+ # The percentage that may be used, in conjunction with the allowance base amount,
438
+ # to calculate the allowance amount. To state 20%, use value 20
439
+ sig do
440
+ returns(
441
+ T.nilable(
442
+ EInvoiceAPI::DocumentCreate::Allowance::MultiplierFactor::Variants
443
+ )
444
+ )
445
+ end
446
+ attr_accessor :multiplier_factor
447
+
448
+ # The reason for the allowance
449
+ sig { returns(T.nilable(String)) }
450
+ attr_accessor :reason
451
+
452
+ # The code for the allowance reason
453
+ sig { returns(T.nilable(String)) }
454
+ attr_accessor :reason_code
455
+
456
+ # Duty or tax or fee category codes (Subset of UNCL5305)
457
+ #
458
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
459
+ sig do
460
+ returns(
461
+ T.nilable(EInvoiceAPI::DocumentCreate::Allowance::TaxCode::OrSymbol)
462
+ )
463
+ end
464
+ attr_accessor :tax_code
465
+
466
+ # The VAT rate, represented as percentage that applies to the allowance
467
+ sig { returns(T.nilable(String)) }
468
+ attr_accessor :tax_rate
469
+
470
+ # An allowance is a discount for example for early payment, volume discount, etc.
471
+ sig do
472
+ params(
473
+ amount:
474
+ T.nilable(
475
+ EInvoiceAPI::DocumentCreate::Allowance::Amount::Variants
476
+ ),
477
+ base_amount:
478
+ T.nilable(
479
+ EInvoiceAPI::DocumentCreate::Allowance::BaseAmount::Variants
480
+ ),
481
+ multiplier_factor:
482
+ T.nilable(
483
+ EInvoiceAPI::DocumentCreate::Allowance::MultiplierFactor::Variants
484
+ ),
485
+ reason: T.nilable(String),
486
+ reason_code: T.nilable(String),
487
+ tax_code:
488
+ T.nilable(
489
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::OrSymbol
490
+ ),
491
+ tax_rate: T.nilable(String)
492
+ ).returns(T.attached_class)
493
+ end
494
+ def self.new(
495
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
496
+ amount: nil,
497
+ # The base amount that may be used, in conjunction with the allowance percentage,
498
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
499
+ base_amount: nil,
500
+ # The percentage that may be used, in conjunction with the allowance base amount,
501
+ # to calculate the allowance amount. To state 20%, use value 20
502
+ multiplier_factor: nil,
503
+ # The reason for the allowance
504
+ reason: nil,
505
+ # The code for the allowance reason
506
+ reason_code: nil,
507
+ # Duty or tax or fee category codes (Subset of UNCL5305)
508
+ #
509
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
510
+ tax_code: nil,
511
+ # The VAT rate, represented as percentage that applies to the allowance
512
+ tax_rate: nil
513
+ )
514
+ end
515
+
516
+ sig do
517
+ override.returns(
518
+ {
519
+ amount:
520
+ T.nilable(
521
+ EInvoiceAPI::DocumentCreate::Allowance::Amount::Variants
522
+ ),
523
+ base_amount:
524
+ T.nilable(
525
+ EInvoiceAPI::DocumentCreate::Allowance::BaseAmount::Variants
526
+ ),
527
+ multiplier_factor:
528
+ T.nilable(
529
+ EInvoiceAPI::DocumentCreate::Allowance::MultiplierFactor::Variants
530
+ ),
531
+ reason: T.nilable(String),
532
+ reason_code: T.nilable(String),
533
+ tax_code:
534
+ T.nilable(
535
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::OrSymbol
536
+ ),
537
+ tax_rate: T.nilable(String)
538
+ }
539
+ )
540
+ end
541
+ def to_hash
542
+ end
543
+
544
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
545
+ module Amount
546
+ extend EInvoiceAPI::Internal::Type::Union
547
+
548
+ Variants = T.type_alias { T.any(Float, String) }
549
+
550
+ sig do
551
+ override.returns(
552
+ T::Array[EInvoiceAPI::DocumentCreate::Allowance::Amount::Variants]
553
+ )
554
+ end
555
+ def self.variants
556
+ end
557
+ end
558
+
559
+ # The base amount that may be used, in conjunction with the allowance percentage,
560
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
561
+ module BaseAmount
562
+ extend EInvoiceAPI::Internal::Type::Union
563
+
564
+ Variants = T.type_alias { T.any(Float, String) }
565
+
566
+ sig do
567
+ override.returns(
568
+ T::Array[
569
+ EInvoiceAPI::DocumentCreate::Allowance::BaseAmount::Variants
570
+ ]
571
+ )
572
+ end
573
+ def self.variants
574
+ end
575
+ end
576
+
577
+ # The percentage that may be used, in conjunction with the allowance base amount,
578
+ # to calculate the allowance amount. To state 20%, use value 20
579
+ module MultiplierFactor
580
+ extend EInvoiceAPI::Internal::Type::Union
581
+
582
+ Variants = T.type_alias { T.any(Float, String) }
583
+
584
+ sig do
585
+ override.returns(
586
+ T::Array[
587
+ EInvoiceAPI::DocumentCreate::Allowance::MultiplierFactor::Variants
588
+ ]
589
+ )
590
+ end
591
+ def self.variants
592
+ end
593
+ end
594
+
595
+ # Duty or tax or fee category codes (Subset of UNCL5305)
596
+ #
597
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
598
+ module TaxCode
599
+ extend EInvoiceAPI::Internal::Type::Enum
600
+
601
+ TaggedSymbol =
602
+ T.type_alias do
603
+ T.all(Symbol, EInvoiceAPI::DocumentCreate::Allowance::TaxCode)
604
+ end
605
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
606
+
607
+ AE =
608
+ T.let(
609
+ :AE,
610
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
611
+ )
612
+ E =
613
+ T.let(
614
+ :E,
615
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
616
+ )
617
+ S =
618
+ T.let(
619
+ :S,
620
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
621
+ )
622
+ Z =
623
+ T.let(
624
+ :Z,
625
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
626
+ )
627
+ G =
628
+ T.let(
629
+ :G,
630
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
631
+ )
632
+ O =
633
+ T.let(
634
+ :O,
635
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
636
+ )
637
+ K =
638
+ T.let(
639
+ :K,
640
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
641
+ )
642
+ L =
643
+ T.let(
644
+ :L,
645
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
646
+ )
647
+ M =
648
+ T.let(
649
+ :M,
650
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
651
+ )
652
+ B =
653
+ T.let(
654
+ :B,
655
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
656
+ )
657
+
658
+ sig do
659
+ override.returns(
660
+ T::Array[
661
+ EInvoiceAPI::DocumentCreate::Allowance::TaxCode::TaggedSymbol
662
+ ]
663
+ )
664
+ end
665
+ def self.values
666
+ end
667
+ end
668
+ end
669
+
670
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
671
+ # decimals
361
672
  module AmountDue
362
673
  extend EInvoiceAPI::Internal::Type::Union
363
674
 
@@ -372,6 +683,263 @@ module EInvoiceAPI
372
683
  end
373
684
  end
374
685
 
686
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
687
+ OrHash =
688
+ T.type_alias do
689
+ T.any(
690
+ EInvoiceAPI::DocumentCreate::Charge,
691
+ EInvoiceAPI::Internal::AnyHash
692
+ )
693
+ end
694
+
695
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
696
+ sig do
697
+ returns(
698
+ T.nilable(EInvoiceAPI::DocumentCreate::Charge::Amount::Variants)
699
+ )
700
+ end
701
+ attr_accessor :amount
702
+
703
+ # The base amount that may be used, in conjunction with the charge percentage, to
704
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
705
+ sig do
706
+ returns(
707
+ T.nilable(EInvoiceAPI::DocumentCreate::Charge::BaseAmount::Variants)
708
+ )
709
+ end
710
+ attr_accessor :base_amount
711
+
712
+ # The percentage that may be used, in conjunction with the charge base amount, to
713
+ # calculate the charge amount. To state 20%, use value 20
714
+ sig do
715
+ returns(
716
+ T.nilable(
717
+ EInvoiceAPI::DocumentCreate::Charge::MultiplierFactor::Variants
718
+ )
719
+ )
720
+ end
721
+ attr_accessor :multiplier_factor
722
+
723
+ # The reason for the charge
724
+ sig { returns(T.nilable(String)) }
725
+ attr_accessor :reason
726
+
727
+ # The code for the charge reason
728
+ sig { returns(T.nilable(String)) }
729
+ attr_accessor :reason_code
730
+
731
+ # Duty or tax or fee category codes (Subset of UNCL5305)
732
+ #
733
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
734
+ sig do
735
+ returns(
736
+ T.nilable(EInvoiceAPI::DocumentCreate::Charge::TaxCode::OrSymbol)
737
+ )
738
+ end
739
+ attr_accessor :tax_code
740
+
741
+ # The VAT rate, represented as percentage that applies to the charge
742
+ sig { returns(T.nilable(String)) }
743
+ attr_accessor :tax_rate
744
+
745
+ # A charge is an additional fee for example for late payment, late delivery, etc.
746
+ sig do
747
+ params(
748
+ amount:
749
+ T.nilable(EInvoiceAPI::DocumentCreate::Charge::Amount::Variants),
750
+ base_amount:
751
+ T.nilable(
752
+ EInvoiceAPI::DocumentCreate::Charge::BaseAmount::Variants
753
+ ),
754
+ multiplier_factor:
755
+ T.nilable(
756
+ EInvoiceAPI::DocumentCreate::Charge::MultiplierFactor::Variants
757
+ ),
758
+ reason: T.nilable(String),
759
+ reason_code: T.nilable(String),
760
+ tax_code:
761
+ T.nilable(EInvoiceAPI::DocumentCreate::Charge::TaxCode::OrSymbol),
762
+ tax_rate: T.nilable(String)
763
+ ).returns(T.attached_class)
764
+ end
765
+ def self.new(
766
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
767
+ amount: nil,
768
+ # The base amount that may be used, in conjunction with the charge percentage, to
769
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
770
+ base_amount: nil,
771
+ # The percentage that may be used, in conjunction with the charge base amount, to
772
+ # calculate the charge amount. To state 20%, use value 20
773
+ multiplier_factor: nil,
774
+ # The reason for the charge
775
+ reason: nil,
776
+ # The code for the charge reason
777
+ reason_code: nil,
778
+ # Duty or tax or fee category codes (Subset of UNCL5305)
779
+ #
780
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
781
+ tax_code: nil,
782
+ # The VAT rate, represented as percentage that applies to the charge
783
+ tax_rate: nil
784
+ )
785
+ end
786
+
787
+ sig do
788
+ override.returns(
789
+ {
790
+ amount:
791
+ T.nilable(
792
+ EInvoiceAPI::DocumentCreate::Charge::Amount::Variants
793
+ ),
794
+ base_amount:
795
+ T.nilable(
796
+ EInvoiceAPI::DocumentCreate::Charge::BaseAmount::Variants
797
+ ),
798
+ multiplier_factor:
799
+ T.nilable(
800
+ EInvoiceAPI::DocumentCreate::Charge::MultiplierFactor::Variants
801
+ ),
802
+ reason: T.nilable(String),
803
+ reason_code: T.nilable(String),
804
+ tax_code:
805
+ T.nilable(
806
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::OrSymbol
807
+ ),
808
+ tax_rate: T.nilable(String)
809
+ }
810
+ )
811
+ end
812
+ def to_hash
813
+ end
814
+
815
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
816
+ module Amount
817
+ extend EInvoiceAPI::Internal::Type::Union
818
+
819
+ Variants = T.type_alias { T.any(Float, String) }
820
+
821
+ sig do
822
+ override.returns(
823
+ T::Array[EInvoiceAPI::DocumentCreate::Charge::Amount::Variants]
824
+ )
825
+ end
826
+ def self.variants
827
+ end
828
+ end
829
+
830
+ # The base amount that may be used, in conjunction with the charge percentage, to
831
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
832
+ module BaseAmount
833
+ extend EInvoiceAPI::Internal::Type::Union
834
+
835
+ Variants = T.type_alias { T.any(Float, String) }
836
+
837
+ sig do
838
+ override.returns(
839
+ T::Array[
840
+ EInvoiceAPI::DocumentCreate::Charge::BaseAmount::Variants
841
+ ]
842
+ )
843
+ end
844
+ def self.variants
845
+ end
846
+ end
847
+
848
+ # The percentage that may be used, in conjunction with the charge base amount, to
849
+ # calculate the charge amount. To state 20%, use value 20
850
+ module MultiplierFactor
851
+ extend EInvoiceAPI::Internal::Type::Union
852
+
853
+ Variants = T.type_alias { T.any(Float, String) }
854
+
855
+ sig do
856
+ override.returns(
857
+ T::Array[
858
+ EInvoiceAPI::DocumentCreate::Charge::MultiplierFactor::Variants
859
+ ]
860
+ )
861
+ end
862
+ def self.variants
863
+ end
864
+ end
865
+
866
+ # Duty or tax or fee category codes (Subset of UNCL5305)
867
+ #
868
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
869
+ module TaxCode
870
+ extend EInvoiceAPI::Internal::Type::Enum
871
+
872
+ TaggedSymbol =
873
+ T.type_alias do
874
+ T.all(Symbol, EInvoiceAPI::DocumentCreate::Charge::TaxCode)
875
+ end
876
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
877
+
878
+ AE =
879
+ T.let(
880
+ :AE,
881
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
882
+ )
883
+ E =
884
+ T.let(
885
+ :E,
886
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
887
+ )
888
+ S =
889
+ T.let(
890
+ :S,
891
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
892
+ )
893
+ Z =
894
+ T.let(
895
+ :Z,
896
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
897
+ )
898
+ G =
899
+ T.let(
900
+ :G,
901
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
902
+ )
903
+ O =
904
+ T.let(
905
+ :O,
906
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
907
+ )
908
+ K =
909
+ T.let(
910
+ :K,
911
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
912
+ )
913
+ L =
914
+ T.let(
915
+ :L,
916
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
917
+ )
918
+ M =
919
+ T.let(
920
+ :M,
921
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
922
+ )
923
+ B =
924
+ T.let(
925
+ :B,
926
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
927
+ )
928
+
929
+ sig do
930
+ override.returns(
931
+ T::Array[
932
+ EInvoiceAPI::DocumentCreate::Charge::TaxCode::TaggedSymbol
933
+ ]
934
+ )
935
+ end
936
+ def self.values
937
+ end
938
+ end
939
+ end
940
+
941
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
942
+ # total_discount). Must be positive and rounded to maximum 2 decimals
375
943
  module InvoiceTotal
376
944
  extend EInvoiceAPI::Internal::Type::Union
377
945
 
@@ -395,6 +963,17 @@ module EInvoiceAPI
395
963
  )
396
964
  end
397
965
 
966
+ # The allowances of the line item.
967
+ sig do
968
+ returns(
969
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::Allowance])
970
+ )
971
+ end
972
+ attr_accessor :allowances
973
+
974
+ # The total amount of the line item, exclusive of VAT, after subtracting line
975
+ # level allowances and adding line level charges. Must be rounded to maximum 2
976
+ # decimals
398
977
  sig do
399
978
  returns(
400
979
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Amount::Variants)
@@ -402,15 +981,27 @@ module EInvoiceAPI
402
981
  end
403
982
  attr_accessor :amount
404
983
 
984
+ # The charges of the line item.
985
+ sig do
986
+ returns(
987
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::Charge])
988
+ )
989
+ end
990
+ attr_accessor :charges
991
+
405
992
  sig { returns(NilClass) }
406
993
  attr_accessor :date
407
994
 
995
+ # The description of the line item.
408
996
  sig { returns(T.nilable(String)) }
409
997
  attr_accessor :description
410
998
 
999
+ # The product code of the line item.
411
1000
  sig { returns(T.nilable(String)) }
412
1001
  attr_accessor :product_code
413
1002
 
1003
+ # The quantity of items (goods or services) that is the subject of the line item.
1004
+ # Must be rounded to maximum 4 decimals
414
1005
  sig do
415
1006
  returns(
416
1007
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Quantity::Variants)
@@ -418,11 +1009,13 @@ module EInvoiceAPI
418
1009
  end
419
1010
  attr_accessor :quantity
420
1011
 
1012
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
421
1013
  sig do
422
1014
  returns(T.nilable(EInvoiceAPI::DocumentCreate::Item::Tax::Variants))
423
1015
  end
424
1016
  attr_accessor :tax
425
1017
 
1018
+ # The VAT rate of the line item expressed as percentage with 2 decimals
426
1019
  sig { returns(T.nilable(String)) }
427
1020
  attr_accessor :tax_rate
428
1021
 
@@ -430,6 +1023,7 @@ module EInvoiceAPI
430
1023
  sig { returns(T.nilable(EInvoiceAPI::UnitOfMeasureCode::OrSymbol)) }
431
1024
  attr_accessor :unit
432
1025
 
1026
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
433
1027
  sig do
434
1028
  returns(
435
1029
  T.nilable(EInvoiceAPI::DocumentCreate::Item::UnitPrice::Variants)
@@ -439,8 +1033,16 @@ module EInvoiceAPI
439
1033
 
440
1034
  sig do
441
1035
  params(
1036
+ allowances:
1037
+ T.nilable(
1038
+ T::Array[EInvoiceAPI::DocumentCreate::Item::Allowance::OrHash]
1039
+ ),
442
1040
  amount:
443
1041
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Amount::Variants),
1042
+ charges:
1043
+ T.nilable(
1044
+ T::Array[EInvoiceAPI::DocumentCreate::Item::Charge::OrHash]
1045
+ ),
444
1046
  date: NilClass,
445
1047
  description: T.nilable(String),
446
1048
  product_code: T.nilable(String),
@@ -454,15 +1056,29 @@ module EInvoiceAPI
454
1056
  ).returns(T.attached_class)
455
1057
  end
456
1058
  def self.new(
1059
+ # The allowances of the line item.
1060
+ allowances: nil,
1061
+ # The total amount of the line item, exclusive of VAT, after subtracting line
1062
+ # level allowances and adding line level charges. Must be rounded to maximum 2
1063
+ # decimals
457
1064
  amount: nil,
1065
+ # The charges of the line item.
1066
+ charges: nil,
458
1067
  date: nil,
1068
+ # The description of the line item.
459
1069
  description: nil,
1070
+ # The product code of the line item.
460
1071
  product_code: nil,
1072
+ # The quantity of items (goods or services) that is the subject of the line item.
1073
+ # Must be rounded to maximum 4 decimals
461
1074
  quantity: nil,
1075
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
462
1076
  tax: nil,
1077
+ # The VAT rate of the line item expressed as percentage with 2 decimals
463
1078
  tax_rate: nil,
464
1079
  # Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
465
1080
  unit: nil,
1081
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
466
1082
  unit_price: nil
467
1083
  )
468
1084
  end
@@ -470,8 +1086,14 @@ module EInvoiceAPI
470
1086
  sig do
471
1087
  override.returns(
472
1088
  {
1089
+ allowances:
1090
+ T.nilable(
1091
+ T::Array[EInvoiceAPI::DocumentCreate::Item::Allowance]
1092
+ ),
473
1093
  amount:
474
1094
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Amount::Variants),
1095
+ charges:
1096
+ T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::Charge]),
475
1097
  date: NilClass,
476
1098
  description: T.nilable(String),
477
1099
  product_code: T.nilable(String),
@@ -492,6 +1114,279 @@ module EInvoiceAPI
492
1114
  def to_hash
493
1115
  end
494
1116
 
1117
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
1118
+ OrHash =
1119
+ T.type_alias do
1120
+ T.any(
1121
+ EInvoiceAPI::DocumentCreate::Item::Allowance,
1122
+ EInvoiceAPI::Internal::AnyHash
1123
+ )
1124
+ end
1125
+
1126
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
1127
+ sig do
1128
+ returns(
1129
+ T.nilable(
1130
+ EInvoiceAPI::DocumentCreate::Item::Allowance::Amount::Variants
1131
+ )
1132
+ )
1133
+ end
1134
+ attr_accessor :amount
1135
+
1136
+ # The base amount that may be used, in conjunction with the allowance percentage,
1137
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
1138
+ sig do
1139
+ returns(
1140
+ T.nilable(
1141
+ EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount::Variants
1142
+ )
1143
+ )
1144
+ end
1145
+ attr_accessor :base_amount
1146
+
1147
+ # The percentage that may be used, in conjunction with the allowance base amount,
1148
+ # to calculate the allowance amount. To state 20%, use value 20
1149
+ sig do
1150
+ returns(
1151
+ T.nilable(
1152
+ EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor::Variants
1153
+ )
1154
+ )
1155
+ end
1156
+ attr_accessor :multiplier_factor
1157
+
1158
+ # The reason for the allowance
1159
+ sig { returns(T.nilable(String)) }
1160
+ attr_accessor :reason
1161
+
1162
+ # The code for the allowance reason
1163
+ sig { returns(T.nilable(String)) }
1164
+ attr_accessor :reason_code
1165
+
1166
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1167
+ #
1168
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1169
+ sig do
1170
+ returns(
1171
+ T.nilable(
1172
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::OrSymbol
1173
+ )
1174
+ )
1175
+ end
1176
+ attr_accessor :tax_code
1177
+
1178
+ # The VAT rate, represented as percentage that applies to the allowance
1179
+ sig { returns(T.nilable(String)) }
1180
+ attr_accessor :tax_rate
1181
+
1182
+ # An allowance is a discount for example for early payment, volume discount, etc.
1183
+ sig do
1184
+ params(
1185
+ amount:
1186
+ T.nilable(
1187
+ EInvoiceAPI::DocumentCreate::Item::Allowance::Amount::Variants
1188
+ ),
1189
+ base_amount:
1190
+ T.nilable(
1191
+ EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount::Variants
1192
+ ),
1193
+ multiplier_factor:
1194
+ T.nilable(
1195
+ EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor::Variants
1196
+ ),
1197
+ reason: T.nilable(String),
1198
+ reason_code: T.nilable(String),
1199
+ tax_code:
1200
+ T.nilable(
1201
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::OrSymbol
1202
+ ),
1203
+ tax_rate: T.nilable(String)
1204
+ ).returns(T.attached_class)
1205
+ end
1206
+ def self.new(
1207
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
1208
+ amount: nil,
1209
+ # The base amount that may be used, in conjunction with the allowance percentage,
1210
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
1211
+ base_amount: nil,
1212
+ # The percentage that may be used, in conjunction with the allowance base amount,
1213
+ # to calculate the allowance amount. To state 20%, use value 20
1214
+ multiplier_factor: nil,
1215
+ # The reason for the allowance
1216
+ reason: nil,
1217
+ # The code for the allowance reason
1218
+ reason_code: nil,
1219
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1220
+ #
1221
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1222
+ tax_code: nil,
1223
+ # The VAT rate, represented as percentage that applies to the allowance
1224
+ tax_rate: nil
1225
+ )
1226
+ end
1227
+
1228
+ sig do
1229
+ override.returns(
1230
+ {
1231
+ amount:
1232
+ T.nilable(
1233
+ EInvoiceAPI::DocumentCreate::Item::Allowance::Amount::Variants
1234
+ ),
1235
+ base_amount:
1236
+ T.nilable(
1237
+ EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount::Variants
1238
+ ),
1239
+ multiplier_factor:
1240
+ T.nilable(
1241
+ EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor::Variants
1242
+ ),
1243
+ reason: T.nilable(String),
1244
+ reason_code: T.nilable(String),
1245
+ tax_code:
1246
+ T.nilable(
1247
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::OrSymbol
1248
+ ),
1249
+ tax_rate: T.nilable(String)
1250
+ }
1251
+ )
1252
+ end
1253
+ def to_hash
1254
+ end
1255
+
1256
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
1257
+ module Amount
1258
+ extend EInvoiceAPI::Internal::Type::Union
1259
+
1260
+ Variants = T.type_alias { T.any(Float, String) }
1261
+
1262
+ sig do
1263
+ override.returns(
1264
+ T::Array[
1265
+ EInvoiceAPI::DocumentCreate::Item::Allowance::Amount::Variants
1266
+ ]
1267
+ )
1268
+ end
1269
+ def self.variants
1270
+ end
1271
+ end
1272
+
1273
+ # The base amount that may be used, in conjunction with the allowance percentage,
1274
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
1275
+ module BaseAmount
1276
+ extend EInvoiceAPI::Internal::Type::Union
1277
+
1278
+ Variants = T.type_alias { T.any(Float, String) }
1279
+
1280
+ sig do
1281
+ override.returns(
1282
+ T::Array[
1283
+ EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount::Variants
1284
+ ]
1285
+ )
1286
+ end
1287
+ def self.variants
1288
+ end
1289
+ end
1290
+
1291
+ # The percentage that may be used, in conjunction with the allowance base amount,
1292
+ # to calculate the allowance amount. To state 20%, use value 20
1293
+ module MultiplierFactor
1294
+ extend EInvoiceAPI::Internal::Type::Union
1295
+
1296
+ Variants = T.type_alias { T.any(Float, String) }
1297
+
1298
+ sig do
1299
+ override.returns(
1300
+ T::Array[
1301
+ EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor::Variants
1302
+ ]
1303
+ )
1304
+ end
1305
+ def self.variants
1306
+ end
1307
+ end
1308
+
1309
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1310
+ #
1311
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1312
+ module TaxCode
1313
+ extend EInvoiceAPI::Internal::Type::Enum
1314
+
1315
+ TaggedSymbol =
1316
+ T.type_alias do
1317
+ T.all(
1318
+ Symbol,
1319
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode
1320
+ )
1321
+ end
1322
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1323
+
1324
+ AE =
1325
+ T.let(
1326
+ :AE,
1327
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1328
+ )
1329
+ E =
1330
+ T.let(
1331
+ :E,
1332
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1333
+ )
1334
+ S =
1335
+ T.let(
1336
+ :S,
1337
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1338
+ )
1339
+ Z =
1340
+ T.let(
1341
+ :Z,
1342
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1343
+ )
1344
+ G =
1345
+ T.let(
1346
+ :G,
1347
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1348
+ )
1349
+ O =
1350
+ T.let(
1351
+ :O,
1352
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1353
+ )
1354
+ K =
1355
+ T.let(
1356
+ :K,
1357
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1358
+ )
1359
+ L =
1360
+ T.let(
1361
+ :L,
1362
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1363
+ )
1364
+ M =
1365
+ T.let(
1366
+ :M,
1367
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1368
+ )
1369
+ B =
1370
+ T.let(
1371
+ :B,
1372
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1373
+ )
1374
+
1375
+ sig do
1376
+ override.returns(
1377
+ T::Array[
1378
+ EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode::TaggedSymbol
1379
+ ]
1380
+ )
1381
+ end
1382
+ def self.values
1383
+ end
1384
+ end
1385
+ end
1386
+
1387
+ # The total amount of the line item, exclusive of VAT, after subtracting line
1388
+ # level allowances and adding line level charges. Must be rounded to maximum 2
1389
+ # decimals
495
1390
  module Amount
496
1391
  extend EInvoiceAPI::Internal::Type::Union
497
1392
 
@@ -506,6 +1401,278 @@ module EInvoiceAPI
506
1401
  end
507
1402
  end
508
1403
 
1404
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
1405
+ OrHash =
1406
+ T.type_alias do
1407
+ T.any(
1408
+ EInvoiceAPI::DocumentCreate::Item::Charge,
1409
+ EInvoiceAPI::Internal::AnyHash
1410
+ )
1411
+ end
1412
+
1413
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
1414
+ sig do
1415
+ returns(
1416
+ T.nilable(
1417
+ EInvoiceAPI::DocumentCreate::Item::Charge::Amount::Variants
1418
+ )
1419
+ )
1420
+ end
1421
+ attr_accessor :amount
1422
+
1423
+ # The base amount that may be used, in conjunction with the charge percentage, to
1424
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1425
+ sig do
1426
+ returns(
1427
+ T.nilable(
1428
+ EInvoiceAPI::DocumentCreate::Item::Charge::BaseAmount::Variants
1429
+ )
1430
+ )
1431
+ end
1432
+ attr_accessor :base_amount
1433
+
1434
+ # The percentage that may be used, in conjunction with the charge base amount, to
1435
+ # calculate the charge amount. To state 20%, use value 20
1436
+ sig do
1437
+ returns(
1438
+ T.nilable(
1439
+ EInvoiceAPI::DocumentCreate::Item::Charge::MultiplierFactor::Variants
1440
+ )
1441
+ )
1442
+ end
1443
+ attr_accessor :multiplier_factor
1444
+
1445
+ # The reason for the charge
1446
+ sig { returns(T.nilable(String)) }
1447
+ attr_accessor :reason
1448
+
1449
+ # The code for the charge reason
1450
+ sig { returns(T.nilable(String)) }
1451
+ attr_accessor :reason_code
1452
+
1453
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1454
+ #
1455
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1456
+ sig do
1457
+ returns(
1458
+ T.nilable(
1459
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::OrSymbol
1460
+ )
1461
+ )
1462
+ end
1463
+ attr_accessor :tax_code
1464
+
1465
+ # The VAT rate, represented as percentage that applies to the charge
1466
+ sig { returns(T.nilable(String)) }
1467
+ attr_accessor :tax_rate
1468
+
1469
+ # A charge is an additional fee for example for late payment, late delivery, etc.
1470
+ sig do
1471
+ params(
1472
+ amount:
1473
+ T.nilable(
1474
+ EInvoiceAPI::DocumentCreate::Item::Charge::Amount::Variants
1475
+ ),
1476
+ base_amount:
1477
+ T.nilable(
1478
+ EInvoiceAPI::DocumentCreate::Item::Charge::BaseAmount::Variants
1479
+ ),
1480
+ multiplier_factor:
1481
+ T.nilable(
1482
+ EInvoiceAPI::DocumentCreate::Item::Charge::MultiplierFactor::Variants
1483
+ ),
1484
+ reason: T.nilable(String),
1485
+ reason_code: T.nilable(String),
1486
+ tax_code:
1487
+ T.nilable(
1488
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::OrSymbol
1489
+ ),
1490
+ tax_rate: T.nilable(String)
1491
+ ).returns(T.attached_class)
1492
+ end
1493
+ def self.new(
1494
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
1495
+ amount: nil,
1496
+ # The base amount that may be used, in conjunction with the charge percentage, to
1497
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1498
+ base_amount: nil,
1499
+ # The percentage that may be used, in conjunction with the charge base amount, to
1500
+ # calculate the charge amount. To state 20%, use value 20
1501
+ multiplier_factor: nil,
1502
+ # The reason for the charge
1503
+ reason: nil,
1504
+ # The code for the charge reason
1505
+ reason_code: nil,
1506
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1507
+ #
1508
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1509
+ tax_code: nil,
1510
+ # The VAT rate, represented as percentage that applies to the charge
1511
+ tax_rate: nil
1512
+ )
1513
+ end
1514
+
1515
+ sig do
1516
+ override.returns(
1517
+ {
1518
+ amount:
1519
+ T.nilable(
1520
+ EInvoiceAPI::DocumentCreate::Item::Charge::Amount::Variants
1521
+ ),
1522
+ base_amount:
1523
+ T.nilable(
1524
+ EInvoiceAPI::DocumentCreate::Item::Charge::BaseAmount::Variants
1525
+ ),
1526
+ multiplier_factor:
1527
+ T.nilable(
1528
+ EInvoiceAPI::DocumentCreate::Item::Charge::MultiplierFactor::Variants
1529
+ ),
1530
+ reason: T.nilable(String),
1531
+ reason_code: T.nilable(String),
1532
+ tax_code:
1533
+ T.nilable(
1534
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::OrSymbol
1535
+ ),
1536
+ tax_rate: T.nilable(String)
1537
+ }
1538
+ )
1539
+ end
1540
+ def to_hash
1541
+ end
1542
+
1543
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
1544
+ module Amount
1545
+ extend EInvoiceAPI::Internal::Type::Union
1546
+
1547
+ Variants = T.type_alias { T.any(Float, String) }
1548
+
1549
+ sig do
1550
+ override.returns(
1551
+ T::Array[
1552
+ EInvoiceAPI::DocumentCreate::Item::Charge::Amount::Variants
1553
+ ]
1554
+ )
1555
+ end
1556
+ def self.variants
1557
+ end
1558
+ end
1559
+
1560
+ # The base amount that may be used, in conjunction with the charge percentage, to
1561
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1562
+ module BaseAmount
1563
+ extend EInvoiceAPI::Internal::Type::Union
1564
+
1565
+ Variants = T.type_alias { T.any(Float, String) }
1566
+
1567
+ sig do
1568
+ override.returns(
1569
+ T::Array[
1570
+ EInvoiceAPI::DocumentCreate::Item::Charge::BaseAmount::Variants
1571
+ ]
1572
+ )
1573
+ end
1574
+ def self.variants
1575
+ end
1576
+ end
1577
+
1578
+ # The percentage that may be used, in conjunction with the charge base amount, to
1579
+ # calculate the charge amount. To state 20%, use value 20
1580
+ module MultiplierFactor
1581
+ extend EInvoiceAPI::Internal::Type::Union
1582
+
1583
+ Variants = T.type_alias { T.any(Float, String) }
1584
+
1585
+ sig do
1586
+ override.returns(
1587
+ T::Array[
1588
+ EInvoiceAPI::DocumentCreate::Item::Charge::MultiplierFactor::Variants
1589
+ ]
1590
+ )
1591
+ end
1592
+ def self.variants
1593
+ end
1594
+ end
1595
+
1596
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1597
+ #
1598
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1599
+ module TaxCode
1600
+ extend EInvoiceAPI::Internal::Type::Enum
1601
+
1602
+ TaggedSymbol =
1603
+ T.type_alias do
1604
+ T.all(
1605
+ Symbol,
1606
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode
1607
+ )
1608
+ end
1609
+ OrSymbol = T.type_alias { T.any(Symbol, String) }
1610
+
1611
+ AE =
1612
+ T.let(
1613
+ :AE,
1614
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1615
+ )
1616
+ E =
1617
+ T.let(
1618
+ :E,
1619
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1620
+ )
1621
+ S =
1622
+ T.let(
1623
+ :S,
1624
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1625
+ )
1626
+ Z =
1627
+ T.let(
1628
+ :Z,
1629
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1630
+ )
1631
+ G =
1632
+ T.let(
1633
+ :G,
1634
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1635
+ )
1636
+ O =
1637
+ T.let(
1638
+ :O,
1639
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1640
+ )
1641
+ K =
1642
+ T.let(
1643
+ :K,
1644
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1645
+ )
1646
+ L =
1647
+ T.let(
1648
+ :L,
1649
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1650
+ )
1651
+ M =
1652
+ T.let(
1653
+ :M,
1654
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1655
+ )
1656
+ B =
1657
+ T.let(
1658
+ :B,
1659
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1660
+ )
1661
+
1662
+ sig do
1663
+ override.returns(
1664
+ T::Array[
1665
+ EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode::TaggedSymbol
1666
+ ]
1667
+ )
1668
+ end
1669
+ def self.values
1670
+ end
1671
+ end
1672
+ end
1673
+
1674
+ # The quantity of items (goods or services) that is the subject of the line item.
1675
+ # Must be rounded to maximum 4 decimals
509
1676
  module Quantity
510
1677
  extend EInvoiceAPI::Internal::Type::Union
511
1678
 
@@ -520,6 +1687,7 @@ module EInvoiceAPI
520
1687
  end
521
1688
  end
522
1689
 
1690
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
523
1691
  module Tax
524
1692
  extend EInvoiceAPI::Internal::Type::Union
525
1693
 
@@ -534,6 +1702,7 @@ module EInvoiceAPI
534
1702
  end
535
1703
  end
536
1704
 
1705
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
537
1706
  module UnitPrice
538
1707
  extend EInvoiceAPI::Internal::Type::Union
539
1708
 
@@ -549,6 +1718,8 @@ module EInvoiceAPI
549
1718
  end
550
1719
  end
551
1720
 
1721
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
1722
+ # to maximum 2 decimals
552
1723
  module PreviousUnpaidBalance
553
1724
  extend EInvoiceAPI::Internal::Type::Union
554
1725
 
@@ -565,6 +1736,9 @@ module EInvoiceAPI
565
1736
  end
566
1737
  end
567
1738
 
1739
+ # The taxable base of the invoice. Should be the sum of all line items -
1740
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
1741
+ # be positive and rounded to maximum 2 decimals
568
1742
  module Subtotal
569
1743
  extend EInvoiceAPI::Internal::Type::Union
570
1744
 
@@ -667,6 +1841,8 @@ module EInvoiceAPI
667
1841
  end
668
1842
  end
669
1843
 
1844
+ # The total financial discount of the invoice (so discounts not subject to VAT).
1845
+ # Must be positive and rounded to maximum 2 decimals
670
1846
  module TotalDiscount
671
1847
  extend EInvoiceAPI::Internal::Type::Union
672
1848
 
@@ -681,6 +1857,7 @@ module EInvoiceAPI
681
1857
  end
682
1858
  end
683
1859
 
1860
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
684
1861
  module TotalTax
685
1862
  extend EInvoiceAPI::Internal::Type::Union
686
1863