diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php
index 4a2b0bee9bd..9c9589eaec2 100644
--- a/htdocs/adherents/subscription.php
+++ b/htdocs/adherents/subscription.php
@@ -927,7 +927,7 @@ if ($rowid > 0) {
// Bank account
print '
| '.$langs->trans("FinancialAccount").' | ';
- $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 1);
+ $form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2);
print " |
\n";
// Payment mode
diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index a1f941a2717..7218a191d1c 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -370,7 +370,7 @@ if ($action == 'create')
{
print '| ';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).' | ';
- $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant
+ $form->select_comptes($accountid, "accountid", 0, '', 2); // Affiche liste des comptes courant
print ' |
';
}
diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php
index 5a4e34492a7..b787878f31d 100644
--- a/htdocs/compta/localtax/card.php
+++ b/htdocs/compta/localtax/card.php
@@ -178,7 +178,7 @@ if ($action == 'create')
if (!empty($conf->banque->enabled))
{
print '| '.$langs->trans("Account").' | ';
- $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant
+ $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 2); // Affiche liste des comptes courant
print ' |
';
print '| '.$langs->trans("PaymentMode").' | ';
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 6e2c068c08a..17970037b4a 100644
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -236,7 +236,7 @@ if ($action == 'create')
print ' |
';
print '| '.$langs->trans('AccountToDebit').' | ';
print '';
- $form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $charge->accountid, "accountid", 0, '', 1); // Show opend bank account list
+ $form->select_comptes(isset($_POST["accountid"]) ? $_POST["accountid"] : $charge->accountid, "accountid", 0, '', 2); // Show opend bank account list
print ' |
';
// Number
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index b24820e21e4..98131687cb1 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -370,7 +370,7 @@ if ($action == 'create')
if (!empty($conf->banque->enabled))
{
print '| '.$langs->trans('BankAccount').' | ';
- $form->select_comptes($fk_account, 'fk_account', 0, '', 1);
+ $form->select_comptes($fk_account, 'fk_account', 0, '', 2);
print ' |
';
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3f24bc6a38f..f28ad165453 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3901,7 +3901,7 @@ class Form
while ($i < $num)
{
$obj = $this->db->fetch_object($result);
- if ($selected == $obj->rowid)
+ if ($selected == $obj->rowid || ($useempty == 2 && $num == 1 && empty($selected)))
{
print '