[ 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/ -> lignes.php (source)

   1  <?php
   2  /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   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.9 2005/10/19 05:12:49 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/ventilation/lignes.php,v $
  20   */
  21  
  22  /**
  23          \file       htdocs/compta/ventilation/lignes.php
  24          \ingroup    facture
  25          \brief      Page de detail des lignes de ventilation d'une facture
  26          \version    $Revision: 1.9 $
  27  */
  28  
  29  require ("./pre.inc.php");
  30  
  31  $user->getrights('facture');
  32  $user->getrights('banque');
  33  $langs->load("bills");
  34  
  35  if (!$user->rights->facture->lire) accessforbidden();
  36  if (!$user->rights->compta->ventilation->creer) accessforbidden();
  37  /*
  38   * Sécurité accés client
  39   */
  40  if ($user->societe_id > 0) accessforbidden();
  41  
  42  llxHeader('');
  43  
  44  /*
  45   * Lignes de factures
  46   *
  47   */
  48  $page = $_GET["page"];
  49  if ($page < 0) $page = 0;
  50  $limit = $conf->liste_limit;
  51  $offset = $limit * $page ;
  52  
  53  $sql = "SELECT f.facnumber, f.rowid as facid, l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.fk_code_ventilation, c.intitule, c.numero ";
  54  $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l";
  55  $sql .= " , ".MAIN_DB_PREFIX."facture as f";
  56  $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c";
  57  
  58  $sql .= " WHERE f.rowid = l.fk_facture AND f.fk_statut = 1 AND l.fk_code_ventilation <> 0 ";
  59  $sql .= " AND c.rowid = l.fk_code_ventilation";
  60  
  61  if (strlen(trim($_GET["search_facture"])))
  62  {
  63    $sql .= " AND f.facnumber like '%".$_GET["search_facture"]."%'";
  64  }
  65  
  66  $sql .= " ORDER BY l.rowid DESC";
  67  $sql .= $db->plimit($limit+1,$offset);
  68  
  69  $result = $db->query($sql);
  70  
  71  if ($result)
  72  {
  73    $num_lignes = $db->num_rows($result);
  74    $i = 0; 
  75    
  76    print_barre_liste("Lignes de facture ventilées",$page,"lignes.php","",$sortfield,$sortorder,'',$num_lignes);
  77  
  78    print '<form method="GET" action="lignes.php">';
  79    print '<table class="noborder" width="100%">';
  80    print "<tr class=\"liste_titre\"><td>Facture</td>";
  81    print '<td>'.$langs->trans("Description").'</td>';
  82    print '<td align="right">'.$langs->trans("Montant").'</td>';
  83    print '<td colspan="2" align="center">'.$langs->trans("Compte").'</td>';
  84    print "</tr>\n";
  85    
  86    print '<tr class="liste_titre"><td><input name="search_facture" size="8" value="'.$_GET["search_facture"].'"></td>';
  87    print '<td>&nbsp;</td>';
  88    print '<td align="right">&nbsp;</td>';
  89    print '<td align="center">&nbsp;</td>';
  90    print '<td align="right">';
  91    print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
  92    print '</td>';
  93    print "</tr>\n";
  94  
  95    $var=True;
  96    while ($i < min($num_lignes, $limit))
  97      {
  98        $objp = $db->fetch_object($result);
  99        $var=!$var;
 100        print "<tr $bc[$var]>";
 101        
 102        print '<td><a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$objp->facid.'">'.$objp->facnumber.'</a></td>';
 103  
 104        print '<td>'.stripslashes(nl2br($objp->description)).'</td>';
 105        print '<td align="right">'.price($objp->price).'</td>';   
 106        print '<td align="right">'.$objp->numero.'</td>';
 107        print '<td align="left">'.stripslashes($objp->intitule).'</td>';
 108  
 109        print "</tr>";
 110        $i++;
 111      }
 112  }
 113  else
 114  {
 115    print $db->error();
 116  }
 117  
 118  print "</table></form>";
 119  
 120  $db->close();
 121  
 122  llxFooter('$Date: 2005/10/19 05:12:49 $ - $Revision: 1.9 $');
 123  ?>


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