From ecb9aa7c710ea7443c9e30bd8220f4ca33dea145 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 28 May 2007 20:51:46 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20ajout=20d'une=20v=E9rification=20de=20l'?= =?UTF-8?q?existence=20de=20la=20ref=20lorsque=20plusieurs=20utilisateurs?= =?UTF-8?q?=20cr=E9es=20des=20propales=20en=20m=EAme=20temps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/propal.class.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 442ae9cd733..29da6216b82 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -464,9 +464,9 @@ class Propal extends CommonObject { global $langs,$conf,$mysoc; - $soc = new Societe($this->db); + // on vérifie si la ref n'est pas utilisée + $soc = new Societe($this->db); $soc->fetch($this->socid); - $this->verifyNumRef($soc); // Nettoyage/définition paramètres @@ -1859,11 +1859,16 @@ class Propal extends CommonObject */ function create_from() { - $this->fin_validite = $this->datep + ($this->duree_validite * 24 * 3600); + $this->fin_validite = $this->datep + ($this->duree_validite * 24 * 3600); + + // on vérifie si la ref n'est pas utilisée + $soc = new Societe($this->db); + $soc->fetch($this->socid); + $this->verifyNumRef($soc); dolibarr_syslog("Propal.class::create_from ref=".$this->ref); - $this->db->begin(); + $this->db->begin(); $this->fetch_client();