diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index d07eccc22e5..8a0e93a7613 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2005 Rodolphe Quiedeville * Copyright (C) 2004-2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -22,10 +22,10 @@ */ /** - \file htdocs/compta/paiement/liste.php - \ingroup compta - \brief Page liste des paiements des factures clients - \version $Revision$ + \file htdocs/compta/paiement/liste.php + \ingroup compta + \brief Page liste des paiements des factures clients + \version $Revision$ */ require("./pre.inc.php"); @@ -43,33 +43,33 @@ if ($user->societe_id > 0) * Affichage */ -llxHeader(); +llxHeader('',$langs->trans("ListPayment")); $page=$_GET["page"]; $sortorder=$_GET["sortorder"]; $sortfield=$_GET["sortfield"]; - -if ($page == -1) - $page = 0 ; - + $limit = $conf->liste_limit; $offset = $limit * $page ; if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="p.rowid"; -$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount, p.statut"; -$sql .=", c.libelle as paiement_type, p.num_paiement"; -$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as c"; +$sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount"; +$sql .=", p.statut, p.num_paiement"; +$sql .=", c.libelle as paiement_type"; +$sql .= " FROM ".MAIN_DB_PREFIX."paiement as p"; +$sql .= " , ".MAIN_DB_PREFIX."c_paiement as c"; $sql .= " WHERE p.fk_paiement = c.id"; $sql .= " ORDER BY $sortfield $sortorder"; $sql .= $db->plimit( $limit +1 ,$offset); -$result = $db->query($sql); -if ($result) +$resql = $db->query($sql); + +if ($resql) { - $num = $db->num_rows(); + $num = $db->num_rows($resql); $i = 0; $var=True; @@ -86,7 +86,7 @@ if ($result) while ($i < min($num,$limit)) { - $objp = $db->fetch_object($result); + $objp = $db->fetch_object($resql); $var=!$var; print ""; print ''.img_file().' '.$objp->rowid.''; @@ -101,11 +101,10 @@ if ($result) } else { - print "-"; + print img_tick(); } - print ''; - print ""; + print ''; $i++; } print ""; diff --git a/htdocs/compta/paiement/pre.inc.php b/htdocs/compta/paiement/pre.inc.php index 929d9d36911..dadbf61fa35 100644 --- a/htdocs/compta/paiement/pre.inc.php +++ b/htdocs/compta/paiement/pre.inc.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2005 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -21,16 +21,12 @@ * */ require("../../main.inc.php"); +$langs->load("bills"); -function llxHeader($head = "") { - global $user, $conf, $langs; +function llxHeader($head = "", $title="") { + global $user, $langs; - - /* - * - * - */ - top_menu($head); + top_menu($head, $title); $menu = new Menu(); @@ -38,7 +34,7 @@ function llxHeader($head = "") { $menu->add("rapport.php","Rapports"); - $menu->add("../facture.php",$langs->trans("Bills")); + $menu->add(DOL_URL_ROOT."/compta/facture.php",$langs->trans("Bills")); $menu->add_submenu("liste.php",$langs->trans("Payments")); $menu->add_submenu("avalider.php",$langs->trans("A valider"));