From dc1314f4f432fd8daf7ca185a12438c9979d34d1 Mon Sep 17 00:00:00 2001 From: jfefe Date: Wed, 6 Mar 2013 05:31:19 +0100 Subject: [PATCH] Retreive extrafield when fetch invoice --- htdocs/compta/facture/class/facture.class.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 31e45d40807..b6c74203636 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -865,6 +865,20 @@ class Facture extends CommonInvoice $this->extraparams = (array) json_decode($obj->extraparams, true); if ($this->statut == 0) $this->brouillon = 1; + + // Retreive all extrafield for invoice + // fetch optionals attributes and labels + if(!class_exists('Extrafields')) + require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); + $extrafields=new ExtraFields($this->db); + $extralabels=$extrafields->fetch_name_optionals_label('facture',true); + if (count($extralabels)>0) { + $this->array_options = array(); + } + foreach($extrafields->attribute_label as $key=>$label) + { + $this->array_options['options_'.$key]=$label; + } /* * Lines