Skip to content

Commit f2fd3e5

Browse files
authored
ENGCOM-7526: Resolved Cannot create shipment for remaining items #27414
2 parents 0423eae + 7aa609b commit f2fd3e5

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
@@ -232,7 +232,7 @@ public function getQtyToShip()
232232
*/
233233
public function getSimpleQtyToShip()
234234
{
235-
$qty = $this->getQtyOrdered() - $this->getQtyShipped() - $this->getQtyRefunded() - $this->getQtyCanceled();
235+
$qty = $this->getQtyOrdered() - max($this->getQtyShipped(), $this->getQtyRefunded()) - $this->getQtyCanceled();
236236
return max(round($qty, 8), 0);
237237
}
238238

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)