From 5e4701b28efd0d90923f6bfdfc04c76c01c63823 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 2 Jan 2007 15:18:10 +0000 Subject: [PATCH] Ajout Fonction function getNextValue() --- .../modules/commande/mod_commande_ivoire.php | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/htdocs/includes/modules/commande/mod_commande_ivoire.php b/htdocs/includes/modules/commande/mod_commande_ivoire.php index 85e19896a16..82d08e99c26 100644 --- a/htdocs/includes/modules/commande/mod_commande_ivoire.php +++ b/htdocs/includes/modules/commande/mod_commande_ivoire.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2003-2007 Rodolphe Quiedeville * Copyright (C) 2004 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify @@ -56,6 +56,35 @@ class mod_commande_ivoire extends ModeleNumRefCommandes } + /** \brief Renvoi prochaine valeur attribuée + * \return string Valeur + */ + function getNextValue() + { + global $db; + + $sql = "SELECT count(*) FROM ".MAIN_DB_PREFIX."commande WHERE fk_statut <> 0"; + + if ( $db->query($sql) ) + { + $row = $db->fetch_row(0); + + $num = $row[0]; + } + + + return 'COM'.($num+1); + } + + /** \brief Renvoi un exemple de numérotation + * \return string Example + */ + function getExample() + { + return "COM12"; + } + + /** \brief Renvoie le prochaine numéro de référence de commande non utilisé \param obj_soc objet société \return string numéro de référence de commande non utilisé