Hi,
Well, that's the way it's supposed to work:
when an order is created and then cancelled, an invoice id is not generated, but if the order is created, confirmed, and then cancelled, it's normal that you get an invoice id generated and that you keep it.
if he deletes a cancelled order on the backend, the following and the previous invoices id don't change.
I recommend you to reconsider what you want.
That would mean that the previous/following orders would have a new invoice number.
Suppose I'm the guy who did the following order:
- I purchase something and I get the invoice number 15. I fill that in my accounting system.
- 2 days later, you delete the other order, and now my invoice number is 14.
But I don't know about the change, and I have in my accounting something that doesn't match what you will have on yours.
That's dangerous. You should never delete an order once it has been confirmed and that the invoice has been generated, so that the accounting can be correct.
What you're asking is probably not even legal so before you would do such change, I would advise you to discuss that with your accountant.