You can edit Invoice number for a order only if it is in Received state.

To edit invoice number, Please go to Received order section. Look for your order, click on Print Icon. Here you would see an option to edit Invoice number. Edit the invoice number and go ahead the print the Invoice.