From 6ab41766c864f2de8980f0d9bd87805d40bb4e3e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 18 Aug 2014 20:23:06 +0200 Subject: [PATCH] Fix: define new ref before trigger --- htdocs/commande/class/commande.class.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ac66f7fb048..aefdb620551 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2005-2014 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2011 Jean Heimburger @@ -9,7 +9,7 @@ * Copyright (C) 2013 Florian Henry * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU *General Public License as published by + * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * @@ -301,6 +301,13 @@ class Commande extends CommonOrder } } + // Set new ref and current status + if (! $error) + { + $this->ref = $num; + $this->statut = 1; + } + if (! $error) { // Call trigger @@ -309,13 +316,6 @@ class Commande extends CommonOrder // End call triggers } - // Set new ref and current status - if (! $error) - { - $this->ref = $num; - $this->statut = 1; - } - if (! $error) { $this->db->commit();