Skip to content

Commit 277bde3

Browse files
MC-22972: Credit memo without refunded shipment produces the negative Grand Total
1 parent 62c5029 commit 277bde3

File tree

1 file changed

+11
-9
lines changed
  • app/code/Magento/Sales/Test/Unit/Model/Order/Creditmemo/Total

1 file changed

+11
-9
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,18 @@ public function testCollect($orderData, $creditmemoData, $expectedResults)
100100
}
101101
$this->creditmemo->expects($this->any())
102102
->method('roundPrice')
103-
->will($this->returnCallback(
104-
function ($price, $type) use (&$roundingDelta) {
105-
if (!isset($roundingDelta[$type])) {
106-
$roundingDelta[$type] = 0;
103+
->will(
104+
$this->returnCallback(
105+
function ($price, $type) use (&$roundingDelta) {
106+
if (!isset($roundingDelta[$type])) {
107+
$roundingDelta[$type] = 0;
108+
}
109+
$roundedPrice = round($price + $roundingDelta[$type], 2);
110+
$roundingDelta[$type] = $price - $roundedPrice;
111+
return $roundedPrice;
107112
}
108-
$roundedPrice = round($price + $roundingDelta[$type], 2);
109-
$roundingDelta[$type] = $price - $roundedPrice;
110-
return $roundedPrice;
111-
}
112-
));
113+
)
114+
);
113115

114116
$this->model->collect($this->creditmemo);
115117

0 commit comments

Comments
 (0)