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.
@@ -3,7 +3,16 @@
3
3
  module EInvoiceAPI
4
4
  module Models
5
5
  class DocumentCreate < EInvoiceAPI::Internal::Type::BaseModel
6
+ # @!attribute allowances
7
+ #
8
+ # @return [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
9
+ optional :allowances,
10
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Allowance] },
11
+ nil?: true
12
+
6
13
  # @!attribute amount_due
14
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
15
+ # decimals
7
16
  #
8
17
  # @return [Float, String, nil]
9
18
  optional :amount_due, union: -> { EInvoiceAPI::DocumentCreate::AmountDue }, nil?: true
@@ -25,6 +34,13 @@ module EInvoiceAPI
25
34
  # @return [String, nil]
26
35
  optional :billing_address_recipient, String, nil?: true
27
36
 
37
+ # @!attribute charges
38
+ #
39
+ # @return [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
40
+ optional :charges,
41
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Charge] },
42
+ nil?: true
43
+
28
44
  # @!attribute currency
29
45
  # Currency of the invoice
30
46
  #
@@ -87,16 +103,17 @@ module EInvoiceAPI
87
103
  optional :invoice_id, String, nil?: true
88
104
 
89
105
  # @!attribute invoice_total
106
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
107
+ # total_discount). Must be positive and rounded to maximum 2 decimals
90
108
  #
91
109
  # @return [Float, String, nil]
92
110
  optional :invoice_total, union: -> { EInvoiceAPI::DocumentCreate::InvoiceTotal }, nil?: true
93
111
 
94
112
  # @!attribute items
113
+ # At least one line item is required
95
114
  #
96
115
  # @return [Array<EInvoiceAPI::Models::DocumentCreate::Item>, nil]
97
- optional :items,
98
- -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Item] },
99
- nil?: true
116
+ optional :items, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Item] }
100
117
 
101
118
  # @!attribute note
102
119
  #
@@ -116,6 +133,8 @@ module EInvoiceAPI
116
133
  optional :payment_term, String, nil?: true
117
134
 
118
135
  # @!attribute previous_unpaid_balance
136
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
137
+ # to maximum 2 decimals
119
138
  #
120
139
  # @return [Float, String, nil]
121
140
  optional :previous_unpaid_balance,
@@ -173,6 +192,9 @@ module EInvoiceAPI
173
192
  optional :state, enum: -> { EInvoiceAPI::DocumentState }
174
193
 
175
194
  # @!attribute subtotal
195
+ # The taxable base of the invoice. Should be the sum of all line items -
196
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
197
+ # be positive and rounded to maximum 2 decimals
176
198
  #
177
199
  # @return [Float, String, nil]
178
200
  optional :subtotal, union: -> { EInvoiceAPI::DocumentCreate::Subtotal }, nil?: true
@@ -191,11 +213,14 @@ module EInvoiceAPI
191
213
  nil?: true
192
214
 
193
215
  # @!attribute total_discount
216
+ # The total financial discount of the invoice (so discounts not subject to VAT).
217
+ # Must be positive and rounded to maximum 2 decimals
194
218
  #
195
219
  # @return [Float, String, nil]
196
220
  optional :total_discount, union: -> { EInvoiceAPI::DocumentCreate::TotalDiscount }, nil?: true
197
221
 
198
222
  # @!attribute total_tax
223
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
199
224
  #
200
225
  # @return [Float, String, nil]
201
226
  optional :total_tax, union: -> { EInvoiceAPI::DocumentCreate::TotalTax }, nil?: true
@@ -239,11 +264,13 @@ module EInvoiceAPI
239
264
  # @return [String, nil]
240
265
  optional :vendor_tax_id, String, nil?: true
241
266
 
242
- # @!method initialize(amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
267
+ # @!method initialize(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
243
268
  # Some parameter documentations has been truncated, see
244
269
  # {EInvoiceAPI::Models::DocumentCreate} for more details.
245
270
  #
246
- # @param amount_due [Float, String, nil]
271
+ # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
272
+ #
273
+ # @param amount_due [Float, String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
247
274
  #
248
275
  # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
249
276
  #
@@ -251,6 +278,8 @@ module EInvoiceAPI
251
278
  #
252
279
  # @param billing_address_recipient [String, nil]
253
280
  #
281
+ # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
282
+ #
254
283
  # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
255
284
  #
