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

   1  <?php
   2  /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004      Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: index.php,v 1.7 2005/10/18 14:19:16 simontosser Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/export/index.php,v $
  21   *
  22   */
  23  
  24  /*!
  25    \file       htdocs/compta/export/index.php
  26    \ingroup    compta
  27    \brief      Page accueil zone export compta
  28    \version    $Revision: 1.7 $
  29  */
  30  
  31  require ("./pre.inc.php");
  32  
  33  require ("./ComptaJournalPaiement.class.php");
  34  require ("./ComptaJournalVente.class.php");
  35  
  36  if ($_GET["action"] == 'export')
  37  {
  38    include_once DOL_DOCUMENT_ROOT.'/compta/export/modules/compta.export.class.php';
  39  
  40    $exc = new ComptaExport($db, $user, 'Poivre');
  41  
  42    if($_GET["id"] > 0)
  43      {
  44        $exc->Export($_GET["id"]);
  45      }
  46    else
  47      {
  48        $exc->Export();
  49      }
  50  
  51    print $exc->error_message;
  52  
  53    /* Génération du journal des Paiements */
  54  
  55    $jp= new ComptaJournalPaiement($db);
  56    $jp->GeneratePdf($user, $exc->id, $exc->ref);
  57  
  58    /* Génération du journal des Ventes */
  59  
  60    $jp= new ComptaJournalVente($db);
  61    $jp->GeneratePdf($user, $exc->id, $exc->ref);
  62  }
  63  
  64  llxHeader('','Compta - Export');
  65  
  66  print_titre("Export Comptable");
  67  
  68  print '<table border="0" width="100%" cellspacing="4">';
  69  print '<tr><td valign="top" width="30%">';
  70  
  71  $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."facturedet";
  72  $sql .= " WHERE fk_export_compta = 0";
  73  $resql = $db->query($sql);
  74  if ($resql)
  75  {
  76    $row = $db->fetch_row($resql);
  77    $nbfac = $row[0];
  78  
  79    $db->free($resql);
  80  }
  81  
  82  $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."paiement";
  83  $sql .= " WHERE fk_export_compta = 0";
  84  
  85  $resql = $db->query($sql);
  86  if ($resql)
  87  {
  88    $row = $db->fetch_row($resql);
  89    $nbp = $row[0];
  90  
  91    $db->free($resql);
  92  }
  93  
  94  print '<table class="noborder" width="100%">';
  95  print '<tr class="liste_titre"><td>Type</td><td align="center">Nb</td></tr>';
  96  print '<tr><td>Factures à exporter</td><td align="center">'.$nbfac.'</td></tr>';
  97  print '<tr><td>Paiements à exporter</td><td align="center">'.$nbp.'</td></tr>';
  98  print "</table>\n";
  99  
 100  print '</td><td valign="top" width="70%">';
 101  
 102  $dir = DOL_DATA_ROOT."/compta/export/";
 103  
 104  print '<table class="noborder" width="100%">';
 105  print '<tr class="liste_titre">';
 106  print '<td>'.$langs->trans("Name").'</td>';
 107  print '<td>&nbsp;</td>';
 108  print "</tr>\n";
 109  
 110  $handle=opendir($dir);
 111  
 112  while (($file = readdir($handle))!==false)
 113  {
 114    if (is_readable($dir.$file) && is_file($dir.$file))
 115      {
 116        print '<tr><td><a href="'.DOL_URL_ROOT.'/document.php?modulepart=export_compta&file=export/'.$file.'&amp;type=text/plain">'.$file.'</a><td>';
 117  
 118        print '</tr>';
 119      }
 120  }
 121  
 122  print "</table>";
 123  
 124  print '</td></tr></table>';
 125  
 126  
 127  llxFooter("<em>Derni&egrave;re modification $Date: 2005/10/18 14:19:16 $ r&eacute;vision $Revision: 1.7 $</em>");
 128  ?>


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