diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 77f3c7200f4..d4b77342c84 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -572,6 +572,22 @@ class Adherent extends CommonObject $sql.= ", fk_user_mod = ".($user->id>0?$user->id:'null'); // Can be null because member can be create by a guest $sql.= " WHERE rowid = ".$this->id; + // If we change the type of membership, we set also label of new type + if (! empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) + { + $sql2 = "SELECT libelle as label"; + $sql2.= " FROM ".MAIN_DB_PREFIX."adherent_type"; + $sql2.= " WHERE rowid = ".$this->typeid; + $resql2 = $this->db->query($sql2); + if ($resql2) + { + while ($obj=$this->db->fetch_object($resql2)) + { + $this->type=$obj->label; + } + } + } + dol_syslog(get_class($this)."::update update member", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 2cc990056da..6eaba659de0 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -263,15 +263,17 @@ else { if ($senderissupplier != 2) { $ajaxoptions=array( - 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key - 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done - 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo) + 'update' => array('qty'=>'qty','remise_percent' => 'discount','idprod' => 'idprod'), // html id tags that will be edited with which ajax json response key + 'option_disabled' => 'idthatdoesnotexists', // html id to disable once select is done + 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'warning' (for example shown we select a disabled option into combo) ); $alsoproductwithnosupplierprice=0; } else { - $ajaxoptions = array(); + $ajaxoptions = array( + 'update' => array('remise_percent' => 'discount') // html id tags that will be edited with each ajax json response key + ); $alsoproductwithnosupplierprice=1; } diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 4b81697be66..f872d230498 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -743,9 +743,11 @@ if ($step == 3 && $datatoexport) // un formulaire en plus pour recuperer les filtres print '