256
285
  # @param customer_address [String, nil]
@@ -275,9 +304,9 @@ module EInvoiceAPI
275
304
  #
276
305
  # @param invoice_id [String, nil]
277
306
  #
278
- # @param invoice_total [Float, String, nil]
307
+ # @param invoice_total [Float, String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
279
308
  #
280
- # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>, nil]
309
+ # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
281
310
  #
282
311
  # @param note [String, nil]
283
312
  #
@@ -285,7 +314,7 @@ module EInvoiceAPI
285
314
  #
286
315
  # @param payment_term [String, nil]
287
316
  #
288
- # @param previous_unpaid_balance [Float, String, nil]
317
+ # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
289
318
  #
290
319
  # @param purchase_order [String, nil]
291
320
  #
@@ -307,15 +336,15 @@ module EInvoiceAPI
307
336
  #
308
337
  # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
309
338
  #
310
- # @param subtotal [Float, String, nil]
339
+ # @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
311
340
  #
312
341
  # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice
313
342
  #
314
343
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
315
344
  #
316
- # @param total_discount [Float, String, nil]
345
+ # @param total_discount [Float, String, nil] The total financial discount of the invoice (so discounts not subject to VAT). M
317
346
  #
318
- # @param total_tax [Float, String, nil]
347
+ # @param total_tax [Float, String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
319
348
  #
320
349
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
321
350
  #
@@ -331,6 +360,146 @@ module EInvoiceAPI
331
360
  #
332
361
  # @param vendor_tax_id [String, nil]
333
362
 
363
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
364
+ # @!attribute amount
365
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
366
+ #
367
+ # @return [Float, String, nil]
368
+ optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Allowance::Amount }, nil?: true
369
+
370
+ # @!attribute base_amount
371
+ # The base amount that may be used, in conjunction with the allowance percentage,
372
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
373
+ #
374
+ # @return [Float, String, nil]
375
+ optional :base_amount, union: -> { EInvoiceAPI::DocumentCreate::Allowance::BaseAmount }, nil?: true
376
+
377
+ # @!attribute multiplier_factor
378
+ # The percentage that may be used, in conjunction with the allowance base amount,
379
+ # to calculate the allowance amount. To state 20%, use value 20
380
+ #
381
+ # @return [Float, String, nil]
382
+ optional :multiplier_factor,
383
+ union: -> { EInvoiceAPI::DocumentCreate::Allowance::MultiplierFactor },
384
+ nil?: true
385
+
386
+ # @!attribute reason
387
+ # The reason for the allowance
388
+ #
389
+ # @return [String, nil]
390
+ optional :reason, String, nil?: true
391
+
392
+ # @!attribute reason_code
393
+ # The code for the allowance reason
394
+ #
395
+ # @return [String, nil]
396
+ optional :reason_code, String, nil?: true
397
+
398
+ # @!attribute tax_code
399
+ # Duty or tax or fee category codes (Subset of UNCL5305)
400
+ #
401
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
402
+ #
403
+ # @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Allowance::TaxCode, nil]
404
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Allowance::TaxCode }, nil?: true
405
+
406
+ # @!attribute tax_rate
407
+ # The VAT rate, represented as percentage that applies to the allowance
408
+ #
409
+ # @return [String, nil]
410
+ optional :tax_rate, String, nil?: true
411
+
412
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
413
+ # Some parameter documentations has been truncated, see
414
+ # {EInvoiceAPI::Models::DocumentCreate::Allowance} for more details.
415
+ #
416
+ # An allowance is a discount for example for early payment, volume discount, etc.
417
+ #
418
+ # @param amount [Float, String, nil] The allowance amount, without VAT. Must be rounded to maximum 2 decimals
419
+ #
420
+ # @param base_amount [Float, String, nil] The base amount that may be used, in conjunction with the allowance percentage,
421
+ #
422
+ # @param multiplier_factor [Float, String, nil] The percentage that may be used, in conjunction with the allowance base amount,
423
+ #
424
+ # @param reason [String, nil] The reason for the allowance
425
+ #
426
+ # @param reason_code [String, nil] The code for the allowance reason
427
+ #
428
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Allowance::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
429
+ #
430
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance
431
+
432
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
433
+ #
434
+ # @see EInvoiceAPI::Models::DocumentCreate::Allowance#amount
435
+ module Amount
436
+ extend EInvoiceAPI::Internal::Type::Union
437
+
438
+ variant Float
439
+
440
+ variant String
441
+
442
+ # @!method self.variants
443
+ # @return [Array(Float, String)]
444
+ end
445
+
446
+ # The base amount that may be used, in conjunction with the allowance percentage,
447
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
448
+ #
449
+ # @see EInvoiceAPI::Models::DocumentCreate::Allowance#base_amount
450
+ module BaseAmount
451
+ extend EInvoiceAPI::Internal::Type::Union
452
+
453
+ variant Float
454
+
455
+ variant String
456
+
457
+ # @!method self.variants
458
+ # @return [Array(Float, String)]
459
+ end
460
+
461
+ # The percentage that may be used, in conjunction with the allowance base amount,
462
+ # to calculate the allowance amount. To state 20%, use value 20
463
+ #
464
+ # @see EInvoiceAPI::Models::DocumentCreate::Allowance#multiplier_factor
465
+ module MultiplierFactor
466
+ extend EInvoiceAPI::Internal::Type::Union
467
+
468
+ variant Float
469
+
470
+ variant String
471
+
472
+ # @!method self.variants
473
+ # @return [Array(Float, String)]
474
+ end
475
+
476
+ # Duty or tax or fee category codes (Subset of UNCL5305)
477
+ #
478
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
479
+ #
480
+ # @see EInvoiceAPI::Models::DocumentCreate::Allowance#tax_code
481
+ module TaxCode
482
+ extend EInvoiceAPI::Internal::Type::Enum
483
+
484
+ AE = :AE
485
+ E = :E
486
+ S = :S
487
+ Z = :Z
488
+ G = :G
489
+ O = :O
490
+ K = :K
491
+ L = :L
492
+ M = :M
493
+ B = :B
494
+
495
+ # @!method self.values
496
+ # @return [Array<Symbol>]
497
+ end
498
+ end
499
+
500
+ # The amount due of the invoice. Must be positive and rounded to maximum 2
501
+ # decimals
502
+ #
334
503
  # @see EInvoiceAPI::Models::DocumentCreate#amount_due
