[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/compta/ventilation/fournisseur/ -> liste.php (source)

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


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics