Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Third party informations are not loaded when generating PDF from ODT in recurring invoice (via CRON only) #12395
When running the CRON job to create the reccuring invoices (not affecting if you manually issue an invoice from a template via the web GUI).
If the reccuring invoice template uses as document template an ODT template (no issue if you use the crabe included PDF template) AND if you set the invoice template to save the invoice as DRAFT (not auto-validated) :
The third party name, address, and other informations are not loaded properly before document generation.
So on your generated PDF document you see no customer name, address, phone, VAT ID, etc... you have to manually regenerate the PDF afterwards from the invoice card...
This does not affect the invoices if you set the invoice template to auto-validate the generated invoices (status "to be paid").
Expected and actual behavior
The third party informations should be present in the object before the PDF document generation.
Steps to reproduce the behavior
I have the solution but sorry I'm not used to GitHub yet so i could not make a pull request properly.
File : /htdocs/compta/facture/class/facture-rec.class.php (around line 1171)
modify as follows :
Indeed, the instruction
However, tt is implicitely called in the
This will also call the function to load the third party informations in the invoice object even if you keep it as draft. So that your draft document is properly made with the third party informations.
@eldy : Can you please create a pull request by yourself to insert this fix in the code of the future releases ? I promise I will learn to better use GitHub in the near future :)