diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b078993e718..45a895e3287 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -261,9 +261,16 @@ class pdf_einstein extends ModelePDFCommandes $dir = $conf->commande->multidir_output[$conf->entity]; $file = $dir."/SPECIMEN.pdf"; } else { + // Possibility to use suffix for proforma + $suffix = ''; + if (!empty($conf->global->PROFORMA_PDF_WITH_SUFFIX)) { + $suffix = (GETPOST('model', 2)=='proforma') ? $conf->global->PROFORMA_PDF_WITH_SUFFIX : ''; + $suffix = dol_sanitizeFileName($suffix); + } + $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->commande->multidir_output[$object->entity]."/".$objectref; - $file = $dir."/".$objectref.".pdf"; + $file = $dir."/".$objectref.$suffix.".pdf"; } if (!file_exists($dir)) {