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

   1  <?PHP
   2  /* Copyright (C) 2001-2002 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: tva.php,v 1.8 2005/07/10 17:46:03 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/tva.php,v $
  21   *
  22   */
  23   
  24  require ("./pre.inc.php");
  25  
  26  
  27  /*
  28   *
  29   *
  30   */
  31  
  32  function pt ($db, $sql, $date) {
  33    global $bc; 
  34  
  35    $result = $db->query($sql);
  36    if ($result) {
  37      $num = $db->num_rows();
  38      $i = 0; $total = 0 ;
  39      print "<TABLE border=\"1\" width=\"100%\">";
  40      print "<TR class=\"liste_titre\">";
  41      print "<TD width=\"60%\">$date</TD>";
  42      print "<TD align=\"right\">Montant</TD>";
  43      print "<td>&nbsp;</td>\n";
  44      print "</TR>\n";
  45      $var=True;
  46      while ($i < $num) {
  47        $obj = $db->fetch_object($result);
  48        $var=!$var;
  49        print "<TR $bc[$var]>";
  50        print "<TD>$obj->dm</TD>\n";
  51        print "<TD align=\"right\">".price($obj->amount)."</TD><td>&nbsp;</td>\n";
  52        print "</TR>\n";
  53        
  54        $total = $total + $obj->amount;
  55        
  56        $i++;
  57      }
  58      print "<tr><td align=\"right\">".$langs->trans("TotalHT").":</td><td align=\"right\"><b>".price($total)."</b></td><td>".$langs->trans("Currency".$conf->monnaie)."</td></tr>";
  59      
  60      print "</table>";
  61      $db->free();
  62    }
  63  }
  64  
  65  /*
  66   *
  67   */
  68  
  69  llxHeader();
  70  
  71  $yearc = strftime("%Y",time());
  72  
  73  
  74  echo '<table width="100%"><tr><td width="50%" valign="top">';
  75  
  76  print "<b>TVA collectée</b>";
  77  
  78  for ($y = $yearc ; $y >= $conf->years ; $y=$y-1 ) {
  79  
  80    print "<table width=\"100%\">";
  81    print "<tr><td valign=\"top\">";
  82  
  83    $sql = "SELECT sum(f.tva) as amount , date_format(f.datef,'%Y-%m') as dm";
  84    $sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1 AND f.datef >= '$y-01-01' AND f.datef <= '$y-12-31' ";
  85    $sql .= " GROUP BY dm DESC";
  86    
  87    pt($db, $sql,"Année $y");
  88    
  89    print "</td></tr></table>";
  90  }
  91  
  92  echo '</td><td valign="top" width="50%">';
  93  echo 'Tva Payée<br>';
  94  echo '</td></tr></table>';
  95  
  96  
  97  $db->close();
  98  
  99  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/10 17:46:03 $ r&eacute;vision $Revision: 1.8 $</em>");
 100  ?>


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