diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 86fcfbea1ad..4a6a197aa79 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -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; diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 78b3fa24a33..c035b190693 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -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"; }