From b100cdb9db97e20eb2b5a9a13951eb9e74c64902 Mon Sep 17 00:00:00 2001 From: Florian Mortgat Date: Fri, 19 Jul 2019 11:58:21 +0200 Subject: [PATCH] FIX: extrafield loading bug due to assumption that an object is a third party while it may be a contact if MAIN_USE_COMPANY_NAME_OF_CONTACT is set. --- .../expedition/doc/doc_generic_shipment_odt.modules.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 9c45c135ac3..a1be784f249 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -393,7 +393,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } } // Make substitutions into odt of thirdparty - $tmparray=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); + if ($socobject->element == 'contact') { + $tmparray = $this->get_substitutionarray_contact($socobject, $outputlangs); + } else { + $tmparray = $this->get_substitutionarray_thirdparty($socobject, $outputlangs); + } foreach($tmparray as $key=>$value) { try {