Merge remote-tracking branch 'origin/3.9' into develop

This commit is contained in:
Laurent Destailleur 2016-02-25 01:42:03 +01:00
commit 1ba2407da4

View File

@ -340,22 +340,21 @@ function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
/** /**
* Returns the name of the thirdparty * Returns the name of the thirdparty
* *
* @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
* @return string * @return string
*/ */
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs) function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
{ {
//Recipient name // Recipient name
$socname = ''; $socname = '';
// On peut utiliser le nom de la societe du contact
if ($thirdparty instanceof Societe) { if ($thirdparty instanceof Societe) {
if (!empty($thirdparty->name_alias)) {
$socname = $thirdparty->name_alias."\n";
}
$socname .= $thirdparty->name; $socname .= $thirdparty->name;
if ($includealias && !empty($thirdparty->name_alias)) {
$socname .= "\n".$thirdparty->name_alias;
}
} elseif ($thirdparty instanceof Contact) { } elseif ($thirdparty instanceof Contact) {
$socname = $thirdparty->socname; $socname = $thirdparty->socname;
} else { } else {