Adding the template name to PDF filename

Hi,

Topic: Creating proposal PDF-Documents
Situation: I do have created several pdf templates for offers (propales) which render the same content in different layouts. For example, there is on template showing detailed quantiies and the pricing and the payment conditions, another template does not show any of the commercial details but only the offered quantiries.

Currrent dolibarr behaviour: Each time when I create a pdf document based on the selected template, the existing pdf file will be overwritten.

My Intention: Keeping a PDF file for each template by adding the template name to the file name

My Question: where in the code do I find the the file name creation ?

BR
Snoman

1 Like

Thank u for the quick response!

To whom it may concern, this is what I added in line 308:

			$file = $dir . "/" . $objectref .[b] "_" . $this-\>name . [/b]".pdf";

$name carries the template name set in line 136

Of cause, this is a quick hack and w/o any chance to survive the next update but it does its job so far.

BR
snoman

1 Like