From 916e3de6a79d5ae42ee72121e96274d04759a996 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 13 Apr 2010 19:34:40 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20bug=20#29526=20:=20Num=E9rotation=20Prop?= =?UTF-8?q?osition=20Incorrecte=20apr=E8s=20duplication?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeLog | 1 + documents/.cvsignore | 1 + htdocs/comm/propal/propal.class.php | 10 +++++++--- .../includes/modules/propale/mod_propale_saphir.php | 12 ++++++------ 4 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 documents/.cvsignore diff --git a/ChangeLog b/ChangeLog index f21879edb5c..f7831eda591 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,7 @@ For users: - Fix: Can use $ in database and login/pass values. - Fix: No error on upgrade if there is orphelins tasks. - Fix: Failed to login when user agent string was longer than 128. +- Fix: bug #29526 : Numérotation Proposition Incorrecte après duplication ***** ChangeLog for 2.8 compared to 2.7 ***** diff --git a/documents/.cvsignore b/documents/.cvsignore new file mode 100644 index 00000000000..03c88fd7a39 --- /dev/null +++ b/documents/.cvsignore @@ -0,0 +1 @@ +.htaccess diff --git a/htdocs/comm/propal/propal.class.php b/htdocs/comm/propal/propal.class.php index 80f68d08b96..06783be24d5 100644 --- a/htdocs/comm/propal/propal.class.php +++ b/htdocs/comm/propal/propal.class.php @@ -90,7 +90,7 @@ class Propal extends CommonObject var $adresse; var $products=array(); - + var $lines = array(); var $labelstatut=array(); @@ -733,6 +733,10 @@ class Propal extends CommonObject $object->id=0; $object->statut=0; + require_once(DOL_DOCUMENT_ROOT ."/societe/societe.class.php"); + $objsoc=new Societe($this->db); + $objsoc->fetch($object->socid); + if (empty($conf->global->PROPALE_ADDON) || ! is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php")) { $this->error='ErrorSetupNotComplete'; @@ -742,7 +746,7 @@ class Propal extends CommonObject require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".$conf->global->PROPALE_ADDON.".php"); $obj = $conf->global->PROPALE_ADDON; $modPropale = new $obj; - $numpr = $modPropale->getNextValue($soc,$object); + $numpr = $modPropale->getNextValue($objsoc,$object); // Clear fields $object->ref = $numpr; @@ -1615,7 +1619,7 @@ class Propal extends CommonObject } } } - + if (! $notrigger) { // Call triggers diff --git a/htdocs/includes/modules/propale/mod_propale_saphir.php b/htdocs/includes/modules/propale/mod_propale_saphir.php index b70c4215754..2af256ffae0 100644 --- a/htdocs/includes/modules/propale/mod_propale_saphir.php +++ b/htdocs/includes/modules/propale/mod_propale_saphir.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * @@ -23,7 +23,7 @@ /** \file htdocs/includes/modules/propale/mod_propale_saphir.php \ingroup propale - \brief Fichier contenant la classe du modèle de numérotation de référence de propale Saphir + \brief File that contains the numbering module rules Saphir \version $Id$ */ @@ -32,7 +32,7 @@ require_once(DOL_DOCUMENT_ROOT ."/includes/modules/propale/modules_propale.php") /** \class mod_propale_saphir - \brief Classe du modèle de numérotation de référence de propale Saphir + \brief Class of file that contains the numbering module rules Saphir */ class mod_propale_saphir extends ModeleNumRefPropales { @@ -41,7 +41,7 @@ class mod_propale_saphir extends ModeleNumRefPropales var $nom = 'Saphir'; - /** \brief Renvoi la description du modele de numérotation + /** \brief Return description of module * \return string Texte descripif */ function info() @@ -79,7 +79,7 @@ class mod_propale_saphir extends ModeleNumRefPropales return $texte; } - /** \brief Renvoi un exemple de numérotation + /** \brief Renvoi un exemple de numerotation * \return string Example */ function getExample() @@ -109,7 +109,7 @@ class mod_propale_saphir extends ModeleNumRefPropales require_once(DOL_DOCUMENT_ROOT ."/lib/functions2.lib.php"); - // On défini critere recherche compteur + // On d�fini critere recherche compteur $mask=$conf->global->PROPALE_SAPHIR_MASK; if (! $mask)