From 3b0beed51ddb4eac87c6358edd4fe7f49cd20f1f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 24 Feb 2012 16:52:33 +0100 Subject: [PATCH] Fix: professionnal id only visible if not empty --- htdocs/core/lib/pdf.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 47f25af52c1..bd08331552d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -223,25 +223,25 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target if ($targetcompany->tva_intra) $stringaddress.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra); // Professionnal Ids - if ($conf->global->MAIN_PROFID1_IN_ADDRESS) + if (! empty($conf->global->MAIN_PROFID1_IN_ADDRESS) && ! empty($targetcompany->idprof1)) { $tmp=$outputlangs->transcountrynoentities("ProfId1",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof1); } - if ($conf->global->MAIN_PROFID2_IN_ADDRESS) + if (! empty($conf->global->MAIN_PROFID2_IN_ADDRESS) && ! empty($targetcompany->idprof2)) { $tmp=$outputlangs->transcountrynoentities("ProfId2",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof2); } - if ($conf->global->MAIN_PROFID3_IN_ADDRESS) + if (! empty($conf->global->MAIN_PROFID3_IN_ADDRESS) && ! empty($targetcompany->idprof3)) { $tmp=$outputlangs->transcountrynoentities("ProfId3",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1]; $stringaddress.="\n".$tmp.': '.$outputlangs->convToOutputCharset($targetcompany->idprof3); } - if ($conf->global->MAIN_PROFID4_IN_ADDRESS) + if (! empty($conf->global->MAIN_PROFID4_IN_ADDRESS) && ! empty($targetcompany->idprof4)) { $tmp=$outputlangs->transcountrynoentities("ProfId4",$targetcompany->country_code); if (preg_match('/\((.+)\)/',$tmp,$reg)) $tmp=$reg[1];