From 286895bcdaab4554ef59ad4d0e768bd8776d0ded Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 23 Jul 2023 22:49:41 +0200 Subject: [PATCH 1/3] Fix : set_as_client can't use prospect/customer value if disabled (#25380) --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2b233f3e0f6..8707eb5ffa8 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2135,7 +2135,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"; From d34335800693f47ef56f3100a4a1523369098da1 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 24 Jul 2023 12:38:07 +0200 Subject: [PATCH 2/3] Fix missing hyphen (#25446) --- htdocs/societe/class/societe.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8707eb5ffa8..86edd8f013f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2135,7 +2135,7 @@ class Societe extends CommonObject // phpcs:enable if ($this->id) { $newclient = 1; - if (($this->client == 2 || $this->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) + 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"; From f4cec5283aa16dc2ced8183ae41334176ac68e21 Mon Sep 17 00:00:00 2001 From: JC Prieto Date: Mon, 24 Jul 2023 19:41:00 +0200 Subject: [PATCH 3/3] FIX: Update mouvementstock.class.php (#25396) * FIX: Update mouvementstock.class.php If first character change to upper case, some external modules don't show its origin in mouvements. * Update mouvementstock.class.php More elegant. We don't need to change to upper case (line 978) and then to lower case (line 980). It is only necessary when creating a new class (line 983) The module name and url are in lower case. --- htdocs/product/stock/class/mouvementstock.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 5653a564b9e..b92f7467172 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -975,9 +975,9 @@ class MouvementStock extends CommonObject 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]) ? $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);