From 86c9d3f324d13eecd4a8e217a140aaffe482a246 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 3 May 2006 10:37:58 +0000 Subject: [PATCH] =?UTF-8?q?Changement=20de=20m=E9thode=20de=20num=E9rotati?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/commande/mod_commande_diamant.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/includes/modules/commande/mod_commande_diamant.php b/htdocs/includes/modules/commande/mod_commande_diamant.php index 5f1b93df7b7..d5ad774a2d0 100644 --- a/htdocs/includes/modules/commande/mod_commande_diamant.php +++ b/htdocs/includes/modules/commande/mod_commande_diamant.php @@ -128,9 +128,18 @@ class mod_commande_diamant extends ModeleNumRefCommandes { define("COMMANDE_DIAMANT_DELTA", 0); } - $max = $max + COMMANDE_DIAMANT_DELTA; + + if ($max == 0) + { + $delta = COMMANDE_DIAMANT_DELTA; + $num = sprintf("%05s",$delta); + } + else + { + $num = sprintf("%05s",$max+1); + } + $yy = strftime("%y",time()); - $num = sprintf("%05s",$max+1); return "C$yy$num"; }