Skip to content

Commit

Permalink
ENGCOM-4739: Prevented /Magento/Sales/Model/Service/InvoiceService.ph…
Browse files Browse the repository at this point in the history
…p incorrectly… magento#22263
  • Loading branch information
sivaschenko authored Apr 21, 2019
2 parents 12bcddc + 17f9c95 commit 4ac8a21
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/Magento/Sales/Model/Service/InvoiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function setVoid($id)
*/
public function prepareInvoice(Order $order, array $qtys = [])
{
$isQtysEmpty = empty($qtys);
$invoice = $this->orderConverter->toInvoice($order);
$totalQty = 0;
$qtys = $this->prepareItemsQty($order, $qtys);
Expand All @@ -161,7 +162,7 @@ public function prepareInvoice(Order $order, array $qtys = [])
$qty = (double) $qtys[$orderItem->getId()];
} elseif ($orderItem->isDummy()) {
$qty = $orderItem->getQtyOrdered() ? $orderItem->getQtyOrdered() : 1;
} elseif (empty($qtys)) {
} elseif ($isQtysEmpty) {
$qty = $orderItem->getQtyToInvoice();
} else {
$qty = 0;
Expand Down

0 comments on commit 4ac8a21

Please sign in to comment.