Skip to content

Commit b8bdc38

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

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total/ShippingTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ public function testCollectRefundShippingAmountIncTax()
426426
$expectedShippingAmountInclTax = $allowedShippingAmount + $shippingTaxAmount - $shippingTaxAmountRefunded;
427427
$expectedBaseShippingAmountInclTax =
428428
$baseAllowedShippingAmount + $baseShippingTaxAmount - $baseShippingTaxAmountRefunded;
429+
$expectedBaseShippingAmountInclTax = max($expectedBaseShippingAmountInclTax, 0);
429430
$grandTotalBefore = 14.35;
430431
$baseGrandTotalBefore = 14.35;
431432
$expectedGrandTotal = $grandTotalBefore + $allowedShippingAmount;
@@ -476,7 +477,7 @@ public function testCollectRefundShippingAmountIncTax()
476477
->willReturnSelf();
477478
$this->creditmemoMock->expects($this->once())
478479
->method('setBaseShippingInclTax')
479-
->with($this->shippingCollector->getBaseAllowedAmountInclTax($expectedBaseShippingAmountInclTax))
480+
->with($expectedBaseShippingAmountInclTax)
480481
->willReturnSelf();
481482
$this->creditmemoMock->expects($this->once())
482483
->method('setGrandTotal')
@@ -486,10 +487,6 @@ public function testCollectRefundShippingAmountIncTax()
486487
->method('setBaseGrandTotal')
487488
->with($expectedBaseGrandTotal)
488489
->willReturnSelf();
489-
$this->assertEquals(
490-
0,
491-
$this->shippingCollector->getBaseAllowedAmountInclTax($expectedBaseShippingAmountInclTax)
492-
);
493490
$this->shippingCollector->collect($this->creditmemoMock);
494491
}
495492
}

0 commit comments

Comments
 (0)