Skip to content

Two invoices to the entire order #1464

Closed
@kassner

Description

@kassner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Format is not validGate 1 Failed. Automatic verification of issue format is failedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentbug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions