[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?PHP 2 /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 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: liste_factures.php,v 1.7 2005/09/10 14:41:53 eldy Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/prelevement/liste_factures.php,v $ 21 */ 22 23 /** 24 \file htdocs/compta/prelevement/liste_factures.php 25 \ingroup prelevement 26 \brief Page liste des factures prélevées 27 \version $Revision: 1.7 $ 28 */ 29 30 require ("./pre.inc.php"); 31 require_once(DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php"); 32 require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); 33 34 // Sécurité accés client 35 if ($user->societe_id > 0) accessforbidden(); 36 37 38 llxHeader('',$langs->trans("WithdrawedBills")); 39 40 $page = $_GET["page"]; 41 $sortorder = (empty($_GET["sortorder"])) ? "DESC" : $_GET["sortorder"]; 42 $sortfield = (empty($_GET["sortfield"])) ? "p.datec" : $_GET["sortfield"]; 43 $offset = $conf->liste_limit * $page ; 44 45 /* 46 * Liste des factures 47 * 48 * 49 */ 50 $sql = "SELECT p.rowid, p.ref, p.statut"; 51 $sql .= " ,f.rowid as facid, f.facnumber, f.total_ttc"; 52 $sql .= " , s.idp, s.nom"; 53 $sql .= " , pl.statut as statut_ligne, pl.rowid as rowid_ligne"; 54 $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; 55 $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl"; 56 $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf"; 57 $sql .= " , ".MAIN_DB_PREFIX."facture as f"; 58 $sql .= " , ".MAIN_DB_PREFIX."societe as s"; 59 $sql .= " WHERE pf.fk_prelevement_lignes = pl.rowid"; 60 $sql .= " AND pl.fk_prelevement_bons = p.rowid"; 61 $sql .= " AND f.fk_soc = s.idp"; 62 $sql .= " AND pf.fk_facture = f.rowid"; 63 64 if ($_GET["socid"]) 65 { 66 $sql .= " AND s.idp = ".$_GET["socid"]; 67 } 68 69 if ($_GET["search_fac"]) 70 { 71 $sql .= " AND f.facnumber like '%".$_GET["search_fac"]."%'"; 72 } 73 74 if ($_GET["search_nom"]) 75 { 76 $sql .= " AND s.nom like '%".$_GET["search_nom"]."%'"; 77 } 78 79 $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); 80 81 $result = $db->query($sql); 82 83 if ($result) 84 { 85 $num = $db->num_rows($result); 86 $i = 0; 87 88 $urladd = "&socid=".$_GET["socid"]; 89 90 print_barre_liste($langs->trans("WithdrawedBills"), $page, "liste_factures.php", $urladd, $sortfield, $sortorder, '', $num); 91 92 print"\n<!-- debut table -->\n"; 93 print '<table class="liste" width="100%">'; 94 print '<tr class="liste_titre">'; 95 print '<td class="liste_titre">'.$langs->trans("Line").'</td>'; 96 print_liste_field_titre($langs->trans("Bill"),"liste_factures.php","f.facnumber",'',$urladd); 97 print_liste_field_titre($langs->trans("Company"),"liste_factures.php","s.nom",'',$urladd); 98 print_liste_field_titre($langs->trans("Amount"),"liste_factures.php","f.total_ttc","",$urladd,'align="right"'); 99 print_liste_field_titre($langs->trans("WithdrawalReceipt"),"liste_factures.php","p.rowid","",$urladd,'align="center"'); 100 print '</tr>'; 101 102 print '<form method="get" action="liste_factures.php">'; 103 print '<tr class="liste_titre"><td class="liste_titre"> </td>'; 104 print '<td class="liste_titre">'; 105 print '<input size="8" class="flat" type="text" name="search_fac" value="'.$_GET["search_fac"].'">'; 106 print '</td><td class="liste_titre">'; 107 print '<input size="20" class="flat" type="text" name="search_nom" value="'.stripslashes($_GET["search_nom"]).'">'; 108 print '</td>'; 109 print '<td class="liste_titre" colspan="2" align="right"><input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" alt="'.$langs->trans("Search").'"></td>'; 110 print "</tr>\n"; 111 print '</form>'; 112 113 $var=false; 114 115 $total = 0; 116 117 while ($i < min($num,$conf->liste_limit)) 118 { 119 $obj = $db->fetch_object($result); 120 121 print "<tr $bc[$var]><td>"; 122 123 print '<img border="0" src="./statut'.$obj->statut_ligne.'.png"></a> '; 124 125 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/ligne.php?id='.$obj->rowid_ligne.'">'; 126 print substr('000000'.$obj->rowid_ligne, -6).'</a></td>'; 127 128 print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'; 129 print img_object($langs->trans("ShowBill"),"bill"); 130 print '</a> '; 131 132 print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n"; 133 134 print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'; 135 print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n"; 136 137 print '<td align="right">'.price($obj->total_ttc)."</td>\n"; 138 139 print '<td align="center">'; 140 print '<img border="0" src="./statut'.$obj->statut.'.png"></a> '; 141 print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$obj->rowid.'">'; 142 print $obj->ref."</a></td>\n"; 143 144 print '</tr>'; 145 146 $total += $obj->total_ttc; 147 $var=!$var; 148 $i++; 149 } 150 151 print "</table>"; 152 $db->free($result); 153 } 154 else 155 { 156 dolibarr_print_error($db); 157 } 158 159 $db->close(); 160 161 llxFooter('$Date: 2005/09/10 14:41:53 $ - $Revision: 1.7 $'); 162 ?>
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 |
![]() |