Skip to content

Commit 2a82ea3

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-707: Credit memo Refund Shipping (Incl. Tax) shows -0.01
1 parent d34a477 commit 2a82ea3

File tree

1 file changed

+3
-9
lines changed
  • app/code/Magento/Sales/Model/Order/Creditmemo/Total

1 file changed

+3
-9
lines changed

app/code/Magento/Sales/Model/Order/Creditmemo/Total/Shipping.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,9 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
5959
$allowedTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded();
6060
$allowedAmountInclTax = $allowedAmount + $allowedTaxAmount;
6161
$baseAllowedAmountInclTaxDiff = $orderBaseShippingInclTax
62-
- $order->getBaseShippingRefunded();
63-
if ($baseAllowedAmountInclTaxDiff < $order->getBaseShippingTaxRefunded()) {
64-
$baseAllowedAmountInclTax = $order->getBaseShippingTaxRefunded()
65-
- $baseAllowedAmountInclTaxDiff;
66-
} else {
67-
$baseAllowedAmountInclTax = $baseAllowedAmountInclTaxDiff
68-
- $order->getBaseShippingTaxRefunded();
69-
}
70-
62+
- $order->getBaseShippingRefunded()
63+
- $order->getBaseShippingTaxRefunded();
64+
$baseAllowedAmountInclTax = ($baseAllowedAmountInclTaxDiff > 0) ? $baseAllowedAmountInclTaxDiff : 0;
7165
// Check if the desired shipping amount to refund was specified (from invoice or another source).
7266
if ($creditmemo->hasBaseShippingAmount()) {
7367
// For the conditional logic, we will either use amounts that always include tax -OR- never include tax.

0 commit comments

Comments
 (0)