This commit is contained in:
Regis Houssin 2006-05-17 09:47:48 +00:00
parent 47bad87536
commit b4e61b0386

View File

@ -71,13 +71,15 @@ class mod_commande_jade extends ModeleNumRefCommandes
global $db; global $db;
// D'abord on récupère la valeur max (réponse immédiate car champ indéxé) // D'abord on récupère la valeur max (réponse immédiate car champ indéxé)
$cyy=''; $cyy = 'C'.strftime("%y",time());
$sql = "SELECT MAX(ref)"; $sql = "SELECT MAX(ref)";
$sql.= " FROM ".MAIN_DB_PREFIX."commande"; $sql.= " FROM ".MAIN_DB_PREFIX."commande";
$sql.= " WHERE ref like '${cyy}%'";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$row = $db->fetch_row($resql); $row = $db->fetch_row($resql);
$cyy='';
if ($row) $cyy = substr($row[0],0,3); if ($row) $cyy = substr($row[0],0,3);
} }