crater icon indicating copy to clipboard operation
crater copied to clipboard

See update in invoice

Open tamsir opened this issue 2 years ago • 3 comments

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

tamsir avatar May 22 '22 00:05 tamsir

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.

mpember avatar May 26 '22 16:05 mpember

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

tamsir avatar May 26 '22 17:05 tamsir

Thanks for the catch! We should fix this.

mohitpanjwani avatar Jun 08 '22 19:06 mohitpanjwani