Fix: Substition of extra field was ko for order.
This commit is contained in:
parent
fb789b8197
commit
b714347b6b
@ -516,7 +516,7 @@ class ExtraFields
|
|||||||
/**
|
/**
|
||||||
* Load array this->attribute_label
|
* Load array this->attribute_label
|
||||||
*
|
*
|
||||||
* @param string $elementtype Type of element
|
* @param string $elementtype Type of element ('adherent', 'commande', societe', 'facture', 'propal', 'product', ...)
|
||||||
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
* @param boolean $forceload Force load of extra fields whatever is option MAIN_EXTRAFIELDS_DISABLED
|
||||||
* @return array Array of attributes for all extra fields
|
* @return array Array of attributes for all extra fields
|
||||||
*/
|
*/
|
||||||
@ -941,18 +941,18 @@ class ExtraFields
|
|||||||
}
|
}
|
||||||
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
|
||||||
//$sql.= ' AND entity = '.$conf->entity;
|
//$sql.= ' AND entity = '.$conf->entity;
|
||||||
|
|
||||||
dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql);
|
dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$value=''; // value was used, so now we reste it to use it to build final output
|
$value=''; // value was used, so now we reste it to use it to build final output
|
||||||
|
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
// Several field into label (eq table:code|libelle:rowid)
|
// Several field into label (eq table:code|libelle:rowid)
|
||||||
$fields_label = explode('|',$InfoFieldList[1]);
|
$fields_label = explode('|',$InfoFieldList[1]);
|
||||||
|
|
||||||
if(is_array($fields_label))
|
if(is_array($fields_label))
|
||||||
{
|
{
|
||||||
foreach ($fields_label as $field_toshow)
|
foreach ($fields_label as $field_toshow)
|
||||||
|
|||||||
@ -140,6 +140,16 @@ class doc_generic_order_odt extends ModelePDFCommandes
|
|||||||
$resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
$resarray['object_total_vat_'.$line->tva_tx]+=$line->total_tva;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Retrieve extrafields
|
||||||
|
if(is_array($object->array_options) && count($object->array_options))
|
||||||
|
{
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
$extrafields = new ExtraFields($this->db);
|
||||||
|
$extralabels = $extrafields->fetch_name_optionals_label('commande',true);
|
||||||
|
$object->fetch_optionals($object->id,$extralabels);
|
||||||
|
|
||||||
|
$resarray = $this->fill_substitutionarray_with_extrafields($object,$resarray,$extrafields,$array_key='object',$outputlangs);
|
||||||
|
}
|
||||||
return $resarray;
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user