To delete an erroneously issued invoice, navigate to Tax Management → Invoices / Credit Notes:
Then click the "Menu" on the line of the invoice in question and below choose the option "Remove invoice/credit note":
Following the deletion of the invoice, it will be automatically disconnected from the order and payments, thus allowing it to be reissued.
Deleting an Invoice with recorded payments
CAUTION: In the event that the invoice is fully or partially paid, and the payment was recorded by it after it was issued, the option to delete it will not be present in the menu, since it will be necessary to first delete the recording of the payment.
From the invoice line then in this case click the Menu key and then the option "Invoice details and payments":
Now, from the next screen, go down to the bottom and click the trash icon next to the payment recorded as received.
As a result of this operation, the invoice will be deletable and from its menu the option to remove it will be possible.
Recovering numbering holes
The simplest case is when you need to delete the last invoice issued; in fact, in this case, following the deletion of the invoice, the system will will automatically roll back the numbering by one, to avoid skipping numbers and creating holes in the progressive numbering.
In case, on the other hand, you have deleted a previously issued invoice thus going to create a hole in the sequential numbering, the system will will highlight it at the top of the screen, indicating number and date of issue of the deleted invoices.
Subsequent to deleting an invoice that is not the last one, the system will then allow the number of any invoice issued to be changed to the number of the deleted invoice (for example, I can delete a central invoice because it was issued incorrectly, thus creating a hole in the sequential numbering, issue a new invoice, and then change its number using that of the deleted invoice).
Then to change the number of an invoice, click the icon next to its sequence number, choose from the drop-down menu next to it the number of the deleted invoice (the system will show the numbers of all deleted invoices) and click the save icon.
From the next window you will also be able to check the checkbox to use not only the number but also the issue date of the deleted invoice, replacing it with the issue date of the invoice you are editing.
Click the "Continue" to end the operation.