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

   1  <?PHP
   2  /* Copyright (C) 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: facturesrejets.php,v 1.2 2005/03/18 22:50:53 eldy Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/prelevement/facturesrejets.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  require_once DOL_DOCUMENT_ROOT."/compta/prelevement/rejet-prelevement.class.php";
  25  require_once DOL_DOCUMENT_ROOT."/paiement.class.php";
  26  
  27  
  28  /*
  29   * Sécurité accés client
  30   */
  31  if ($user->societe_id > 0) accessforbidden();
  32  
  33  llxHeader('','Bon de prélèvement - Rejet');
  34  
  35  $h = 0;
  36  $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$_GET["id"];
  37  $head[$h][1] = $langs->trans("Fiche");
  38  $h++;      
  39  
  40  $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/factures.php?id='.$_GET["id"];
  41  $head[$h][1] = $langs->trans("Factures");
  42  $h++;  
  43  
  44  $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/rejets.php?id='.$_GET["id"];
  45  $head[$h][1] = $langs->trans("Rejets");
  46  $hselected = $h;
  47  $h++;  
  48  
  49  
  50  $head[$h][0] = DOL_URL_ROOT.'/compta/prelevement/fiche-stat.php?id='.$_GET["id"];
  51  $head[$h][1] = $langs->trans("Statistiques");
  52  $h++;  
  53  
  54  $prev_id = $_GET["id"];
  55  
  56  $page = $_GET["page"];
  57  $sortorder = $_GET["sortorder"];
  58  $sortfield = $_GET["sortfield"];
  59  
  60  if ($page == -1) { $page = 0 ; }
  61  
  62  $offset = $conf->liste_limit * $page ;
  63  $pageprev = $page - 1;
  64  $pagenext = $page + 1;
  65  
  66  if ($sortorder == "") {
  67    $sortorder="DESC";
  68  }
  69  if ($sortfield == "") {
  70    $sortfield="p.datec";
  71  }
  72  
  73  /*
  74   * Liste des factures
  75   *
  76   *
  77   */
  78  $sql = "SELECT p.rowid, pf.statut, p.ref";
  79  $sql .= " ,f.rowid as facid, f.facnumber, f.total_ttc";
  80  $sql .= " , s.idp, s.nom";
  81  $sql .= " FROM ".MAIN_DB_PREFIX."prelevement as p";
  82  $sql .= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
  83  $sql .= " , ".MAIN_DB_PREFIX."facture as f";
  84  $sql .= " , ".MAIN_DB_PREFIX."societe as s";
  85  $sql .= " WHERE pf.fk_prelevement = p.rowid";
  86  $sql .= " AND f.fk_soc = s.idp";
  87  $sql .= " AND pf.fk_facture = f.rowid";
  88  $sql .= " AND pf.statut = 2 ";
  89  
  90  if ($_GET["socid"])
  91  {
  92    $sql .= " AND s.idp = ".$_GET["socid"];
  93  }
  94  
  95  $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset);
  96  
  97  $result = $db->query($sql);
  98  if ($result)
  99  {
 100    $num = $db->num_rows($result);
 101    $i = 0;
 102    
 103    print_barre_liste("Prélèvements rejetés", $page, "rejets.php", $urladd, $sortfield, $sortorder, '', $num);
 104    print"\n<!-- debut table -->\n";
 105    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
 106    print '<tr class="liste_titre">';
 107    print_liste_field_titre("Bon N°","rejets.php","p.ref",'',$urladd);
 108    print_liste_field_titre("Facture","rejets.php","p.facnumber",'',$urladd);
 109    print_liste_field_titre("Société","rejets.php","s.nom",'',$urladd);
 110    print_liste_field_titre("Montant","rejets.php","f.total_ttc","",$urladd,'align="center"');
 111    print '<td colspan="2">&nbsp;</td></tr>';
 112  
 113    $var=True;
 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 '<a href="'.DOL_URL_ROOT.'/compta/prelevement/fiche.php?id='.$obj->rowid.'">'.$obj->ref."</a></td>\n";
 124  
 125        print "<td>";
 126  
 127        print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">';
 128        print img_file();      
 129        print '</a>&nbsp;';
 130  
 131        print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
 132  
 133  
 134        print '<td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$obj->idp.'">'.stripslashes($obj->nom)."</a></td>\n";
 135  
 136        print '<td align="center">'.price($obj->total_ttc)."</td>\n";
 137  
 138        print '<td><b>Rejeté</b></td><td>';
 139  
 140        print '</td>';
 141  
 142        print "</tr>\n";
 143  
 144        $total += $obj->total_ttc;
 145        $var=!$var;
 146        $i++;
 147      }
 148  
 149    print "</table>";
 150    $db->free($result);
 151  }
 152  else 
 153  {
 154    dolibarr_print_error($db);
 155  }
 156  
 157  $db->close();
 158  
 159  llxFooter("<em>Derni&egrave;re modification $Date: 2005/03/18 22:50:53 $ r&eacute;vision $Revision: 1.2 $</em>");
 160  ?>


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