';
$moreforfilter = '';
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index aaae010c2fe..a79f01352e8 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -243,7 +243,7 @@ class FormAccounting extends Form
*
* @param string $selectid Preselected id or code of accounting accounts (depends on $select_in)
* @param string $htmlname Name of HTML field id. If name start with '.', it is name of HTML css class, so several component with same name in different forms can be used.
- * @param int $showempty Add an empty field
+ * @param int $showempty 1=Add an empty field, 2=Add an empty field+'None' field
* @param array $event Event options
* @param int $select_in 0=selectid value is a aa.rowid (default) or 1=selectid is aa.account_number
* @param int $select_out Set value returned by select. 0=rowid (default), 1=account_number
@@ -253,7 +253,7 @@ class FormAccounting extends Form
*/
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='')
{
- global $conf;
+ global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@@ -318,7 +318,12 @@ class FormAccounting extends Form
}
}
- $out .= Form::selectarray($htmlname, $options, $selected, $showempty, 0, 0, '', 0, 0, 0, '', $morecss, 1);
+ if ($showempty == 2)
+ {
+ $options['0'] = $langs->trans("None");
+ }
+
+ $out .= Form::selectarray($htmlname, $options, $selected, ($showempty > 0 ? 1 : 0), 0, 0, '', 0, 0, 0, '', $morecss, 1);
return $out;
}