335
504
  module AmountDue
336
505
  extend EInvoiceAPI::Internal::Type::Union
@@ -343,6 +512,146 @@ module EInvoiceAPI
343
512
  # @return [Array(Float, String)]
344
513
  end
345
514
 
515
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
516
+ # @!attribute amount
517
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
518
+ #
519
+ # @return [Float, String, nil]
520
+ optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Charge::Amount }, nil?: true
521
+
522
+ # @!attribute base_amount
523
+ # The base amount that may be used, in conjunction with the charge percentage, to
524
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
525
+ #
526
+ # @return [Float, String, nil]
527
+ optional :base_amount, union: -> { EInvoiceAPI::DocumentCreate::Charge::BaseAmount }, nil?: true
528
+
529
+ # @!attribute multiplier_factor
530
+ # The percentage that may be used, in conjunction with the charge base amount, to
531
+ # calculate the charge amount. To state 20%, use value 20
532
+ #
533
+ # @return [Float, String, nil]
534
+ optional :multiplier_factor,
535
+ union: -> { EInvoiceAPI::DocumentCreate::Charge::MultiplierFactor },
536
+ nil?: true
537
+
538
+ # @!attribute reason
539
+ # The reason for the charge
540
+ #
541
+ # @return [String, nil]
542
+ optional :reason, String, nil?: true
543
+
544
+ # @!attribute reason_code
545
+ # The code for the charge reason
546
+ #
547
+ # @return [String, nil]
548
+ optional :reason_code, String, nil?: true
549
+
550
+ # @!attribute tax_code
551
+ # Duty or tax or fee category codes (Subset of UNCL5305)
552
+ #
553
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
554
+ #
555
+ # @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Charge::TaxCode, nil]
556
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Charge::TaxCode }, nil?: true
557
+
558
+ # @!attribute tax_rate
559
+ # The VAT rate, represented as percentage that applies to the charge
560
+ #
561
+ # @return [String, nil]
562
+ optional :tax_rate, String, nil?: true
563
+
564
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
565
+ # Some parameter documentations has been truncated, see
566
+ # {EInvoiceAPI::Models::DocumentCreate::Charge} for more details.
567
+ #
568
+ # A charge is an additional fee for example for late payment, late delivery, etc.
569
+ #
570
+ # @param amount [Float, String, nil] The charge amount, without VAT. Must be rounded to maximum 2 decimals
571
+ #
572
+ # @param base_amount [Float, String, nil] The base amount that may be used, in conjunction with the charge percentage, to
573
+ #
574
+ # @param multiplier_factor [Float, String, nil] The percentage that may be used, in conjunction with the charge base amount, to
575
+ #
576
+ # @param reason [String, nil] The reason for the charge
577
+ #
578
+ # @param reason_code [String, nil] The code for the charge reason
579
+ #
580
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Charge::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
581
+ #
582
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the charge
583
+
584
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
585
+ #
586
+ # @see EInvoiceAPI::Models::DocumentCreate::Charge#amount
587
+ module Amount
588
+ extend EInvoiceAPI::Internal::Type::Union
589
+
590
+ variant Float
591
+
592
+ variant String
593
+
594
+ # @!method self.variants
595
+ # @return [Array(Float, String)]
596
+ end
597
+
598
+ # The base amount that may be used, in conjunction with the charge percentage, to
599
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
600
+ #
601
+ # @see EInvoiceAPI::Models::DocumentCreate::Charge#base_amount
602
+ module BaseAmount
603
+ extend EInvoiceAPI::Internal::Type::Union
604
+
605
+ variant Float
606
+
607
+ variant String
608
+
609
+ # @!method self.variants
610
+ # @return [Array(Float, String)]
611
+ end
612
+
613
+ # The percentage that may be used, in conjunction with the charge base amount, to
614
+ # calculate the charge amount. To state 20%, use value 20
615
+ #
616
+ # @see EInvoiceAPI::Models::DocumentCreate::Charge#multiplier_factor
617
+ module MultiplierFactor
618
+ extend EInvoiceAPI::Internal::Type::Union
619
+
620
+ variant Float
621
+
622
+ variant String
623
+
624
+ # @!method self.variants
625
+ # @return [Array(Float, String)]
626
+ end
627
+
628
+ # Duty or tax or fee category codes (Subset of UNCL5305)
629
+ #
630
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
631
+ #
632
+ # @see EInvoiceAPI::Models::DocumentCreate::Charge#tax_code
633
+ module TaxCode
634
+ extend EInvoiceAPI::Internal::Type::Enum
635
+
636
+ AE = :AE
637
+ E = :E
638
+ S = :S
639
+ Z = :Z
640
+ G = :G
641
+ O = :O
642
+ K = :K
643
+ L = :L
644
+ M = :M
645
+ B = :B
646
+
647
+ # @!method self.values
648
+ # @return [Array<Symbol>]
649
+ end
650
+ end
651
+
652
+ # The total amount of the invoice (so invoice_total = subtotal + total_tax +
653
+ # total_discount). Must be positive and rounded to maximum 2 decimals
654
+ #
346
655
  # @see EInvoiceAPI::Models::DocumentCreate#invoice_total
