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é