select the only bank account

When there is only one bank account in the dropdown of the bank account,
select it by default.

[see: #11878]
This commit is contained in:
Laurent De Coninck 2020-10-17 20:45:37 +02:00
parent e3552e7e02
commit cea7fd6894
No known key found for this signature in database
GPG Key ID: 2BA964D76BB3A499

View File

@ -3880,7 +3880,7 @@ class Form
while ($i < $num) while ($i < $num)
{ {
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
if ($selected == $obj->rowid) if ($selected == $obj->rowid || ($num === 1 && empty($selected)))
{ {
print '<option value="'.$obj->rowid.'" selected>'; print '<option value="'.$obj->rowid.'" selected>';
} else { } else {