try to use function

This commit is contained in:
Frédéric FRANCE 2023-03-08 21:39:05 +01:00
parent e4492da46f
commit a9b9812b7e
2 changed files with 4 additions and 3 deletions

View File

@ -3960,6 +3960,7 @@ class Commande extends CommonOrder
$this->id = 0;
$this->ref = 'SPECIMEN';
$this->specimen = 1;
$this->entity = $conf->entity;
$this->socid = 1;
$this->date = time();
$this->date_lim_reglement = $this->date + 3600 * 24 * 30;

View File

@ -296,18 +296,18 @@ class pdf_eratosthene extends ModelePDFCommandes
if ($conf->commande->multidir_output[$conf->entity]) {
if (getMultidirOutput($object)) {
$object->fetch_thirdparty();
$deja_regle = 0;
// Definition of $dir and $file
if ($object->specimen) {
$dir = $conf->commande->multidir_output[$conf->entity];
$dir = getMultidirOutput($object);
$file = $dir."/SPECIMEN.pdf";
} else {
$objectref = dol_sanitizeFileName($object->ref);
$dir = $conf->commande->multidir_output[$object->entity]."/".$objectref;
$dir = getMultidirOutput($object)."/".$objectref;
$file = $dir."/".$objectref.".pdf";
}