From 6635b334ac711ac0be25863498de5341111d22dd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2024 18:09:19 +0200 Subject: [PATCH] Debug v20 --- htdocs/compta/bank/releve.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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 ''.price($balancestart[$objp->numr], 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; @@ -397,11 +398,11 @@ $sql .= " FROM ".MAIN_DB_PREFIX."bank as b"; $sql .= " WHERE b.num_releve = '".$db->escape($objp->numr)."'"; $sql .= " AND b.fk_account = ".((int) $object->id); - $resql = $db->query($sql); - if ($resql) { - $obj = $db->fetch_object($resql); + $resqlend = $db->query($sql); + if ($resqlend) { + $obj = $db->fetch_object($resqlend); $content[$objp->numr] = $obj->amount; - $db->free($resql); + $db->free($resqlend); } print ''.price(($balancestart[$objp->numr] + $content[$objp->numr]), 0, $langs, 1, -1, -1, empty($object->currency_code) ? $conf->currency : $object->currency_code).''; @@ -413,6 +414,7 @@ print ''."\n"; } + $i++; }