Invoices and automated numbering

I use version 10.0 rc2.
Yesterday, I managed to create two invoices with different numbers for a customer. The result is that I now have two invoices (PDF) for the same order, which will give the tax advisor grey hairs later on.

My guess (I can’t quite figure it out yet): I clicked on the grey invoice icon when the order had not yet been paid. When the order was then paid (manual payment), I clicked on the icon again and ended up with a new invoice number.

It seems that the numbering is not entirely consistent. Could that be the case?

Clicking the invoice order field doesn’t generate an invoice (number) - just the PDF for the invoice already in the system. Creating an invoice is always done from a status change which, typically, should only ever be done once.

Perhaps you managed to run the status change twice?

Commerce does technically support multiple invoices per order for the purpose of doing credit invoices (in case of a partial refund) but that’s not currently exposed in the dashboard.

The numbering is always consistent but across the shop - so if the first invoice was 15 and then another order came through that would have been 16, and the next invoice on the order is 17.

(If you mean consistent with order number vs invoice number, those are two distinct IDs that don’t affect each other.)

I actually only mean the invoice number.
I don’t care about the order number for now.

I can see that the generated invoices each have a different status (Draft, Awaiting Pickup, etc.).


So, apparently I don’t yet understand the logic behind when something becomes a real invoice.

Wouldn’t it be more correct to only show the invoice button when everything has actually been completed, paid for, etc.?

Yes, normally you don’t create the invoice until the order is either paid, or in some cases even not until it has been shipped.

The “Create Invoice” status change action in Configuration > Statuses controls when the invoice is created.

OK, so I have obviously created too many invoice entries. Can I delete the invoices I have created directly in the database and recreate them correctly?
(This is acceptable for the 4 or 5 orders I have (atm).)