Skip to content

Commit 50e4675

Browse files
committed
MAGETWO-99371: Wrong calculation of invoiced items
1 parent 339feb1 commit 50e4675

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/code/Magento/Sales/Model/Service/InvoiceService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@ public function prepareInvoice(
182182
}
183183

184184
/**
185-
* Prepare qty to invoice for parent and child products
186-
* if theirs qty is not specified in initial request.
185+
* Prepare qty to invoice for parent and child products if theirs qty is not specified in initial request.
187186
*
188187
* @param Order $order
189188
* @param array $orderItemsQtyToInvoice
@@ -200,7 +199,8 @@ private function prepareItemsQty(
200199
}
201200
} else {
202201
if (isset($orderItemsQtyToInvoice[$orderItem->getParentItemId()])) {
203-
$orderItemsQtyToInvoice[$orderItem->getId()] = $orderItemsQtyToInvoice[$orderItem->getParentItemId()];
202+
$orderItemsQtyToInvoice[$orderItem->getId()] =
203+
$orderItemsQtyToInvoice[$orderItem->getParentItemId()];
204204
}
205205
}
206206
}

dev/tests/integration/testsuite/Magento/Sales/Model/Service/InvoiceServiceTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ public function testPrepareInvoiceBundleProduct(
105105
array $qtyToInvoice,
106106
array $qtyInvoiced,
107107
string $errorMsg
108-
): void
109-
{
108+
): void {
110109
/** @var Order $order */
111110
$order = Bootstrap::getObjectManager()->create(Order::class)
112111
->load('100000001', 'increment_id');

0 commit comments

Comments
 (0)