diff --git a/htdocs/compta/paiement.php3 b/htdocs/compta/paiement.php3 index ff391e5c21b..19a43ff996e 100644 --- a/htdocs/compta/paiement.php3 +++ b/htdocs/compta/paiement.php3 @@ -175,6 +175,13 @@ if ($action == 'add') { if ($action == '') { + if ($page == -1) + { + $page = 0 ; + } + $limit = $conf->liste_limit; + $offset = $limit * $page ; + $sql = "SELECT ".$db->pdate("p.datep")." as dp, p.amount, f.amount as fa_amount, f.facnumber"; $sql .=", f.rowid as facid, c.libelle as paiement_type, p.num_paiement"; $sql .= " FROM llx_paiement as p, llx_facture as f, c_paiement as c"; @@ -186,39 +193,38 @@ if ($action == '') { } $sql .= " ORDER BY datep DESC"; + $sql .= $db->plimit( $limit ,$offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows(); - $i = 0; $total = 0; + $i = 0; + $var=True; print_barre_liste("Paiements", $page, $PHP_SELF); - print ""; + print '
'; print ''; print ""; print ""; print ""; - print ""; + print ''; print ""; print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print "\n"; - print ''; - - print ""; - $total = $total + $objp->amount; - $i++; - } - print "\n"; + while ($i < $num) + { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print ''; + print ""; + $i++; + } print "
FactureDateTypeMontantMontant 
facid\">$objp->facnumber".strftime("%d %B %Y",$objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount).' 
Total : ".price($total)."Euros HT
facid\">$objp->facnumber".strftime("%d %B %Y",$objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount).' 
"; }