diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index bf9ac2402be..93c72643d10 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -548,13 +548,14 @@ if ($conf->use_javascript_ajax) {
}
// Invert alias and name thirdparty
-
-print '
| '.$langs->trans("PDF_INVERT_ALIAS_NAME_THIRDPARTY").' | ';
-if ($conf->use_javascript_ajax) {
- print ajax_constantonoff('PDF_INVERT_ALIAS_NAME_THIRDPARTY');
-} else {
- $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
- print $form->selectarray("PDF_INVERT_ALIAS_NAME_THIRDPARTY", $arrval, $conf->global->PDF_INVERT_ALIAS_NAME_THIRDPARTY);
+if (!empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) {
+ print ' |
| '.$langs->trans("PDF_INVERT_ALIAS_NAME_THIRDPARTY").' | ';
+ if ($conf->use_javascript_ajax) {
+ print ajax_constantonoff('PDF_INVERT_ALIAS_NAME_THIRDPARTY');
+ } else {
+ $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
+ print $form->selectarray("PDF_INVERT_ALIAS_NAME_THIRDPARTY", $arrval, $conf->global->PDF_INVERT_ALIAS_NAME_THIRDPARTY);
+ }
}
// Show online payment link on invoices
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 29cddef9b3e..faf00fe1e75 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -395,10 +395,8 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
if (($includealias || !empty($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME)) && !empty($thirdparty->name_alias)) {
$socname .= " - ".$thirdparty->name_alias;
if ($conf->global->PDF_INVERT_ALIAS_NAME_THIRDPARTY) {
- $socname = $thirdparty->name_alias." - ".$socname;
- if ($conf->global->PDF_INVERT_ALIAS_NAME_THIRDPARTY) {
- $socname = $thirdparty->name_alias." - ".$socname;
- }
+ $socname = '';
+ $socname = $thirdparty->name_alias." - ".$thirdparty->name;
}
}
} elseif ($thirdparty instanceof Contact) {
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index af99bdce7db..b5814a96ab9 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -2141,7 +2141,7 @@ EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
PDF_SHOW_PROJECT=Show project on document
ShowProjectLabel=Project Label
PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME = Include alias in thirdparty name
-PDF_INVERT_ALIAS_NAME_THIRDPARTY = Invet name and alias
+PDF_INVERT_ALIAS_NAME_THIRDPARTY = Invert name and alias
PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF.
PDF_USE_A=Gererate PDF documents with format PDF/A instead of defaut format PDF
FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book.
|