Skip to content

Resolved Cannot create shipment for remaining items #27414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 18, 2020
Merged
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/Model/Order/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public function getQtyToShip()
*/
public function getSimpleQtyToShip()
{
$qty = $this->getQtyOrdered() - $this->getQtyShipped() - $this->getQtyRefunded() - $this->getQtyCanceled();
$qty = $this->getQtyOrdered() - max($this->getQtyShipped(), $this->getQtyRefunded()) - $this->getQtyCanceled();
return max(round($qty, 8), 0);
}

Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Sales/Test/Unit/Model/Order/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public function getItemQtyVariants()
'qty_ordered' => 12, 'qty_invoiced' => 12, 'qty_refunded' => 5, 'qty_shipped' => 4,
'qty_canceled' => 0
],
'expectedResult' => ['to_ship' => 3.0, 'to_invoice' => 0.0]
'expectedResult' => ['to_ship' => 7.0, 'to_invoice' => 0.0]
],
'complete' => [
'options' => [
Expand All @@ -342,7 +342,7 @@ public function getItemQtyVariants()
'qty_ordered' => 4.4, 'qty_invoiced' => 0.4, 'qty_refunded' => 0.4, 'qty_shipped' => 4,
'qty_canceled' => 0,
],
'expectedResult' => ['to_ship' => 0.0, 'to_invoice' => 4.0]
'expectedResult' => ['to_ship' => 0.4, 'to_invoice' => 4.0]
],
'completely_invoiced_using_decimals' => [
'options' => [
Expand Down