diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 55be0eaba3c..228251c07c8 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -971,15 +971,17 @@ class MouvementStock extends CommonObject require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; $origin = new Inventory($this->db); break; - default: if ($origin_type) { // Separate originetype with "@" : left part is class name, right part is module name $origin_type_array = explode('@', $origin_type); - $classname = ucfirst($origin_type_array[0]); + $classname = $origin_type_array[0]; $modulename = empty($origin_type_array[1]) ? strtolower($classname) : $origin_type_array[1]; - $result = dol_include_once('/'.$modulename.'/class/'.strtolower($classname).'.class.php'); + + $result = dol_include_once('/'.$modulename.'/class/'.$classname.'.class.php'); + if ($result) { + $classname = ucfirst($classname); $origin = new $classname($this->db); } } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index bb98fbe595c..925fe16be1c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2154,7 +2154,7 @@ class Societe extends CommonObject // phpcs:enable if ($this->id) { $newclient = 1; - if ($this->client == 2 || $this->client == 3) { + if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { $newclient = 3; //If prospect, we keep prospect tag } $sql = "UPDATE ".MAIN_DB_PREFIX."societe";