crater-invoice / crater

Open Source Invoicing Solution for Individuals & Businesses
https://craterapp.com
GNU Affero General Public License v3.0
7.85k stars 1.57k forks source link

See update in invoice #934

Open tamsir opened 2 years ago

tamsir commented 2 years ago

I have added new variables to the invoice1.blade.php file but I notice that I have to edit the invoice and save it before I can see the changes (new variables). Is there a way to refresh the invoice without editing it? Thanks for you help

mpember commented 2 years ago

There is a setting under Settings -> File Disk that enables saving PDFs to disk. This has the (dis?)advantage of any changes to the template not impacting invoices that have already been generated. If this is enabled, the PDF is being cached and the only way Crater knows to recreate it is if you edit the invoice.

Disabling the saving of PDFs should stop the contents of the PDF being cached.

tamsir commented 2 years ago

Hello, Thank you for the answer, I will test it. Finally, I found a solution to my problem. In my class I make a call to GenerateInvoicePdfJob::dispatch($invoice); and my pdf is updated with the new values of the variables that come from a webservice

mohitpanjwani commented 2 years ago

Thanks for the catch! We should fix this.