Force existing invoice footer change

We have ran a test migration, and one of the issues we are facing is that the existing invoice footer does not change when we change it in the settings. The imported footer contains $pageNumber of $pageCount variables which are no longer used so it just displays them as is.
Is there a way to force footer change on all invoices in bulk?
As this will prevent us from using v4 to v5 redirect for existing invoices.


@daivd any thoughts?

For those still looking to change it, you should be able to do it directly via MYSQL.

Keep in mind this may kill your install!!! Make a Full backup, and then another!

  • Open up mysql sudo mysql
    then run the following:
  • USE ninjadb; #this should be the name of your invoice ninja database
  • UPDATE invoices #note that there should not be a simicolon here
  • SET footer = 'This is your new footer, it can even be multiline by pressing enter while in mysql, no need for any special carriage return/new line characters, anything between these quotes and the semicolon will replace ALL your current invoice footers';

You can do the same with quotes just replace UPDATE invoices with UPDATE quotes

Note that this is mainly for those who just migrated v4 to v5 and were using the $pageNumber of $pageCount variables in the v4 footer, unfortunately it caries over during the migration.

Please keep in mind that invoices that have PDF already generated (i.e. have been viewed) have an html template and a pdf stored on the server and will need to be edit>saved for the new footer to take.

Alternatively you should be able to set DELETE_PDF_DAYS=1 and DELETE_BACKUP_DAYS=1 in the .env file then run php artisan optimize and give it a couple of days, this should purge all generated files and will regenerate once you view them again. You might want to change the .env back to normal and run php artisan optimize again.

P.S. I’m sure @david has a much more elegant way of handling this with php artisan tinker :slight_smile:

Change directory to /public/storage in your invoiceninja directory.


find -iname ‘*.pdf’

The asterisk is wildcard to delete all cached pdfs. Insert invoice number to find the one you want to delete and it should come back in the terminal. Then use same command with -delete at the end to delete it. You can then view PDF again and it will regenerate it.

Alternatively if your shared host you can search in this folder and just delete the invoice by hand.

Yep, that’ll do it, there are also htlm backups from which the pdf was generated that might need to be deleted, not sure if the footer is stored in there or attached on the fly from the db when the pdf is generated from that html. Will take a look next time I’m poking around.