"Liberate" Series of transaction numbers that have been cancelled

"Liberate" Series of transaction numbers that have been cancelled

In my country, it is mandatory to use numeration on each invoice that is generated.

Let's say I have got A001, A002, A003 and A004 invoices.

If for some reason I have to repeat an invoice because the employee sent the price wrong, I proceed the following way. Invoice -> Cancelled. Create a new invoice with the corrected price. Is this the right thing to do? There is also the alternative option of editing invoices, but I feel it is even worse.

Let's say I go with the cancel Invoice method. I cancel "A002". On the new invoice it will autopopulate the numeration field with the new invoice number "A005" instead of the one that is no longer used "A002". How can I make the automation so that it used "A002" instead of "A005". As country regulations, I can not skip the numeration.

Right now we are writing down the numerations that are cancelled so we can use them on the next invoices, but this seems like a pretty bad way of doing it. 

I would appreciate any recommendation.