347
656
  module InvoiceTotal
348
657
  extend EInvoiceAPI::Internal::Type::Union
@@ -356,37 +665,62 @@ module EInvoiceAPI
356
665
  end
357
666
 
358
667
  class Item < EInvoiceAPI::Internal::Type::BaseModel
668
+ # @!attribute allowances
669
+ # The allowances of the line item.
670
+ #
671
+ # @return [Array<EInvoiceAPI::Models::DocumentCreate::Item::Allowance>, nil]
672
+ optional :allowances,
673
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Item::Allowance] },
674
+ nil?: true
675
+
359
676
  # @!attribute amount
677
+ # The total amount of the line item, exclusive of VAT, after subtracting line
678
+ # level allowances and adding line level charges. Must be rounded to maximum 2
679
+ # decimals
360
680
  #
361
681
  # @return [Float, String, nil]
362
682
  optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Item::Amount }, nil?: true
363
683
 
684
+ # @!attribute charges
685
+ # The charges of the line item.
686
+ #
687
+ # @return [Array<EInvoiceAPI::Models::DocumentCreate::Item::Charge>, nil]
688
+ optional :charges,
689
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::DocumentCreate::Item::Charge] },
690
+ nil?: true
691
+
364
692
  # @!attribute date
365
693
  #
366
694
  # @return [nil]
367
695
  optional :date, NilClass
368
696
 
