UPDATE for v13:
First, import the Number you want to use into another field. This could be the
invoice_payment_ref for example.
Once you are ready to set the Invoice Number from this field, create a Server Action like this:
This will set the Invoice Number so that prior to posting, you will retain your custom number:
For versions prior to v13:
The field move_name can be used to force an Invoice Number.
It is invisible by default and has the label Journal Entry Name. Expose and re-label this field for your users:
You probably also want to make this field invisible once the Invoice has
been validated and cancelled (so if you cancel, change and re-validate
it will keep the same Invoice#).
I cannot comment on the 2 first given answer. So no. I need to MANUALLY type the invoice number before I create the invoice. How could I do that?
See: https://www.youtube.com/watch?v=FhK81kDWsU8