Quick hack to solve missing alias name on doc.

This commit is contained in:
Laurent Destailleur 2017-07-09 15:15:23 +02:00
parent 9fc17d8988
commit aa66676b7d

View File

@ -345,16 +345,18 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
* @param Societe|Contact $thirdparty Contact or thirdparty * @param Societe|Contact $thirdparty Contact or thirdparty
* @param Translate $outputlangs Output language * @param Translate $outputlangs Output language
* @param int $includealias 1=Include alias name after name * @param int $includealias 1=Include alias name after name
* @return string * @return string String with name of thirdparty (+ alias if requested)
*/ */
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0) function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
{ {
global $conf;
// Recipient name // Recipient name
$socname = ''; $socname = '';
if ($thirdparty instanceof Societe) { if ($thirdparty instanceof Societe) {
$socname .= $thirdparty->name; $socname .= $thirdparty->name;
if ($includealias && !empty($thirdparty->name_alias)) { if (($includealias || ! empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) && !empty($thirdparty->name_alias)) {
$socname .= "\n".$thirdparty->name_alias; $socname .= "\n".$thirdparty->name_alias;
} }
} elseif ($thirdparty instanceof Contact) { } elseif ($thirdparty instanceof Contact) {