Updates Do Not Update Invoices

I’ve noticed that when I update settings, such as Address (I changed my address recently), that the invoices that are already created will not update on the downloaded invoice. It shows the updated information in the preview, but when I download the invoice, it has the old information in. This also includes Invoice Date and Due Date. I have been having to “Clone to Invoice” to have it create a new Invoice with the new info. This is sort of a pain to do every time and sometimes I forget and send out an invoice with a Due Date that is already past. Not very professional. Anyone have a clue on how to fix this? (This has been happening for quite some time)

Invoice Ninja v5.5.8-C90
Invoice Ninja Hosted PDF (I am unable to use SnapPDF due to security)

Hi,

I believe if you resave the invoice it will update the PDF.

@david any thoughts on this, can the PDF cache be disabled?

Hi Hillel,

Thanks for the response. I have tried to save it with the updated changes and it shows correctly on the preview. It does not change when I download the PDF. There is some sort of PDF caching going on. I just can’t figure out how to turn it off or clear that cache.

I was able to get it to work. Not sure how. I did a download from the preview on the Edit Invoice (saves as “download.pdf” with a Live Preview invoice number I don’t want) and I did a download from “View Invoice” (both had the old address still) and then when I went back into Edit Invoice, I clicked the “Download” button and the address was updated. It’s super wonky.

I just updated the “Quantity” and tried to download the PDF from the “Download” button on Edit Invoice and it again did not update the invoice on the downloaded PDF. I have clicked on the “Save” button before trying the download and still has the old Quantity. Frustrating.

What is the queue set to in the .env file?

If changing it to sync helps it may indicate a problem processing the jobs.

QUEUE_CONNECTION=database

You may need to add the queue:work cron

Ok. Thanks for the information! I appreciate your help. So, I’m thinking it just doesn’t update instantly. I pulled an old invoice from June 5 and changed the date to today. I changed the date, saved, downloaded it and still June 5 (Preview shows July 31). I went back to Invoices and clicked back in and downloaded, still June 5 (Preview shows July 31). I clicked the Refresh Data, on the bottom right of the Invoices page and went back in, Preview shows July 31. Download shows July 31. So maybe my CRON is just taking too long to update it. I didn’t see that Refresh Data button before, but that seems to be helpful in fixing my issue.

I take that back – the Refresh Data button didn’t do anything. Seems to be a Cron deal. Probably just have to wait for a minute for the Cron to run.

Cron:
* * * * * cd /*PATH REDACTED* && php artisan schedule:run >> /dev/null 2>&1

Since the queue is enabled you’ll also need the queue:work cron, or you can disable the queue by setting it to sync.

Do I just add that to the ENV file? Can you give me an example? Thanks for your help!

queue:work is a separate cron, it’s explained in the docs linked above

In the latest version of the application we now generate PDFs on demand.

I can see you are still on 5.5xx you’ll want to update to the latest version.