Skip to content

Commit 657c43b

Browse files
committed
ACP2E-2651: Incorrect subtotal in order when FPT
There is no need in the _if_ as Subtotal Incl Tax does not contain Weee tax even for the last invoice of the order
1 parent 0beccd8 commit 657c43b

File tree

1 file changed

+1
-6
lines changed
  • app/code/Magento/Weee/Model/Total/Invoice

1 file changed

+1
-6
lines changed

app/code/Magento/Weee/Model/Total/Invoice/Weee.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,10 @@ public function collect(\Magento\Sales\Model\Order\Invoice $invoice)
207207
$invoice->setSubtotal($invoice->getSubtotal() + $totalWeeeAmount);
208208
$invoice->setBaseSubtotal($invoice->getBaseSubtotal() + $baseTotalWeeeAmount);
209209
}
210-
211-
if (!$invoice->isLast()) {
210+
212211
// need to add the Weee amounts including all their taxes
213212
$invoice->setSubtotalInclTax($invoice->getSubtotalInclTax() + $totalWeeeAmountInclTax);
214213
$invoice->setBaseSubtotalInclTax($invoice->getBaseSubtotalInclTax() + $baseTotalWeeeAmountInclTax);
215-
// since the Subtotal Incl Tax line will already have the taxes on Weee, just add the non-taxable amounts
216-
$invoice->setSubtotalInclTax($invoice->getSubtotalInclTax() + $totalWeeeAmount);
217-
$invoice->setBaseSubtotalInclTax($invoice->getBaseSubtotalInclTax() + $baseTotalWeeeAmount);
218-
}
219214

220215
$invoice->setGrandTotal($invoice->getGrandTotal() + $totalWeeeAmount + $totalWeeeTaxAmount);
221216
$invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseTotalWeeeAmount + $baseTotalWeeeTaxAmount);

0 commit comments

Comments
 (0)