Closed
Description
Trying a simple snippet:
$this->_objectManager->create('Magento\Sales\Model\Order')->load(1);
$order->prepareInvoice()->save();
$order->save();
$order->prepareInvoice()->save();
$order->save();
In such case, prepareInvoice
generates an invoice with all items from the order. In the second run, the invoice is generated again with all items (even those that already were invoiced). The shipping amount is invoiced only in the first time.
Is this an expected behavior? I guess it should not allow to invoice more items than were ordered.