2
0
forked from Wavyzz/dolibarr

Update pdf.lib.php

This commit is contained in:
Laurent Destailleur
2018-09-04 09:57:01 +02:00
committed by GitHub
parent e285b42a18
commit 252335318f

View File

@@ -433,14 +433,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
if (!empty($targetcontact->address)) { if (!empty($targetcontact->address)) {
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
} else { } else {
$companytouse = $targetcompany; $companytouseforaddress = $targetcompany;
if($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { // Contact thirdparty different from document thirdparty // 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_thirparty();
$companytouse = $targetcontact->thirdparty; $companytouseforaddress = $targetcontact->thirdparty;
} }
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouse))."\n"; $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouseforaddress))."\n";
} }
// Country // Country
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) { if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {