Fix var not defined

This commit is contained in:
Laurent Destailleur 2018-10-15 13:30:07 +02:00
parent cca87f3d5a
commit df4b3b09d2

View File

@ -4116,18 +4116,18 @@ class Facture extends CommonInvoice
$langs->load("bills");
if (! dol_strlen($modele)) {
if (! dol_strlen($modele))
{
$modele = 'crabe';
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$this->type;
$modele = 'crabe';
$thisTypeConfName = 'FACTURE_ADDON_PDF_'.$type;
if ($this->modelpdf) {
$modele = $this->modelpdf;
}elseif (! empty($conf->global->{'FACTURE_ADDON_PDF_'.$this->type})){
$modele = $conf->global->{'FACTURE_ADDON_PDF_'.$this->type} ;
}elseif (! empty($conf->global->FACTURE_ADDON_PDF)) {
$modele = $conf->global->FACTURE_ADDON_PDF;
}
if ($this->modelpdf) {
$modele = $this->modelpdf;
} elseif (! empty($conf->global->$thisTypeConfName)) {
$modele = $conf->global->$thisTypeConfName;
} elseif (! empty($conf->global->FACTURE_ADDON_PDF)) {
$modele = $conf->global->FACTURE_ADDON_PDF;
}
}
$modelpath = "core/modules/facture/doc/";