Skip to content

Commit 8289e7d

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

File tree

1 file changed

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

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,15 @@ public function collect(\Magento\Sales\Model\Order\Creditmemo $creditmemo)
5858
$orderBaseShippingInclTax = $order->getBaseShippingInclTax();
5959
$allowedTaxAmount = $order->getShippingTaxAmount() - $order->getShippingTaxRefunded();
6060
$allowedAmountInclTax = $allowedAmount + $allowedTaxAmount;
61-
$baseAllowedAmountInclTax = $orderBaseShippingInclTax
62-
- $order->getBaseShippingRefunded()
63-
- $order->getBaseShippingTaxRefunded();
61+
$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+
}
6470

6571
// Check if the desired shipping amount to refund was specified (from invoice or another source).
6672
if ($creditmemo->hasBaseShippingAmount()) {

0 commit comments

Comments
 (0)