[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 * 19 * $Id: avalider.php,v 1.4 2005/11/19 02:38:29 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/paiement/avalider.php,v $ 21 */ 22 23 /** 24 \file htdocs/compta/paiement/avalider.php 25 \ingroup compta 26 \brief Page liste des paiements a valider des factures clients 27 \version $Revision: 1.4 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $user->getrights("facture"); 33 34 $langs->load("bills"); 35 36 // Sécurité accés client 37 if (! $user->rights->facture->lire) 38 accessforbidden(); 39 40 $socidp=0; 41 if ($user->societe_id > 0) 42 { 43 $action = ''; 44 $socidp = $user->societe_id; 45 } 46 47 48 /* 49 * Affichage 50 */ 51 52 llxHeader(); 53 54 $page=$_GET["page"]; 55 $sortorder=$_GET["sortorder"]; 56 $sortfield=$_GET["sortfield"]; 57 if (! $sortorder) $sortorder="DESC"; 58 if (! $sortfield) $sortfield="p.rowid"; 59 if ($page == -1) $page = 0 ; 60 $limit = $conf->liste_limit; 61 $offset = $limit * $page ; 62 63 $sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount, p.statut"; 64 $sql .=", c.libelle as paiement_type, p.num_paiement"; 65 $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."c_paiement as c"; 66 if ($socidp) 67 { 68 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; 69 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; 70 } 71 $sql .= " WHERE p.fk_paiement = c.id"; 72 if ($socidp) 73 { 74 $sql.= " AND f.fk_soc = ".$socidp; 75 } 76 $sql .= " AND p.statut = 0"; 77 $sql .= " ORDER BY $sortfield $sortorder"; 78 $sql .= $db->plimit( $limit +1 ,$offset); 79 $resql = $db->query($sql); 80 81 if ($resql) 82 { 83 $num = $db->num_rows($resql); 84 $i = 0; 85 $var=True; 86 87 print_barre_liste($langs->trans("ReceivedCustomersPaymentsToValid"), $page, "avalider.php","",$sortfield,$sortorder,'',$num); 88 89 print '<table class="noborder" width="100%">'; 90 print '<tr class="liste_titre">'; 91 print_liste_field_titre($langs->trans("Ref"),"avalider.php","p.rowid","","",'width="60"',$sortfield); 92 print_liste_field_titre($langs->trans("Date"),"avalider.php","dp","","",'width="80" align="center"',$sortfield); 93 print_liste_field_titre($langs->trans("Type"),"avalider.php","c.libelle","","","",$sortfield); 94 print_liste_field_titre($langs->trans("AmountTTC"),"avalider.php","c.libelle","","",'align="right"',$sortfield); 95 print "<td> </td>"; 96 print "</tr>\n"; 97 98 while ($i < min($num,$limit)) 99 { 100 $objp = $db->fetch_object($resql); 101 $var=!$var; 102 print "<tr $bc[$var]>"; 103 print '<td>'.'<a href="'.DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.'</a></td>'; 104 print '<td width="80" align="center">'.dolibarr_print_date($objp->dp)."</td>\n"; 105 print "<td>$objp->paiement_type $objp->num_paiement</td>\n"; 106 print '<td align="right">'.price($objp->amount).'</td>'; 107 print '<td align="center">'; 108 109 if ($objp->statut == 0) 110 { 111 print '<a href="fiche.php?id='.$objp->rowid.'&action=valide">'.$langs->trans("PaymentStatusToValidShort").'</a>'; 112 } 113 else 114 { 115 print "-"; 116 } 117 118 print '</td>'; 119 print "</tr>"; 120 $i++; 121 } 122 print "</table>"; 123 } 124 125 $db->close(); 126 127 llxFooter('$Date: 2005/11/19 02:38:29 $ - $Revision: 1.4 $'); 128 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |