diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index a2a86340677..855863cb4fe 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -287,21 +287,25 @@ if ($conf->facture->enabled)
print '
| Factures clients impayées ('.$num.') | Montant TTC | Reçu |
';
$var = True;
$total = $totalam = 0;
- while ($i < $num && $i < 20)
+ while ($i < $num)
{
$obj = $db->fetch_object();
- $var=!$var;
- print '| '.img_file().'';
- print ' '.$obj->facnumber.' | ';
- print ''.$obj->nom.' | ';
- print ''.price($obj->total_ttc).' | ';
- print ''.price($obj->am).' |
';
+
+ if ($i < 20)
+ {
+ $var=!$var;
+ print '| '.img_file().'';
+ print ' '.$obj->facnumber.' | ';
+ print ''.$obj->nom.' | ';
+ print ''.price($obj->total_ttc).' | ';
+ print ''.price($obj->am).' |
';
+ }
$total += $obj->total_ttc;
$totalam += $obj->am;
$i++;
}
$var=!$var;
- print '| Reste à encaisser : '.price($total-$totalam).' | '.price($total).' | '.price($totalam).' |
';
+ print '| Reste à encaisser : '.price($total-$totalam).' |
';
print "
";
}
$db->free();