[ 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/telephonie/script/ -> pdfdetail.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004 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   * Régénère les factures détaillées pour un mois précis
  19   *
  20   */
  21  require  ("../../master.inc.php");
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
  24  require_once DOL_DOCUMENT_ROOT."/facture.class.php";
  25  require_once DOL_DOCUMENT_ROOT."/telephonie/facturetel.class.php";
  26  require_once DOL_DOCUMENT_ROOT."/telephonie/pdfdetail_ibreizh.modules.php";
  27  
  28  /*
  29   * Regénération de la facture détaillée
  30   */
  31  
  32  $year = "2005";
  33  $month = "01";
  34  
  35  $sql = "SELECT rowid, fk_facture ";
  36  $sql .= " FROM llx_telephonie_facture";
  37  $sql .= " WHERE date_format(date, '%Y%m') = '".$year.$month."'";
  38  
  39  $result = $db->query($sql);
  40  
  41  if ($result)
  42  {
  43    $num = $db->num_rows();
  44    $i = 0;
  45    $message = "";  
  46    while ($i < $num)
  47      {
  48        $row = $db->fetch_row();
  49  
  50        $facid = $row[1];
  51        $factel_id = $row[0];
  52  
  53        $factel = new FactureTel($db);
  54        if ($factel->fetch($factel_id) == 0)
  55      {
  56        $ligne = new LigneTel($db);
  57        if ($ligne->fetch($factel->ligne) == 1)              
  58          {
  59            $facdet = new pdfdetail_ibreizh($db, $ligne->numero, $year, $month, $factel);
  60            
  61            if (! $facdet->write_pdf_file($facid, $ligne->numero))
  62          {
  63            print "- ERREUR lors de Génération du pdf détaillé\n";
  64            $error = 19;
  65          }                      
  66            else
  67          {
  68            print "Génération du pdf détaillé ligne ".$ligne->numero."\n";
  69          }
  70          }      
  71      }
  72        $i++;
  73      }
  74  }
  75  
  76  $db->close();
  77  
  78  ?>


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