diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 68ef0a42e32aa81b5c5a2b7e0adc6b304345bc05..61941a4cefb7b176423fbd068ebc69a833392e37 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -36,10 +36,10 @@ $id=GETPOST('account');
 $ref=GETPOST('ref');
 
 // Security check
-$fieldid = (! empty($ref)?$ref:$id);
-$fieldname = isset($ref)?'ref':'rowid';
+$fieldvalue = (! empty($id) ? $id : (! empty($ref) ? $ref :''));
+$fieldtype = (! empty($ref) ? 'ref' :'rowid');
 if ($user->societe_id) $socid=$user->societe_id;
-$result=restrictedArea($user,'banque',$fieldid,'bank_account','','',$fieldname);
+$result=restrictedArea($user,'banque',$fieldvalue,'bank_account&bank_account','','',$fieldtype);
 
 $year_start=GETPOST('year_start');
 $year_current = strftime("%Y",time());
@@ -146,7 +146,7 @@ $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("B
 // Ref
 print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 print '<td colspan="3">';
-if ($_GET["account"])
+if (!empty($id))
 {
 	if (! preg_match('/,/', $id))
 	{