[ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com> 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * $Id: lignes.php,v 1.1 2005/10/20 19:27:19 simontosser Exp $ 19 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/ventilation/fournisseur/lignes.php,v $ 20 * 21 */ 22 23 /*! 24 \file htdocs/compta/ventilation/fournisseur/lignes.php 25 \ingroup facture 26 \brief Page de detail des lignes de ventilation d'une facture 27 \version $Revision: 1.1 $ 28 */ 29 30 require ("./pre.inc.php"); 31 32 $user->getrights('facture'); 33 $user->getrights('banque'); 34 $langs->load("bills"); 35 36 if (!$user->rights->facture->lire) accessforbidden(); 37 if (!$user->rights->compta->ventilation->creer) accessforbidden(); 38 /* 39 * Sécurité accés client 40 */ 41 if ($user->societe_id > 0) accessforbidden(); 42 43 llxHeader(''); 44 45 /* 46 * Lignes de factures 47 * 48 */ 49 $page = $_GET["page"]; 50 if ($page < 0) $page = 0; 51 $limit = $conf->liste_limit; 52 $offset = $limit * $page ; 53 54 $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.total_ttc as price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero "; 55 $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as l"; 56 $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f"; 57 $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; 58 59 $sql .= " WHERE f.rowid = l.fk_facture_fourn AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 "; 60 $sql .= " AND c.rowid = l.fk_code_ventilation"; 61 62 if (strlen(trim($_GET["search_facture"]))) 63 { 64 $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'"; 65 } 66 67 $sql .= " ORDER BY l.rowid DESC"; 68 $sql .= $db->plimit($limit+1,$offset); 69 70 $result = $db->query($sql); 71 72 if ($result) 73 { 74 $num_lignes = $db->num_rows($result); 75 $i = 0; 76 77 print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes); 78 79 print '<form method="GET" action="lignes.php">'; 80 print '<table class="noborder" width="100%">'; 81 print "<tr class=\"liste_titre\"><td>Facture</td>"; 82 print '<td>'.$langs->trans("Description").'</td>'; 83 print '<td align="right">'.$langs->trans("Montant").'</td>'; 84 print '<td colspan="2" align="center">'.$langs->trans("Compte").'</td>'; 85 print "</tr>\n"; 86 87 print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="'.$_GET["search_facture"].'"></td>'; 88 print '<td><input type="submit"></td>'; 89 print '<td align="right"> </td>'; 90 print '<td align="center"> </td>'; 91 print '<td align="center"> </td>'; 92 print "</tr>\n"; 93 94 $var=True; 95 while ($i < min($num_lignes, $limit)) 96 { 97 $objp = $db->fetch_object($result); 98 $var=!$var; 99 print "<tr $bc[$var]>"; 100 101 print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td>'; 102 103 print '<td>'.stripslashes(nl2br($objp->description)).'</td>'; 104 print '<td align="right">'.price($objp->price).'</td>'; 105 print '<td align="right">'.$objp->numero.'</td>'; 106 print '<td align="left">'.stripslashes($objp->intitule).'</td>'; 107 108 print "</tr>"; 109 $i++; 110 } 111 } 112 else 113 { 114 print $db->error(); 115 } 116 117 print "</table></form>"; 118 119 $db->close(); 120 121 llxFooter("<em>Dernière modification $Date: 2005/10/20 19:27:19 $ révision $Revision: 1.1 $</em>"); 122 ?>
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 |
![]() |