Skip to content

Prevent second invoice creation when order is fully invoiced #6

@dudzio12

Description

@dudzio12

I have an issue with two invoices inside one order.
The first one created is correct - it invoiced two items and shipping amount.
The second one invoiced same two items, but without shipping amount.

In the result of this, total_due in order is the amount of shipping amount. (total_paid does not include shipping amount).

The second invoice was created 1 minute after first one.

In the first try of PayU request, Magento returned error 500 with deadlock found in Magento DB, but the invoice was created correctly.

The second try was fully successfull, but it duplicated the invoice as described above.

To fix this issue, you should add canInvoice method to prevent duplicate invoice creation and if the invoice is already created - use that one to finish request. Magento should also prevent from invoicing same items.

I'm working on this now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions