From d39439437e49cb75354be441b701e749d618b18d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Sat, 31 Jan 2015 13:50:18 +0100 Subject: [PATCH] Add fetch optionnals extrafield on contract lines --- htdocs/contrat/class/contrat.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 9619ae462f4..d5d0d3309dc 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -641,6 +641,11 @@ class Contrat extends CommonObject $now=dol_now(); + require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafieldsline=new ExtraFields($this->db); + $line = new ContratLigne($this->db); + $extralabelsline=$extrafieldsline->fetch_name_optionals_label($line->table_element,true); + $this->lines=array(); // Selectionne les lignes contrats liees a un produit @@ -719,6 +724,11 @@ class Contrat extends CommonObject $line->date_fin_prevue = $this->db->jdate($objp->date_fin_validite); $line->date_fin_reel = $this->db->jdate($objp->date_cloture); + // Retreive all extrafield for propal + // fetch optionals attributes and labels + + $line->fetch_optionals($line->id,$extralabelsline); + $this->lines[] = $line; //dol_syslog("1 ".$line->desc); @@ -814,6 +824,13 @@ class Contrat extends CommonObject if ($line->statut == 4 && (! empty($line->date_fin_prevue) && $line->date_fin_prevue < $now)) $this->nbofservicesexpired++; if ($line->statut == 5) $this->nbofservicesclosed++; + + // Retreive all extrafield for propal + // fetch optionals attributes and labels + + $line->fetch_optionals($line->id,$extralabelsline); + + $this->lines[] = $line; $total_ttc+=$objp->total_ttc;