FIX: PDF address: handle when contact thirdparty different from document thirdparty
This commit is contained in:
parent
e0b272941f
commit
e285b42a18
@ -432,8 +432,15 @@ 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 {
|
||||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
|
$companytouse = $targetcompany;
|
||||||
|
|
||||||
|
if($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) { // Contact thirdparty different from document thirdparty
|
||||||
|
$targetcontact->fetch_thirparty();
|
||||||
|
$companytouse = $targetcontact->thirdparty;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($companytouse))."\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) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user