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

   1  <?php
   2  /* Copyright (C) 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: note.php,v 1.30 2005/12/03 17:18:35 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/compta/facture/note.php,v $
  21   */
  22  
  23  /**
  24          \file       htdocs/compta/facture/note.php
  25          \ingroup    facture
  26          \brief      Fiche de notes sur une facture
  27          \version    $Revision: 1.30 $
  28  */
  29  
  30  require ("./pre.inc.php");
  31  require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php');
  32  
  33  
  34  $user->getrights('facture');
  35  if (!$user->rights->facture->lire)
  36    accessforbidden();
  37  
  38  $langs->load("companies");
  39  $langs->load("bills");
  40  
  41  /*
  42   * Sécurité accés client
  43   */
  44  if ($user->societe_id > 0) 
  45  {
  46    unset($_GET["action"]);
  47    $socidp = $user->societe_id;
  48  }
  49  
  50  
  51  $fac = new Facture($db);
  52  $fac->fetch($_GET["facid"]);
  53  
  54  
  55  /******************************************************************************/
  56  /*                     Actions                                                */
  57  /******************************************************************************/
  58  
  59  if ($_POST["action"] == 'update' && $user->rights->facture->creer)
  60  {
  61    $fac->update_note($_POST["note"]);
  62  }
  63  
  64  
  65  /******************************************************************************/
  66  /*                   Fin des  Actions                                         */
  67  /******************************************************************************/
  68  
  69  
  70  llxHeader();
  71  
  72  $html = new Form($db);
  73  
  74  if ($_GET["facid"])
  75  {
  76      $soc = new Societe($db, $fac->socidp);
  77      $soc->fetch($fac->socidp);
  78  
  79      $head = facture_prepare_head($fac);
  80      $hselected = 2;
  81      if ($conf->use_preview_tabs) $hselected++;
  82      if ($fac->mode_reglement_code == 'PRE') $hselected++;
  83  
  84      dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref");
  85  
  86  
  87      print '<table class="border" width="100%">';
  88  
  89      // Reference
  90      print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="5">'.$fac->ref.'</td></tr>';
  91  
  92      print '<tr><td>'.$langs->trans("Company").'</td>';
  93      print '<td colspan="3">';
  94      print '<a href="'.DOL_URL_ROOT.'/compta/fiche.php?socid='.$soc->id.'">'.$soc->nom.'</a></td>';
  95  
  96      // Dates
  97      print '<tr><td>'.$langs->trans("Date").'</td>';
  98      print '<td>'.dolibarr_print_date($fac->date,"%A %d %B %Y").'</td>';
  99      print '<td>'.$langs->trans("DateClosing").'</td><td>' . dolibarr_print_date($fac->date_lim_reglement,"%A %d %B %Y");
 100      if ($fac->date_lim_reglement < (time() - $conf->facture->client->warning_delay) && ! $fac->paye && $fac->statut == 1 && ! $fac->am) print img_warning($langs->trans("Late"));
 101      print "</td></tr>";
 102  
 103      // Conditions et modes de réglement
 104      print '<tr><td>'.$langs->trans("PaymentConditions").'</td><td>';
 105      $html->form_conditions_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->cond_reglement_id,"none");
 106      print '</td>';
 107      print '<td width="25%">'.$langs->trans("PaymentMode").'</td><td width="25%">';
 108      $html->form_modes_reglement($_SERVER["PHP_SELF"]."?facid=$fac->id",$fac->mode_reglement_id,"none");
 109      print '</td></tr>';
 110  
 111      print '<tr><td valign="top" colspan="4">'.$langs->trans("Note").' :</td></tr>';
 112  
 113      print '<tr><td valign="top" colspan="4">'.($fac->note?nl2br($fac->note):"&nbsp;")."</td></tr>";
 114  
 115      if ($_GET["action"] == 'edit')
 116      {
 117          print '<form method="post" action="note.php?facid='.$fac->id.'">';
 118          print '<input type="hidden" name="action" value="update">';
 119          print '<tr><td valign="top" colspan="4"><textarea name="note" cols="80" rows="8">'.$fac->note."</textarea></td></tr>";
 120          print '<tr><td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>';
 121          print '</form>';
 122      }
 123  
 124      print "</table>";
 125  
 126  
 127      /*
 128      * Actions
 129      */
 130      print '</div>';
 131      print '<div class="tabsAction">';
 132  
 133      if ($user->rights->facture->creer && $_GET["action"] <> 'edit')
 134      {
 135          print "<a class=\"tabAction\" href=\"note.php?facid=$fac->id&amp;action=edit\">".$langs->trans('Edit')."</a>";
 136      }
 137  
 138      print "</div>";
 139  
 140  
 141  }
 142  
 143  $db->close();
 144  
 145  llxFooter('$Date: 2005/12/03 17:18:35 $ - $Revision: 1.30 $');
 146  ?>


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