diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index e75a6c80232..c135b25c1a5 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -168,7 +168,7 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->glo $fac->fetch($_GET['facid']); // On vérifie si la facture a des paiements - $sql = 'SELECT pf.amount,'; + $sql = 'SELECT pf.amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf'; $sql.= ' WHERE pf.fk_facture = '.$fac->id; @@ -176,6 +176,9 @@ if ($_GET['action'] == 'modif' && $user->rights->facture->modifier && $conf->glo if ($result) { + $i = 0; + $num = $db->num_rows($result); + while ($i < $num) { $objp = $db->fetch_object($result);