File tree Expand file tree Collapse file tree 8 files changed +13
-11
lines changed Expand file tree Collapse file tree 8 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ protected function _addTax($after = 'discount')
106
106
{
107
107
$ taxTotal = new \Magento \Framework \DataObject (['code ' => 'tax ' , 'block_name ' => $ this ->getNameInLayout ()]);
108
108
$ totals = $ this ->getParentBlock ()->getTotals ();
109
- if ($ totals ['grand_total ' ] ) {
109
+ if (isset ( $ totals ['grand_total_incl ' ]) ) {
110
110
$ this ->getParentBlock ()->addTotal ($ taxTotal , 'grand_total ' );
111
111
}
112
112
$ this ->getParentBlock ()->addTotal ($ taxTotal , $ after );
@@ -319,8 +319,8 @@ protected function _initGrandTotal()
319
319
'label ' => __ ('Grand Total (Incl.Tax) ' ),
320
320
]
321
321
);
322
- $ parent ->addTotal ($ totalExcl , 'grand_total ' );
323
322
$ parent ->addTotal ($ totalIncl , 'grand_total ' );
323
+ $ parent ->addTotal ($ totalExcl , 'tax ' );
324
324
$ this ->_addTax ('grand_total ' );
325
325
}
326
326
return $ this ;
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ public function initTotals()
54
54
$ weeeTotal = $ this ->weeeData ->getTotalAmounts ($ items , $ store );
55
55
$ weeeBaseTotal = $ this ->weeeData ->getBaseTotalAmounts ($ items , $ store );
56
56
if ($ weeeTotal ) {
57
+ $ totals = $ this ->getParentBlock ()->getTotals ();
58
+
57
59
// Add our total information to the set of other totals
58
60
$ total = new \Magento \Framework \DataObject (
59
61
[
@@ -63,10 +65,10 @@ public function initTotals()
63
65
'base_value ' => $ weeeBaseTotal
64
66
]
65
67
);
66
- if ($ this -> getBeforeCondition ( )) {
67
- $ this ->getParentBlock ()->addTotalBefore ($ total , $ this -> getBeforeCondition () );
68
+ if (isset ( $ totals [ ' grand_total_incl ' ] )) {
69
+ $ this ->getParentBlock ()->addTotalBefore ($ total , ' grand_total ' );
68
70
} else {
69
- $ this ->getParentBlock ()->addTotal ($ total , $ this ->getAfterCondition ());
71
+ $ this ->getParentBlock ()->addTotalBefore ($ total , $ this ->getBeforeCondition ());
70
72
}
71
73
}
72
74
return $ this ;
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" creditmemo_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_cm_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >grand_total </argument >
13
+ <argument name =" condition" xsi : type =" string" >tax </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" creditmemo_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_cm_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >grand_total </argument >
13
+ <argument name =" condition" xsi : type =" string" >tax </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" invoice_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_inv_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >grand_total </argument >
13
+ <argument name =" condition" xsi : type =" string" >tax </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" invoice_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_inv_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >grand_total </argument >
13
+ <argument name =" condition" xsi : type =" string" >tax </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" order_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_ord_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >grand_total </argument >
13
+ <argument name =" condition" xsi : type =" string" >tax </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
Original file line number Diff line number Diff line change 10
10
<referenceBlock name =" order_totals" >
11
11
<block class =" Magento\Weee\Block\Sales\Order\Totals" name =" weee_ord_totals" >
12
12
<action method =" setBeforeCondition" >
13
- <argument name =" condition" xsi : type =" string" >tax </argument >
13
+ <argument name =" condition" xsi : type =" string" >grand_total </argument >
14
14
</action >
15
15
</block >
16
16
</referenceBlock >
You can’t perform that action at this time.
0 commit comments