From 90374f77eb7fadd6f5639216605ce7c6f561dadb Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Thu, 10 Mar 2005 13:56:14 +0000 Subject: [PATCH] Nouveau fichier --- htdocs/compta/paiement/avalider.php | 117 ++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 htdocs/compta/paiement/avalider.php diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php new file mode 100644 index 00000000000..07745004286 --- /dev/null +++ b/htdocs/compta/paiement/avalider.php @@ -0,0 +1,117 @@ + + * Copyright (C) 2004-2005 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + * $Source$ + * + */ + +/** + \file htdocs/compta/paiement/avalider.php + \ingroup compta + \brief Page liste des paiements a valider des factures clients + \version $Revision$ +*/ + +require("./pre.inc.php"); + +/* + * Sécurité accés client + */ +if ($user->societe_id > 0) +{ + $action = ''; + $socidp = $user->societe_id; +} + +/* + * Affichage + */ + +llxHeader(); + +$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 .= " WHERE p.fk_paiement = c.id"; +$sql .= " AND p.statut = 0"; +$sql .= " ORDER BY $sortfield $sortorder"; +$sql .= $db->plimit( $limit +1 ,$offset); +$result = $db->query($sql); + +if ($result) +{ + $num = $db->num_rows(); + $i = 0; + $var=True; + + print_barre_liste("Paiements clients a valider", $page, "avalider.php","",$sortfield,$sortorder,'',$num); + + print ''; + print ''; + print_liste_field_titre($langs->trans("Ref"),"avalider.php","p.rowid","","","",$sortfield); + print_liste_field_titre($langs->trans("Date"),"avalider.php","dp","","","",$sortfield); + print_liste_field_titre($langs->trans("Type"),"avalider.php","c.libelle","","","",$sortfield); + print ''; + print ""; + print "\n"; + + while ($i < min($num,$limit)) + { + $objp = $db->fetch_object($result); + $var=!$var; + print ""; + print ''; + print '\n"; + print "\n"; + print ''; + print ''; + print ""; + $i++; + } + print "
'.$langs->trans("AmountTTC").' 
'.img_file().' '.$objp->rowid.''.dolibarr_print_date($objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount).''; + + if ($objp->statut == 0) + { + print 'A valider'; + } + else + { + print "-"; + } + + print '
"; +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?>