How to change an invoice number to a future one

Hello to all,
i am new to dolibarr and i would like to change manually the invoice number to another specific that is not the next but a future number.

For example the last invoice now has the number 000036 and i would like the next one to go directly to 000150. This is happened because i lost some back ups and i return to a previous state of the program.

Any help will be great, thank you.

I cant check right now but I think you’re mask should be set as {000000+150}

Once you save it should show you the next (expected) value.

Issue the invoice as usual. It will take number 000037

Then go to database , find table lix_facture and locate the record with number 000037

Edit the record to number You want, save and yo are done

DE

1 Like

For those finding this entry with Google:

You get an error like this:
#1451 - Cannot delete or update a parent row: a foreign key constraint fails (dolibarr/llx_facturedet, CONSTRAINT fk_facturedet_fk_facture FOREIGN KEY (fk_facture) REFERENCES llx_facture (rowid))
if you just try to directly manipulate the record number.

In my case, I had to copy & paste the row with the new number in the table
llx_facturedet
first and then copy & paste the row with the new number in the table
llx_facture
After this 2 copy & paste I was able to delete the old row with the “wrong/unwanted” invoice number.

If someone could show us how to modifiy it directly, that would be very helpful.