[ 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/includes/modules/commande/ -> mod_commande_jade.php (source)

   1  <?php
   2  /* Copyright (C) 2005 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   * or see http://www.gnu.org/
  18   *
  19   * $Id: mod_commande_jade.php,v 1.1 2005/04/04 19:34:03 rodolphe Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/commande/mod_commande_jade.php,v $
  21   *
  22   */
  23  
  24  /** 
  25      \file       htdocs/includes/modules/commande/mod_commande_jade.php
  26      \ingroup    commande
  27      \brief      Fichier contenant la classe du modèle de numérotation de référence de commande Jade
  28      \version    $Revision: 1.1 $
  29  */
  30  
  31  include_once ("modules_commande.php");
  32  
  33  
  34  /**
  35     \class      mod_commande_jade
  36     \brief      Classe du modèle de numérotation de référence de commande Jade
  37  */
  38  
  39  class mod_commande_jade extends ModeleNumRefCommandes
  40  {
  41  
  42    /**   \brief      Constructeur
  43     */
  44    function mod_commande_jade()
  45    {
  46      $this->nom = "Jade";
  47    }
  48  
  49  
  50    /**     \brief      Renvoi la description du modele de numérotation
  51     *      \return     string      Texte descripif
  52     */
  53    function info()
  54    {
  55      return "Renvoie le numéro sous la forme numérique CYY00001, CYY00002, CYY00003, ... où YY représente l'année. Le numéro d'incrément qui suit l'année n'est PAS remis à zéro en début d'année.";
  56    }
  57  
  58    
  59    /**   \brief      Renvoie le prochaine numéro de référence de commande non utilisé
  60          \param      obj_soc     objet société
  61          \return     string      numéro de référence de commande non utilisé
  62     */
  63    function commande_get_num($obj_soc=0)
  64    { 
  65      global $db;
  66      
  67      $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande WHERE fk_statut <> 0";
  68      
  69      $resql = $db->query($sql);
  70  
  71      if ( $resql ) 
  72        {
  73      $row = $db->fetch_row($resql);
  74      
  75      $num = $row[0];
  76        }
  77      
  78      $y = strftime("%y",time());
  79  
  80      return 'C'.$y.substr("00000".($num+1),-5);
  81    }
  82  }
  83  ?>


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