From 049beb9bf8b7c85b4c83a324e35bffe38deb3eb8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 26 Mar 2024 17:28:26 +0100 Subject: [PATCH] NEW Constant to select if typent helps define whether the thirdparty is a company --- htdocs/societe/class/societe.class.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3e42c0ddbdb..914c416c924 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4082,12 +4082,16 @@ class Societe extends CommonObject $isacompany = 1; } elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { $isacompany = 1; - } elseif (!empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') { - // TODO Add a field is_a_company into dictionary - if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { - $isacompany = 0; + } else { + if (!empty($conf->global->DEFINE_CUSTOMERS_ARE_COMPANIES_BY_TYPE_COMPANY)) { + // TODO Add a field is_a_company into dictionary + if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { + $isacompany = 0; + } else { + $isacompany = 1; + } } else { - $isacompany = 1; + $isacompany = 0; } }