369
697
  # @!attribute description
698
+ # The description of the line item.
370
699
  #
371
700
  # @return [String, nil]
372
701
  optional :description, String, nil?: true
373
702
 
374
703
  # @!attribute product_code
704
+ # The product code of the line item.
375
705
  #
376
706
  # @return [String, nil]
377
707
  optional :product_code, String, nil?: true
378
708
 
379
709
  # @!attribute quantity
710
+ # The quantity of items (goods or services) that is the subject of the line item.
711
+ # Must be rounded to maximum 4 decimals
380
712
  #
381
713
  # @return [Float, String, nil]
382
714
  optional :quantity, union: -> { EInvoiceAPI::DocumentCreate::Item::Quantity }, nil?: true
383
715
 
384
716
  # @!attribute tax
717
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
385
718
  #
386
719
  # @return [Float, String, nil]
387
720
  optional :tax, union: -> { EInvoiceAPI::DocumentCreate::Item::Tax }, nil?: true
388
721
 
389
722
  # @!attribute tax_rate
723
+ # The VAT rate of the line item expressed as percentage with 2 decimals
390
724
  #
391
725
  # @return [String, nil]
392
726
  optional :tax_rate, String, nil?: true
@@ -398,29 +732,182 @@ module EInvoiceAPI
398
732
  optional :unit, enum: -> { EInvoiceAPI::UnitOfMeasureCode }, nil?: true
399
733
 
400
734
  # @!attribute unit_price
735
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
401
736
  #
402
737
  # @return [Float, String, nil]
403
738
  optional :unit_price, union: -> { EInvoiceAPI::DocumentCreate::Item::UnitPrice }, nil?: true
404
739
 
405
- # @!method initialize(amount: nil, date: nil, description: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
406
- # @param amount [Float, String, nil]
740
+ # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
741
+ # Some parameter documentations has been truncated, see
742
+ # {EInvoiceAPI::Models::DocumentCreate::Item} for more details.
743
+ #
744
+ # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Item::Allowance>, nil] The allowances of the line item.
745
+ #
746
+ # @param amount [Float, String, nil] The total amount of the line item, exclusive of VAT, after subtracting line leve
747
+ #
748
+ # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Item::Charge>, nil] The charges of the line item.
407
749
  #
408
750
  # @param date [nil]
409
751
  #
410
- # @param description [String, nil]
752
+ # @param description [String, nil] The description of the line item.
411
753
  #
412
- # @param product_code [String, nil]
754
+ # @param product_code [String, nil] The product code of the line item.
413
755
  #
414
- # @param quantity [Float, String, nil]
756
+ # @param quantity [Float, String, nil] The quantity of items (goods or services) that is the subject of the line item.
415
757
  #
416
- # @param tax [Float, String, nil]
758
+ # @param tax [Float, String, nil] The total VAT amount for the line item. Must be rounded to maximum 2 decimals
417
759
  #
418
- # @param tax_rate [String, nil]
760
+ # @param tax_rate [String, nil] The VAT rate of the line item expressed as percentage with 2 decimals
419
761
  #
420
762
  # @param unit [Symbol, EInvoiceAPI::Models::UnitOfMeasureCode, nil] Unit of Measure Codes from UNECERec20 used in Peppol BIS Billing 3.0.
421
763
  #
