| [ Index ] |
|
Code source de Dolibarr 2.0.1 |
1 <?php 2 /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> 3 * Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> 4 * Copyright (C) 2005 Regis Houssin <regis.houssin@cap-networks.com> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 * or see http://www.gnu.org/ 20 * 21 * $Id: mod_propale_ivoire.php,v 1.14 2005/11/14 17:50:14 hregis Exp $ 22 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/propale/mod_propale_ivoire.php,v $ 23 */ 24 25 26 /** 27 \file htdocs/includes/modules/propale/mod_propale_ivoire.php 28 \ingroup propale 29 \brief Fichier contenant la classe du modèle de numérotation de référence de propale Ivoire 30 \version $Revision: 1.14 $ 31 */ 32 33 require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php"); 34 35 /** \class mod_propale_ivoire 36 \brief Classe du modèle de numérotation de référence de propale Ivoire 37 */ 38 39 class mod_propale_ivoire extends ModeleNumRefPropales 40 { 41 42 /** \brief Renvoi la description du modele de numérotation 43 * \return string Texte descripif 44 */ 45 function info() 46 { 47 return "Renvoie le numéro sous la forme PRyynnnn où yy est l'année et nnnn un compteur sans remise à 0"; 48 } 49 50 51 /** \brief Renvoi un exemple de numérotation 52 * \return string Example 53 */ 54 function getExample() 55 { 56 return "PR050001"; 57 } 58 59 60 /** \brief Renvoi prochaine valeur attribuée 61 * \return string Valeur 62 */ 63 function getNextValue() 64 { 65 global $db; 66 67 $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."propal"; 68 69 if ( $db->query($sql) ) 70 { 71 $row = $db->fetch_row(0); 72 73 $num = $row[0]; 74 } 75 76 $y = strftime("%y",time()); 77 78 return "PR" . "$y" . substr("000".$num, strlen("000".$num)-4,4); 79 } 80 81 82 /** \brief Renvoie la référence de propale suivante non utilisée 83 * \param objsoc Objet société 84 * \return string Texte descripif 85 */ 86 function propale_get_num($objsoc=0) 87 { 88 // return $this->propale_get_num(); 89 return $this->getNextValue(); 90 } 91 } 92 93 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Mon Nov 26 12:29:37 2007 | par Balluche grâce à PHPXref 0.7 |
|