From 5d8e541292ae6b823e74fd8fca01adf195b6c64e Mon Sep 17 00:00:00 2001 From: fhenry Date: Fri, 26 Apr 2013 16:51:01 +0200 Subject: [PATCH] Fetch_optionals into fetch commande --- htdocs/commande/class/commande.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9be91fd80e5..04f42cb4ea3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1339,6 +1339,16 @@ class Commande extends CommonOrder $this->lines = array(); 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($this->table_element,true); + if (count($extralabels)>0) { + $this->fetch_optionals($this->id,$extralabels); + } $this->db->free();