Skip to content
Snippets Groups Projects
Commit 48cdd3c1 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: extra fields key.

parent 171227e4
No related branches found
No related tags found
No related merge requests found
......@@ -258,14 +258,14 @@ abstract class CommonDocGenerator
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('socpeople', true);
$object->fetch_optionals($object->id, $extralabels);
foreach($extrafields->attribute_label as $key => $label)
foreach($extrafields->attribute_label as $key => $label)
{
if ($extrafields->attribute_type[$key] == 'price')
if ($extrafields->attribute_type[$key] == 'price')
{
$object->array_options['options_' . $key] = price($object->array_options ['options_' . $key], 0, $outputlangs, 0, 0, - 1, $conf->currency);
}
elseif($extrafields->attribute_type[$key] == 'select')
elseif($extrafields->attribute_type[$key] == 'select')
{
$object->array_options['options_' . $key] = $extrafields->attribute_param[$key]['options'][$object->array_options['options_' . $key]];
}
......@@ -377,12 +377,11 @@ abstract class CommonDocGenerator
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options))
{
$extrafieldkey=$this->element;
'facture';
$extrafieldkey=$object->element;
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label('facture',true);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey,true);
$object->fetch_optionals($object->id,$extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key=$array_key,$outputlangs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment