Disable option not complete

This commit is contained in:
Laurent Destailleur 2022-06-07 10:58:19 +02:00
parent 93ba5db6d3
commit b9e376fb1d
3 changed files with 14 additions and 9 deletions

View File

@ -570,11 +570,13 @@ print '</td></tr>';
// Show alias in thirdparty name
print '<tr class="oddeven"><td>'.$langs->trans("PDF_THIRDPARTY_NAME_TO_SHOW_IS").'</td><td>';
/* Disabled because not yet completely implemented (does not work when we force a contact on object)
print '<tr class="oddeven"><td>'.$langs->trans("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME").'</td><td>';
if ($conf->use_javascript_ajax) {
$arrval = array('0' => '', '1' => $langs->trans("THIRDPARTY_ALIAS"), '2' => $langs->trans("ALIAS_THIRDPARTY"));
print $form->selectarray("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", $arrval, $conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME);
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("THIRDPARTY_ALIAS"), '2' => $langs->trans("ALIAS_THIRDPARTY"));
print $form->selectarray("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", $arrval, getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME'));
}
*/
// Show online payment link on invoices

View File

@ -391,16 +391,19 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
$socname = '';
if ($thirdparty instanceof Societe) {
$socname .= $thirdparty->name;
if (($includealias || $conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME) == 1 && !empty($thirdparty->name_alias)) {
$socname .= " - ".$thirdparty->name_alias;
if ($conf->global->PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME == 2) {
$socname = '';
$socname = $thirdparty->name;
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
if (getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME') == 2) {
$socname = $thirdparty->name_alias." - ".$thirdparty->name;
} else {
$socname = $thirdparty->name." - ".$thirdparty->name_alias;
}
}
} elseif ($thirdparty instanceof Contact) {
$socname = $thirdparty->socname;
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
// TODO PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME not completely implemented
}
} else {
throw new InvalidArgumentException('Parameter 1 $thirdparty is not a Societe nor Contact');
}

View File

@ -2168,7 +2168,7 @@ EmailTemplate=Template for email
EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax
PDF_SHOW_PROJECT=Show project on document
ShowProjectLabel=Project Label
PDF_THIRDPARTY_NAME_TO_SHOW_IS=Include alias in thirdparty name
PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME=Include alias in thirdparty name
THIRDPARTY_ALIAS=Name thirdparty - Alias thirdparty
ALIAS_THIRDPARTY=Alias thirdparty - Name thirdparty
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.