diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index 7911ff8406c35..a6c5f9becb5d6 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -360,7 +360,8 @@ $balancestart = array(); $content = array(); - while ($i < min($numrows, $conf->liste_limit)) { + $max = min($numrows, $conf->liste_limit); + while ($i < $max) { $objp = $db->fetch_object($resql); if (!isset($objp->numr)) { @@ -384,11 +385,11 @@ $sql .= " WHERE b.num_releve < '".$db->escape($objp->numr)."'"; $sql .= " AND b.num_releve <> ''"; $sql .= " AND b.fk_account = ".((int) $object->id); - $resql = $db->query($sql); - if ($resql) { - $obj = $db->fetch_object($resql); + $resqlstart = $db->query($sql); + if ($resqlstart) { + $obj = $db->fetch_object($resqlstart); $balancestart[$objp->numr] = $obj->amount; - $db->free($resql); + $db->free($resqlstart); } print '