Skip to content

Commit 9db0072

Browse files
committed
ACP2E-2756: [Cloud] Order Status changed to complete when partially refund of a partially shipped order
1 parent 193849a commit 9db0072

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/code/Magento/Sales/Model/Order/Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public function getQtyToShip()
234234
*/
235235
public function getSimpleQtyToShip()
236236
{
237-
$qty = $this->getQtyOrdered() - $this->getQtyShipped() - $this->getQtyRefunded() - $this->getQtyCanceled();
237+
$qty = $this->getQtyOrdered() - max($this->getQtyShipped(), $this->getQtyRefunded()) - $this->getQtyCanceled();
238238
return max(round($qty, 8), 0);
239239
}
240240

app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public function getItemQtyVariants()
321321
'qty_ordered' => 12, 'qty_invoiced' => 12, 'qty_refunded' => 5, 'qty_shipped' => 4,
322322
'qty_canceled' => 0
323323
],
324-
'expectedResult' => ['to_ship' => 3.0, 'to_invoice' => 0.0]
324+
'expectedResult' => ['to_ship' => 7.0, 'to_invoice' => 0.0]
325325
],
326326
'complete' => [
327327
'options' => [
@@ -342,7 +342,7 @@ public function getItemQtyVariants()
342342
'qty_ordered' => 4.4, 'qty_invoiced' => 0.4, 'qty_refunded' => 0.4, 'qty_shipped' => 4,
343343
'qty_canceled' => 0,
344344
],
345-
'expectedResult' => ['to_ship' => 0.0, 'to_invoice' => 4.0]
345+
'expectedResult' => ['to_ship' => 0.4, 'to_invoice' => 4.0]
346346
],
347347
'completely_invoiced_using_decimals' => [
348348
'options' => [

0 commit comments

Comments
 (0)