@@ -172,6 +172,7 @@ function ($price, $type) use (&$roundingDelta) {
172
172
public function collectDataProvider ()
173
173
{
174
174
$ result = [];
175
+
175
176
// 3 item_1, $100 with $weee, 8.25 tax rate, full invoice
176
177
$ result ['complete_invoice ' ] = [
177
178
'order_data ' => [
@@ -269,7 +270,6 @@ public function collectDataProvider()
269
270
'base_subtotal ' => 300 ,
270
271
'subtotal_incl_tax ' => 344.85 ,
271
272
'base_subtotal_incl_tax ' => 344.85 ,
272
-
273
273
],
274
274
],
275
275
];
@@ -360,7 +360,6 @@ public function collectDataProvider()
360
360
'tax_ratio ' => serialize (['weee ' => 1.65 / 2.47 ]),
361
361
'weee_tax_applied_row_amount ' => 20 ,
362
362
'base_weee_tax_applied_row_amount ' => 20 ,
363
-
364
363
],
365
364
],
366
365
'invoice_data ' => [
@@ -372,7 +371,6 @@ public function collectDataProvider()
372
371
'base_subtotal ' => 200 ,
373
372
'subtotal_incl_tax ' => 238.15 ,
374
373
'base_subtotal_incl_tax ' => 238.15 ,
375
-
376
374
],
377
375
],
378
376
];
@@ -464,7 +462,6 @@ public function collectDataProvider()
464
462
'tax_ratio ' => serialize (['weee ' => 0.82 / 2.47 ]),
465
463
'weee_tax_applied_row_amount ' => 10 ,
466
464
'base_weee_tax_applied_row_amount ' => 10 ,
467
-
468
465
],
469
466
],
470
467
'invoice_data ' => [
@@ -476,7 +473,6 @@ public function collectDataProvider()
476
473
'base_subtotal ' => 100 ,
477
474
'subtotal_incl_tax ' => 119.07 ,
478
475
'base_subtotal_incl_tax ' => 119.07 ,
479
-
480
476
],
481
477
],
482
478
];
@@ -580,7 +576,98 @@ public function collectDataProvider()
580
576
'base_subtotal ' => 100 ,
581
577
'subtotal_incl_tax ' => 114.95 ,
582
578
'base_subtotal_incl_tax ' => 114.95 ,
579
+ ],
580
+ ],
581
+ ];
583
582
583
+ // 3 item_1, $100 with $weee, 8.25 tax rate. Invoicing qty 0.
584
+ $ result ['zero_invoice ' ] = [
585
+ 'order_data ' => [
586
+ 'previous_invoices ' => [
587
+ ],
588
+ 'data_fields ' => [
589
+ 'shipping_tax_amount ' => 1.24 ,
590
+ 'base_shipping_tax_amount ' => 1.24 ,
591
+ 'shipping_hidden_tax_amount ' => 0 ,
592
+ 'base_shipping_hidden_tax_amount ' => 0 ,
593
+ 'tax_amount ' => 16.09 ,
594
+ 'tax_invoiced ' => 0 ,
595
+ 'base_tax_amount ' => 16.09 ,
596
+ 'base_tax_amount_invoiced ' => 0 ,
597
+ 'subtotal ' => '300 ' ,
598
+ 'base_subtotal ' => '300 ' ,
599
+ ],
600
+ ],
601
+ 'invoice_data ' => [
602
+ 'items ' => [
603
+ 'item_1 ' => [
604
+ 'order_item ' => [
605
+ 'qty_ordered ' => 3 ,
606
+ 'weee_tax_applied_row_amount ' => 30 ,
607
+ 'base_weee_tax_applied_row_amnt ' => 30 ,
608
+ 'row_weee_tax_incl_tax ' => 32.47 ,
609
+ 'base_row_weee_tax_incl_tax ' => 32.47 ,
610
+ 'weee_amount_invoiced ' => 0 ,
611
+ 'base_weee_amount_invoiced ' => 0 ,
612
+ 'weee_tax_amount_invoiced ' => 0 ,
613
+ 'base_weee_tax_amount_invoiced ' => 0 ,
614
+ 'applied_weee ' => [
615
+ [
616
+ 'title ' => 'recycling_fee ' ,
617
+ 'base_row_amount ' => 30 ,
618
+ 'row_amount ' => 30 ,
619
+ 'base_row_amount_incl_tax ' => 32.47 ,
620
+ 'row_amount_incl_tax ' => 32.47 ,
621
+ ],
622
+ ],
623
+ 'applied_weee_updated ' => [
624
+ 'base_row_amount_invoiced ' => 30 ,
625
+ 'row_amount_invoiced ' => 30 ,
626
+ 'base_tax_amount_invoiced ' => 2.47 ,
627
+ 'tax_amount_invoiced ' => 2.47 ,
628
+ ],
629
+ 'qty_invoiced ' => 0 ,
630
+ ],
631
+ 'is_last ' => true ,
632
+ 'data_fields ' => [
633
+ 'qty ' => 0 ,
634
+ 'applied_weee ' => [
635
+ [
636
+ ],
637
+ ],
638
+ ],
639
+ ],
640
+ ],
641
+ 'is_last ' => true ,
642
+ 'include_in_subtotal ' => false ,
643
+ 'data_fields ' => [
644
+ 'grand_total ' => 181.09 ,
645
+ 'base_grand_total ' => 181.09 ,
646
+ 'subtotal ' => 300 ,
647
+ 'base_subtotal ' => 300 ,
648
+ 'subtotal_incl_tax ' => 314.85 ,
649
+ 'base_subtotal_incl_tax ' => 314.85 ,
650
+ 'tax_amount ' => 16.09 ,
651
+ 'base_tax_amount ' => 16.09 ,
652
+ ],
653
+ ],
654
+ 'expected_results ' => [
655
+ 'invoice_items ' => [
656
+ 'item_1 ' => [
657
+ 'applied_weee ' => [
658
+ [
659
+ 'title ' => 'recycling_fee ' ,
660
+ 'base_row_amount ' => 0 ,
661
+ 'row_amount ' => 0 ,
662
+ 'base_row_amount_incl_tax ' => 0 ,
663
+ 'row_amount_incl_tax ' => 0 ,
664
+ ],
665
+ ],
666
+ ],
667
+ ],
668
+ 'invoice_data ' => [
669
+ 'subtotal ' => 300 ,
670
+ 'base_subtotal ' => 300 ,
584
671
],
585
672
],
586
673
];
0 commit comments