NEW Constant to select if typent helps define whether the thirdparty is a company

This commit is contained in:
Alexandre SPANGARO 2024-03-26 17:28:26 +01:00
parent 70471186ed
commit 049beb9bf8

View file

@ -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;
}
}