diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 0493ffef3b0..380392c6805 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -387,7 +387,7 @@ if ($optioncss != '') $param.='&optioncss='.$optioncss; // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; - +$options = array(); if ($id > 0 || ! empty($ref)) { @@ -398,7 +398,6 @@ if ($id > 0 || ! empty($ref)) // Load bank groups require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/bankcateg.class.php'; $bankcateg = new BankCateg($db); - $options = array(); foreach ($bankcateg->fetchAll() as $bankcategory) { $options[$bankcategory->id] = $bankcategory->label; @@ -531,7 +530,6 @@ dol_syslog('compta/bank/bankentries_list.php', LOG_DEBUG); $resql = $db->query($sql); if ($resql) { - $var=True; $num = $db->num_rows($resql); $arrayofselected=is_array($toselect)?$toselect:array(); @@ -569,14 +567,12 @@ if ($resql) // Form to reconcile if ($user->rights->banque->consolidate && $action == 'reconcile') { -// print ''; -// print ''; -// print '
'; print '
'; print ''.$langs->trans("InputReceiptNumber").': '; print ''; // The only default value is value we just entered print '
'; - if ($options) { + if (is_array($options) && count($options)) + { print $langs->trans("EventualyAddCategory").': '; print Form::selectarray('cat', $options, GETPOST('cat'), 1); } @@ -629,7 +625,6 @@ if ($resql) '; } print '

'; -// print '
'; } // Form to add a transaction with no invoice @@ -663,7 +658,8 @@ if ($resql) print ''; print ''; print ''; - if (is_array($options) && count($options)) { + if (is_array($options) && count($options)) + { print '
'.$langs->trans("Rubrique").': '; print Form::selectarray('cat1', $options, GETPOST('cat1'), 1); }