Fix carriage return when get full address formated for output on documents
This commit is contained in:
parent
f9d9642340
commit
dc87133e0b
@ -414,13 +414,13 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
if (empty($conf->global->MAIN_PDF_DISABLESOURCEDETAILS))
|
||||
{
|
||||
// Phone
|
||||
if ($sourcecompany->phone) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("PhoneShort").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
|
||||
if ($sourcecompany->phone) $stringaddress .= "\n".$outputlangs->transnoentities("PhoneShort").": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
|
||||
// Fax
|
||||
if ($sourcecompany->fax) $stringaddress .= ($stringaddress ? ($sourcecompany->phone ? " - " : "\n") : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
|
||||
// EMail
|
||||
if ($sourcecompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email);
|
||||
if ($sourcecompany->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($sourcecompany->email);
|
||||
// Web
|
||||
if ($sourcecompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
|
||||
if ($sourcecompany->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($sourcecompany->url);
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,16 +431,16 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1));
|
||||
|
||||
if (!empty($targetcontact->address)) {
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n";
|
||||
$stringaddress .= "\n".$outputlangs->convToOutputCharset(dol_format_address($targetcontact));
|
||||
}else {
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
|
||||
$stringaddress .= "\n".$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
|
||||
}
|
||||
// Country
|
||||
if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
|
||||
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code))."\n";
|
||||
$stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->country_code));
|
||||
}
|
||||
else if (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
|
||||
$stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
$stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
|
||||
}
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode))
|
||||
@ -448,7 +448,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
// Phone
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/',$mode))
|
||||
{
|
||||
if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcontact->phone_pro) || ! empty($targetcontact->phone_mobile)) $stringaddress .= "\n".$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcontact->phone_pro)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
|
||||
if (! empty($targetcontact->phone_pro) && ! empty($targetcontact->phone_mobile)) $stringaddress .= " / ";
|
||||
if (! empty($targetcontact->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
|
||||
@ -456,32 +456,32 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
// Fax
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/',$mode))
|
||||
{
|
||||
if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
||||
if ($targetcontact->fax) $stringaddress .= "\n".$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax);
|
||||
}
|
||||
// EMail
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/',$mode))
|
||||
{
|
||||
if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
|
||||
if ($targetcontact->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email);
|
||||
}
|
||||
// Web
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/',$mode))
|
||||
{
|
||||
if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
|
||||
if ($targetcontact->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n";
|
||||
$stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany));
|
||||
// Country
|
||||
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code))."\n";
|
||||
if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.="\n".$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->country_code));
|
||||
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || preg_match('/targetwithdetails/',$mode))
|
||||
{
|
||||
// Phone
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_phone/',$mode))
|
||||
{
|
||||
if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcompany->phone) || ! empty($targetcompany->phone_mobile)) $stringaddress .= "\n".$outputlangs->transnoentities("Phone").": ";
|
||||
if (! empty($targetcompany->phone)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
|
||||
if (! empty($targetcompany->phone) && ! empty($targetcompany->phone_mobile)) $stringaddress .= " / ";
|
||||
if (! empty($targetcompany->phone_mobile)) $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile);
|
||||
@ -489,17 +489,17 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target
|
||||
// Fax
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_fax/',$mode))
|
||||
{
|
||||
if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
||||
if ($targetcompany->fax) $stringaddress .= "\n".$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax);
|
||||
}
|
||||
// EMail
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_email/',$mode))
|
||||
{
|
||||
if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
|
||||
if ($targetcompany->email) $stringaddress .= "\n".$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email);
|
||||
}
|
||||
// Web
|
||||
if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS) || $mode == 'targetwithdetails' || preg_match('/targetwithdetails_url/',$mode))
|
||||
{
|
||||
if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
|
||||
if ($targetcompany->url) $stringaddress .= "\n".$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user