From 7328d4399f0d5bfdcb6bad540513b58966b8ec41 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 3 May 2006 10:04:19 +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 --- htdocs/commande/commande.class.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index c8922de05c6..e8241e251b8 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -160,7 +160,17 @@ class Commande $objMod = new $modName($this->db); $soc = new Societe($this->db); $soc->fetch($this->soc_id); - $num = $objMod->commande_get_num($soc); + + // on vérifie si la commande est en numérotation provisoire + $comref = substr($this->ref, 1, 4); + if ($comref == PROV) + { + $num = $objMod->commande_get_num($soc); + } + else + { + $num = $this->ref + } $sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='$num', fk_statut = 1, date_valid=now(), fk_user_valid=$user->id"; $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;";