diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 3b815e962c0..aec9e74dcb8 100755 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -171,11 +171,13 @@ abstract class CommonDocGenerator require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); $extralabels = $extrafields->fetch_name_optionals_label('company',true); - //Get extrafield values - $object->fetch_optionals($object->id,$extralabels); foreach($extrafields->attribute_label as $key=>$label) { + if($extrafields->attribute_type[$key] == 'price') + { + $object->array_options['options_'.$key] = price($object->array_options['options_'.$key]).' '.$outputlangs->getCurrencySymbol($conf->currency); + } $array_thirdparty=array_merge($array_thirdparty,array('company_options_'.$key => $object->array_options['options_'.$key])); } } diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ec02f906e70..f72ddc8d6e2 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -44,6 +44,10 @@ class ExtraFields var $attribute_unique; // Array to store if attribute is required or not var $attribute_required; + // Array to store parameters of attribute (used in select type) + var $attribute_param; + // Int to store position of attribute + var $attribute_pos; var $error; var $errno; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index c1dd0c4c09d..ee8f6e984b1 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -998,14 +998,25 @@ else $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook if (empty($reshook) && ! empty($extrafields->attribute_label)) { + $e=0; foreach($extrafields->attribute_label as $key=>$label) { + $colspan='3'; $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($object->array_options["options_".$key])?$object->array_options["options_".$key]:'')); - print '