From 32bd194f8e58fa78fbf124bd277e69976463dc9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 15 Jan 2021 17:47:14 +0100 Subject: [PATCH] Sort array --- htdocs/accountancy/bookkeeping/card.php | 2 +- htdocs/core/class/html.formaccounting.class.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 21077dececd..f4212e2702e 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -685,7 +685,7 @@ if ($action == 'create') // It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases. // Also, it is not possible to use a value that is not in the list. // Also, the label is not automatically filled when a value is selected. - if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { + if (empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) { print $formaccounting->select_auxaccount('', 'subledger_account', 1); } else { print ''; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 002899c079d..b95f73506b9 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -435,7 +435,7 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth200') + public function select_auxaccount($selectid, $htmlname = 'account_num_aux', $showempty = 0, $morecss = 'maxwidth250') { // phpcs:enable @@ -463,6 +463,9 @@ class FormAccounting extends Form dol_syslog(get_class($this)."::select_auxaccount ".$this->error, LOG_ERR); return -1; } + + ksort($aux_account); + $this->db->free($resql); // Auxiliary user account