From 587766b39b835d029c5f3f1ecd12b3028d0ad9af Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 3 Oct 2018 10:38:47 +0200 Subject: [PATCH 1/3] FIX : wrong function name --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 1d6c26caecd..36f1997ac85 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -440,7 +440,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 583ea055671f27eaf845b8c9b5a7061e65ef816a Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Oct 2018 12:13:53 +0200 Subject: [PATCH 2/3] fix missing letter... --- htdocs/core/lib/pdf.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 66caf2ea23a..31c6b613e24 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -438,7 +438,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target // Contact on a thirdparty that is a different thirdparty than the thirdparty of object if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { - $targetcontact->fetch_thirparty(); + $targetcontact->fetch_thirdparty(); $companytouseforaddress = $targetcontact->thirdparty; } From 8ee7a48583378758cb7c5aa19be25e0eb0207b01 Mon Sep 17 00:00:00 2001 From: aplose Date: Wed, 3 Oct 2018 15:15:46 +0200 Subject: [PATCH 3/3] Fix issue #9434 : no array_options available when calling api : I replace the deprecated code by the fetch_optionnals() recommanded call. --- htdocs/commande/class/commande.class.php | 12 ++++++++---- htdocs/compta/facture/class/facture.class.php | 12 +++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 9007490d421..6677a9f08de 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1677,10 +1677,11 @@ class Commande extends CommonOrder // Retrieve all extrafields for invoice // fetch optionals attributes and labels - 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); - $this->fetch_optionals($this->id,$extralabels); +// 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); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); $this->db->free($result); @@ -1882,6 +1883,9 @@ class Commande extends CommonOrder $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; + $line->fetch_optionals(); + + $this->lines[$i] = $line; $i++; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index bc7a14c0c45..9bf6d4b876c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1353,10 +1353,12 @@ class Facture extends CommonInvoice // Retrieve all extrafield for invoice // fetch optionals attributes and labels - 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); - $this->fetch_optionals($this->id,$extralabels); +// 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); +// $this->fetch_optionals($this->id,$extralabels); + $this->fetch_optionals(); + /* * Lines @@ -1477,7 +1479,7 @@ class Facture extends CommonInvoice $line->multicurrency_total_tva = $objp->multicurrency_total_tva; $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc; - // TODO Fetch optional like done in fetch line of facture_rec ? + $line->fetch_optionals(); $this->lines[$i] = $line;