422
- # @param unit_price [Float, String, nil]
764
+ # @param unit_price [Float, String, nil] The unit price of the line item. Must be rounded to maximum 2 decimals
765
+
766
+ class Allowance < EInvoiceAPI::Internal::Type::BaseModel
767
+ # @!attribute amount
768
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
769
+ #
770
+ # @return [Float, String, nil]
771
+ optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::Amount }, nil?: true
772
+
773
+ # @!attribute base_amount
774
+ # The base amount that may be used, in conjunction with the allowance percentage,
775
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
776
+ #
777
+ # @return [Float, String, nil]
778
+ optional :base_amount,
779
+ union: -> {
780
+ EInvoiceAPI::DocumentCreate::Item::Allowance::BaseAmount
781
+ },
782
+ nil?: true
783
+
784
+ # @!attribute multiplier_factor
785
+ # The percentage that may be used, in conjunction with the allowance base amount,
786
+ # to calculate the allowance amount. To state 20%, use value 20
787
+ #
788
+ # @return [Float, String, nil]
789
+ optional :multiplier_factor,
790
+ union: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::MultiplierFactor },
791
+ nil?: true
792
+
793
+ # @!attribute reason
794
+ # The reason for the allowance
795
+ #
796
+ # @return [String, nil]
797
+ optional :reason, String, nil?: true
798
+
799
+ # @!attribute reason_code
800
+ # The code for the allowance reason
801
+ #
802
+ # @return [String, nil]
803
+ optional :reason_code, String, nil?: true
804
+
805
+ # @!attribute tax_code
806
+ # Duty or tax or fee category codes (Subset of UNCL5305)
807
+ #
808
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
809
+ #
810
+ # @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::TaxCode, nil]
811
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Item::Allowance::TaxCode }, nil?: true
812
+
813
+ # @!attribute tax_rate
814
+ # The VAT rate, represented as percentage that applies to the allowance
815
+ #
816
+ # @return [String, nil]
817
+ optional :tax_rate, String, nil?: true
818
+
819
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
820
+ # Some parameter documentations has been truncated, see
821
+ # {EInvoiceAPI::Models::DocumentCreate::Item::Allowance} for more details.
822
+ #
823
+ # An allowance is a discount for example for early payment, volume discount, etc.
824
+ #
825
+ # @param amount [Float, String, nil] The allowance amount, without VAT. Must be rounded to maximum 2 decimals
826
+ #
827
+ # @param base_amount [Float, String, nil] The base amount that may be used, in conjunction with the allowance percentage,
828
+ #
829
+ # @param multiplier_factor [Float, String, nil] The percentage that may be used, in conjunction with the allowance base amount,
830
+ #
831
+ # @param reason [String, nil] The reason for the allowance
832
+ #
833
+ # @param reason_code [String, nil] The code for the allowance reason
834
+ #
835
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Allowance::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
836
+ #
837
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the allowance
838
+
839
+ # The allowance amount, without VAT. Must be rounded to maximum 2 decimals
840
+ #
841
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#amount
842
+ module Amount
843
+ extend EInvoiceAPI::Internal::Type::Union
844
+
845
+ variant Float
846
+
847
+ variant String
848
+
849
+ # @!method self.variants
850
+ # @return [Array(Float, String)]
851
+ end
852
+
853
+ # The base amount that may be used, in conjunction with the allowance percentage,
854
+ # to calculate the allowance amount. Must be rounded to maximum 2 decimals
855
+ #
856
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#base_amount
857
+ module BaseAmount
858
+ extend EInvoiceAPI::Internal::Type::Union
859
+
860
+ variant Float
861
+
862
+ variant String
863
+
864
+ # @!method self.variants
865
+ # @return [Array(Float, String)]
866
+ end
867
+
868
+ # The percentage that may be used, in conjunction with the allowance base amount,
869
+ # to calculate the allowance amount. To state 20%, use value 20
870
+ #
871
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#multiplier_factor
872
+ module MultiplierFactor
873
+ extend EInvoiceAPI::Internal::Type::Union
874
+
875
+ variant Float
876
+
877
+ variant String
878
+
879
+ # @!method self.variants
880
+ # @return [Array(Float, String)]
881
+ end
882
+
883
+ # Duty or tax or fee category codes (Subset of UNCL5305)
884
+ #
885
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
886
+ #
887
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Allowance#tax_code
888
+ module TaxCode
889
+ extend EInvoiceAPI::Internal::Type::Enum
890
+
891
+ AE = :AE
892
+ E = :E
893
+ S = :S
894
+ Z = :Z
895
+ G = :G
896
+ O = :O
897
+ K = :K
898
+ L = :L
899
+ M = :M
900
+ B = :B
901
+
902
+ # @!method self.values
903
+ # @return [Array<Symbol>]
904
+ end
905
+ end
423
906
 
907
+ # The total amount of the line item, exclusive of VAT, after subtracting line
908
+ # level allowances and adding line level charges. Must be rounded to maximum 2
909
+ # decimals
910
+ #
424
911
  # @see EInvoiceAPI::Models::DocumentCreate::Item#amount
425
912
  module Amount
426
913
  extend EInvoiceAPI::Internal::Type::Union
@@ -433,6 +920,150 @@ module EInvoiceAPI
433
920
  # @return [Array(Float, String)]
434
921
  end
435
922
 
