diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 88dd1c317f2..327298a033d 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -254,7 +254,7 @@ if (($action == 'searchfiles' || $action == 'dl')) { if(!empty($projectid)) $sql .= " AND fk_projet = ".$db->sanitize($projectid); } // Loan payments - if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms']) and empty($projectid)) { + if (GETPOST('selectloanspayment') && !empty($listofchoices['selectloanspayment']['perms']) && empty($projectid)) { if (!empty($sql)) { $sql .= " UNION ALL"; }