diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6a232bb47f5..58485c3c15d 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3996,20 +3996,20 @@ class Societe extends CommonObject public function isACompany() { // Define if third party is treated as company (or not) when nature is unknown - $isACompany = !getDolGlobalString('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES') ? false : true; + $isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES'); if (!empty($this->tva_intra)) { - $isACompany = true; + $isACompany = 1; } elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { - $isACompany = true; + $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 = false; + $isACompany = 0; } else { - $isACompany = true; + $isACompany = 1; } } - return $isACompany; + return boolval($isACompany); } /**