[ Index ] |
|
Code source de Dolibarr 2.0.1 |
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_opale.php,v 1.1 2005/04/04 19:43:40 rodolphe Exp $ 20 * $Source: /cvsroot/dolibarr/dolibarr/htdocs/includes/modules/commande/mod_commande_opale.php,v $ 21 * 22 */ 23 24 /** 25 \file htdocs/includes/modules/commande/mod_commande_opale.php 26 \ingroup commande 27 \brief Fichier contenant la classe du modèle de numérotation de référence de commande Opale 28 \version $Revision: 1.1 $ 29 */ 30 31 include_once ("modules_commande.php"); 32 33 34 /** 35 \class mod_commande_opale 36 \brief Classe du modèle de numérotation de référence de commande Opale 37 */ 38 39 class mod_commande_opale extends ModeleNumRefCommandes 40 { 41 42 /** \brief Constructeur 43 */ 44 function mod_commande_opale() 45 { 46 $this->nom = "Opale"; 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 COMhexa, où hexa représente un incrément global codé en héxadécimal. (COM-000-001 à COM-FFF-FFF)"; 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 $hex = strtoupper(dechex($num+1)); 79 80 $ref = substr("000000".($hex),-6); 81 82 return 'COM-'.substr($ref,0,3)."-".substr($ref,3,3); 83 } 84 } 85 ?>
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 |
![]() |