923
+ class Charge < EInvoiceAPI::Internal::Type::BaseModel
924
+ # @!attribute amount
925
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
926
+ #
927
+ # @return [Float, String, nil]
928
+ optional :amount, union: -> { EInvoiceAPI::DocumentCreate::Item::Charge::Amount }, nil?: true
929
+
930
+ # @!attribute base_amount
931
+ # The base amount that may be used, in conjunction with the charge percentage, to
932
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
933
+ #
934
+ # @return [Float, String, nil]
935
+ optional :base_amount,
936
+ union: -> {
937
+ EInvoiceAPI::DocumentCreate::Item::Charge::BaseAmount
938
+ },
939
+ nil?: true
940
+
941
+ # @!attribute multiplier_factor
942
+ # The percentage that may be used, in conjunction with the charge base amount, to
943
+ # calculate the charge amount. To state 20%, use value 20
944
+ #
945
+ # @return [Float, String, nil]
946
+ optional :multiplier_factor,
947
+ union: -> { EInvoiceAPI::DocumentCreate::Item::Charge::MultiplierFactor },
948
+ nil?: true
949
+
950
+ # @!attribute reason
951
+ # The reason for the charge
952
+ #
953
+ # @return [String, nil]
954
+ optional :reason, String, nil?: true
955
+
956
+ # @!attribute reason_code
957
+ # The code for the charge reason
958
+ #
959
+ # @return [String, nil]
960
+ optional :reason_code, String, nil?: true
961
+
962
+ # @!attribute tax_code
963
+ # Duty or tax or fee category codes (Subset of UNCL5305)
964
+ #
965
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
966
+ #
967
+ # @return [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Charge::TaxCode, nil]
968
+ optional :tax_code, enum: -> { EInvoiceAPI::DocumentCreate::Item::Charge::TaxCode }, nil?: true
969
+
970
+ # @!attribute tax_rate
971
+ # The VAT rate, represented as percentage that applies to the charge
972
+ #
973
+ # @return [String, nil]
974
+ optional :tax_rate, String, nil?: true
975
+
976
+ # @!method initialize(amount: nil, base_amount: nil, multiplier_factor: nil, reason: nil, reason_code: nil, tax_code: nil, tax_rate: nil)
977
+ # Some parameter documentations has been truncated, see
978
+ # {EInvoiceAPI::Models::DocumentCreate::Item::Charge} for more details.
979
+ #
980
+ # A charge is an additional fee for example for late payment, late delivery, etc.
981
+ #
982
+ # @param amount [Float, String, nil] The charge amount, without VAT. Must be rounded to maximum 2 decimals
983
+ #
984
+ # @param base_amount [Float, String, nil] The base amount that may be used, in conjunction with the charge percentage, to
985
+ #
986
+ # @param multiplier_factor [Float, String, nil] The percentage that may be used, in conjunction with the charge base amount, to
987
+ #
988
+ # @param reason [String, nil] The reason for the charge
989
+ #
990
+ # @param reason_code [String, nil] The code for the charge reason
991
+ #
992
+ # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::Item::Charge::TaxCode, nil] Duty or tax or fee category codes (Subset of UNCL5305)
993
+ #
994
+ # @param tax_rate [String, nil] The VAT rate, represented as percentage that applies to the charge
995
+
996
+ # The charge amount, without VAT. Must be rounded to maximum 2 decimals
997
+ #
998
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Charge#amount
999
+ module Amount
1000
+ extend EInvoiceAPI::Internal::Type::Union
1001
+
1002
+ variant Float
1003
+
1004
+ variant String
1005
+
1006
+ # @!method self.variants
1007
+ # @return [Array(Float, String)]
1008
+ end
1009
+
1010
+ # The base amount that may be used, in conjunction with the charge percentage, to
1011
+ # calculate the charge amount. Must be rounded to maximum 2 decimals
1012
+ #
1013
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Charge#base_amount
1014
+ module BaseAmount
1015
+ extend EInvoiceAPI::Internal::Type::Union
1016
+
1017
+ variant Float
1018
+
1019
+ variant String
1020
+
1021
+ # @!method self.variants
1022
+ # @return [Array(Float, String)]
1023
+ end
1024
+
1025
+ # The percentage that may be used, in conjunction with the charge base amount, to
1026
+ # calculate the charge amount. To state 20%, use value 20
1027
+ #
1028
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Charge#multiplier_factor
1029
+ module MultiplierFactor
1030
+ extend EInvoiceAPI::Internal::Type::Union
1031
+
1032
+ variant Float
1033
+
1034
+ variant String
1035
+
1036
+ # @!method self.variants
1037
+ # @return [Array(Float, String)]
1038
+ end
1039
+
1040
+ # Duty or tax or fee category codes (Subset of UNCL5305)
1041
+ #
1042
+ # Agency: UN/CEFACT Version: D.16B Subset: OpenPEPPOL
1043
+ #
1044
+ # @see EInvoiceAPI::Models::DocumentCreate::Item::Charge#tax_code
1045
+ module TaxCode
1046
+ extend EInvoiceAPI::Internal::Type::Enum
1047
+
1048
+ AE = :AE
1049
+ E = :E
1050
+ S = :S
1051
+ Z = :Z
1052
+ G = :G
1053
+ O = :O
1054
+ K = :K
1055
+ L = :L
1056
+ M = :M
1057
+ B = :B
1058
+
1059
+ # @!method self.values
1060
+ # @return [Array<Symbol>]
1061
+ end
1062
+ end
1063
+
1064
+ # The quantity of items (goods or services) that is the subject of the line item.
1065
+ # Must be rounded to maximum 4 decimals
1066
+ #
436
1067
  # @see EInvoiceAPI::Models::DocumentCreate::Item#quantity
