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

   1  <?php
   2  /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004-2005 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: facture.php,v 1.16 2005/10/02 19:48:55 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/projet/facture.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/projet/facture.php
  25          \ingroup    projet facture
  26          \brief      Page des factures par projet
  27          \version    $Revision: 1.16 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  require_once (DOL_DOCUMENT_ROOT."/propal.class.php");
  32  require_once (DOL_DOCUMENT_ROOT."/facture.class.php");
  33  require_once (DOL_DOCUMENT_ROOT."/commande/commande.class.php");
  34  
  35  $langs->load("projects");
  36  $langs->load("companies");
  37  $langs->load("bills");
  38  
  39  
  40  $user->getrights('projet');
  41  
  42  if (!$user->rights->projet->lire)
  43    accessforbidden();
  44  
  45  llxHeader("","../");
  46  
  47  $projet = new Project($db);
  48  $projet->fetch($_GET["id"]);
  49  
  50  $h=0;
  51  $head[$h][0] = DOL_URL_ROOT.'/projet/fiche.php?id='.$projet->id;
  52  $head[$h][1] = $langs->trans("Project");
  53  $h++;
  54  
  55  if ($conf->propal->enabled) {
  56    $langs->load("propal");
  57    $head[$h][0] = DOL_URL_ROOT.'/projet/propal.php?id='.$projet->id;
  58    $head[$h][1] = $langs->trans("Proposals");
  59    $h++;
  60  }  
  61  
  62  if ($conf->commande->enabled) {
  63    $langs->load("orders");
  64    $head[$h][0] = DOL_URL_ROOT.'/projet/commandes.php?id='.$projet->id;
  65    $head[$h][1] = $langs->trans("Orders");
  66    $h++;
  67  }
  68  
  69  if ($conf->facture->enabled) {
  70    $langs->load("bills");
  71    $head[$h][0] = DOL_URL_ROOT.'/projet/facture.php?id='.$projet->id;
  72    $head[$h][1] = $langs->trans("Bills");
  73    $hselected=$h;
  74    $h++;
  75  }
  76   
  77  dolibarr_fiche_head($head, $hselected, $langs->trans("Project").": ".$projet->ref);
  78  
  79  
  80  $projet->societe->fetch($projet->societe->id);
  81  
  82  print '<table class="border" width="100%">';
  83  print '<tr><td>'.$langs->trans("Company").'</td><td><a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$projet->societe->id.'">'.$projet->societe->nom.'</a></td></tr>';
  84  print '<tr><td>'.$langs->trans("Ref").'</td><td>'.$projet->ref.'</td></tr>';
  85  print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projet->title.'</td></tr>';      
  86  print '</table>';
  87  
  88  
  89  /*
  90   * Factures
  91   */
  92  $factures = $projet->get_facture_list();
  93  $total = 0;
  94  if (sizeof($factures)>0 && is_array($factures))
  95  {
  96      print '<br>';
  97  
  98      print_titre('Listes des factures associées au projet');
  99      print '<table class="noborder" width="100%">';
 100  
 101      print '<tr class="liste_titre">';
 102      print '<td width="15%">'.$langs->trans("Ref").'</td><td width="25%">'.$langs->trans("Date").'</td><td align="right">'.$langs->trans("Amount").'</td><td>&nbsp;</td></tr>';
 103  
 104      for ($i = 0; $i<sizeof($factures);$i++)
 105      {
 106          $facture = new Facture($db);
 107          $facture->fetch($factures[$i]);
 108  
 109          $var=!$var;
 110          print "<tr $bc[$var]>";
 111          print "<td><a href=\"../compta/facture.php?facid=$facture->id\">$facture->ref</a></td>\n";
 112          print '<td>'.strftime("%d %B %Y",$facture->date).'</td>';
 113          print '<td align="right">'.price($facture->total_ht).'</td><td>&nbsp;</td></tr>';
 114  
 115          $total = $total + $facture->total_ht;
 116      }
 117  
 118      print '<tr class="liste_total"><td colspan="2">'.$i.' '.$langs->trans("Bills").'</td>';
 119      print '<td align="right">'.$langs->trans("TotalHT").' : '.price($total).'</td>';
 120      print '<td align="left">'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
 121      print "</table>";
 122  }
 123  
 124  print '</div>';
 125  
 126  // Juste pour éviter bug IE qui réorganise mal div précédents si celui-ci absent
 127  print '<div class="tabsAction">';
 128  print '</div>';
 129  
 130  $db->close();
 131  
 132  llxFooter('$Date: 2005/10/02 19:48:55 $ - $Revision: 1.16 $');
 133  ?>


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