diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index c0a093e7244..18dbb8f04b5 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -238,7 +238,7 @@ class FormAccounting extends Form * @param int $maxlen Max length of text in combo box * @param int $help Add or not the admin help picto * @param int $allcountries All countries - * @return string HTML component with the select + * @return void|string HTML component with the select */ public function select_accounting_category($selected = 0, $htmlname = 'account_category', $useempty = 0, $maxlen = 0, $help = 1, $allcountries = 0) { @@ -250,6 +250,8 @@ class FormAccounting extends Form exit; } + $out = ''; + if (!empty($mysoc->country_id)) { $sql = "SELECT c.rowid, c.label as type, c.range_account"; $sql .= " FROM ".$this->db->prefix()."c_accounting_category as c"; @@ -280,7 +282,7 @@ class FormAccounting extends Form if ($num) { $this->nbaccounts_category = $num; - $out = ''; $i = 0; if ($useempty) { @@ -308,7 +310,7 @@ class FormAccounting extends Form $out .= ajax_combobox($htmlname, array()); } else { - $out = ''.$langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("AccountingCategories")).''; + $out .= ''.$langs->trans("ErrorNoAccountingCategoryForThisCountry", $mysoc->country_code, $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("AccountingCategories")).''; } } else { dol_print_error($this->db);