Skip to content

Commit

Permalink
Prevented /Magento/Sales/Model/Service/InvoiceService.php incorrectly…
Browse files Browse the repository at this point in the history
… discarding simple items when bundle items are mixed in a call to prepareInvoice without any qtys specified

Renamed emptyQtys to isQtysEmpty
  • Loading branch information
ryanpalmerweb committed Apr 10, 2019
1 parent ab188bc commit ec2c6ca
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 ec2c6ca

Please sign in to comment.