diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 96cfc189c13..4547984cf9f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -499,7 +499,7 @@ if ($nolinesbefore) { if (getDolGlobalInt('PRODUCT_USE_UNITS')) { $coldisplay++; print ''; - print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units"); + print $form->selectUnits(empty($line->fk_unit) ? getDolGlobalInt('PRODUCT_USE_UNITS') : $line->fk_unit, "units"); print ''; } $remise_percent = $buyer->remise_percent; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8d664fda47f..95a40d04e12 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4231,7 +4231,7 @@ class Societe extends CommonObject public function isACompany() { // Define if third party is treated as company (or not) when nature is unknown - $isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES'); + $isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES', 1); // default if not set is 1 because it was like this in all past versions // Now try to guess using different tips if (!empty($this->tva_intra)) { @@ -4239,12 +4239,9 @@ class Societe extends CommonObject } elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { $isACompany = 1; } else { - if (!getDolGlobalString('MAIN_CUSTOMERS_ARE_COMPANIES_EVEN_IF_SET_AS_INDIVIDUAL')) { - // TODO Add a field is_a_company into dictionary - if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { + if (!getDolGlobalString('MAIN_CUSTOMERS_ARE_COMPANIES_EVEN_IF_SET_AS_INDIVIDUAL')) { // never or rarely set + if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { // TODO Add a field is_a_company into dictionary $isACompany = 0; - } else { - $isACompany = 1; } } else { $isACompany = 1;