Fix: use numbering model corresponding to the entity of the object

This commit is contained in:
Regis Houssin 2018-07-01 17:06:19 +02:00
parent 80adac12c0
commit 05c666c18b
2 changed files with 17 additions and 4 deletions

View File

@ -3347,12 +3347,19 @@ class Propal extends CommonObject
global $conf,$langs;
$langs->load("propal");
if (! empty($conf->global->PROPALE_ADDON))
$constant = 'PROPALE_ADDON_'.$this->entity;
if (! empty($conf->global->$constant)) {
$classname = $conf->global->$constant; // for multicompany proposal sharing
} else {
$classname = $conf->global->PROPALE_ADDON;
}
if (! empty($classname))
{
$mybool=false;
$file = $conf->global->PROPALE_ADDON.".php";
$classname = $conf->global->PROPALE_ADDON;
$file = $classname.".php";
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);

View File

@ -115,8 +115,14 @@ class mod_propale_saphir extends ModeleNumRefPropales
require_once DOL_DOCUMENT_ROOT .'/core/lib/functions2.lib.php';
$constant = 'PROPALE_SAPHIR_MASK_'.$propal->entity;
// On defini critere recherche compteur
$mask=$conf->global->PROPALE_SAPHIR_MASK;
if (! empty($conf->global->$constant)) {
$mask = $conf->global->$constant; // for multicompany proposal sharing
} else {
$mask = $conf->global->PROPALE_SAPHIR_MASK;
}
if (! $mask)
{