437
1068
  module Quantity
438
1069
  extend EInvoiceAPI::Internal::Type::Union
@@ -445,6 +1076,8 @@ module EInvoiceAPI
445
1076
  # @return [Array(Float, String)]
446
1077
  end
447
1078
 
1079
+ # The total VAT amount for the line item. Must be rounded to maximum 2 decimals
1080
+ #
448
1081
  # @see EInvoiceAPI::Models::DocumentCreate::Item#tax
449
1082
  module Tax
450
1083
  extend EInvoiceAPI::Internal::Type::Union
@@ -457,6 +1090,8 @@ module EInvoiceAPI
457
1090
  # @return [Array(Float, String)]
458
1091
  end
459
1092
 
1093
+ # The unit price of the line item. Must be rounded to maximum 2 decimals
1094
+ #
460
1095
  # @see EInvoiceAPI::Models::DocumentCreate::Item#unit_price
461
1096
  module UnitPrice
462
1097
  extend EInvoiceAPI::Internal::Type::Union
@@ -470,6 +1105,9 @@ module EInvoiceAPI
470
1105
  end
471
1106
  end
472
1107
 
1108
+ # The previous unpaid balance of the invoice, if any. Must be positive and rounded
1109
+ # to maximum 2 decimals
1110
+ #
473
1111
  # @see EInvoiceAPI::Models::DocumentCreate#previous_unpaid_balance
474
1112
  module PreviousUnpaidBalance
475
1113
  extend EInvoiceAPI::Internal::Type::Union
@@ -482,6 +1120,10 @@ module EInvoiceAPI
482
1120
  # @return [Array(Float, String)]
483
1121
  end
484
1122
 
1123
+ # The taxable base of the invoice. Should be the sum of all line items -
1124
+ # allowances (for example commercial discounts) + charges with impact on VAT. Must
1125
+ # be positive and rounded to maximum 2 decimals
1126
+ #
485
1127
  # @see EInvoiceAPI::Models::DocumentCreate#subtotal
486
1128
  module Subtotal
487
1129
  extend EInvoiceAPI::Internal::Type::Union
@@ -543,6 +1185,9 @@ module EInvoiceAPI
543
1185
  end
544
1186
  end
545
1187
 
1188
+ # The total financial discount of the invoice (so discounts not subject to VAT).
1189
+ # Must be positive and rounded to maximum 2 decimals
1190
+ #
546
1191
  # @see EInvoiceAPI::Models::DocumentCreate#total_discount
547
1192
  module TotalDiscount
548
1193
  extend EInvoiceAPI::Internal::Type::Union
@@ -555,6 +1200,8 @@ module EInvoiceAPI
555
1200
  # @return [Array(Float, String)]
556
1201
  end
557
1202
 
1203
+ # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
1204
+ #
558
1205
  # @see EInvoiceAPI::Models::DocumentCreate#total_tax
559
1206
  module TotalTax
560
1207
  extend EInvoiceAPI::Internal::Type::Union