NEW - Compléte function pdfBuildThirdpartyName to use company name of contact
This commit is contained in:
parent
035c08536c
commit
cacb642bc0
@ -174,7 +174,9 @@ if ($action == 'update') {
|
|||||||
if (GETPOSTISSET('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) {
|
if (GETPOSTISSET('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) {
|
||||||
dolibarr_set_const($db, "PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", GETPOST('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME", GETPOST('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
if (GETPOSTISSET('MAIN_USE_COMPANY_NAME_OF_CONTACT')) {
|
||||||
|
dolibarr_set_const($db, "MAIN_USE_COMPANY_NAME_OF_CONTACT", GETPOST('MAIN_USE_COMPANY_NAME_OF_CONTACT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
}
|
||||||
if (GETPOSTISSET('PDF_USE_A')) {
|
if (GETPOSTISSET('PDF_USE_A')) {
|
||||||
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
@ -399,6 +401,21 @@ if ($conf->use_javascript_ajax) {
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Show alias in thirdparty name
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
$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'));
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_USE_COMPANY_NAME_OF_CONTACT").'</td><td>';
|
||||||
|
if ($conf->use_javascript_ajax) {
|
||||||
|
print ajax_constantonoff('MAIN_USE_COMPANY_NAME_OF_CONTACT');
|
||||||
|
} else {
|
||||||
|
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||||
|
print $form->selectarray("MAIN_USE_COMPANY_NAME_OF_CONTACT", $arrval, $conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT);
|
||||||
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
|
||||||
@ -585,16 +602,6 @@ if ($conf->use_javascript_ajax) {
|
|||||||
print $form->selectarray("DOC_SHOW_FIRST_SALES_REP", $arrval, $conf->global->DOC_SHOW_FIRST_SALES_REP);
|
print $form->selectarray("DOC_SHOW_FIRST_SALES_REP", $arrval, $conf->global->DOC_SHOW_FIRST_SALES_REP);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show alias in thirdparty name
|
|
||||||
|
|
||||||
/* 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' => $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
|
// Show online payment link on invoices
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_LINK_TO_ONLINE_PAYMENT").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_LINK_TO_ONLINE_PAYMENT").'</td><td>';
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2015-2016 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2019 Lenin Rivas <lenin.rivas@servcom-it.com>
|
* Copyright (C) 2019 Lenin Rivas <lenin.rivas@servcom-it.com>
|
||||||
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
* Copyright (C) 2020 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||||
* Copyright (C) 2021-2022 Anthony Berton <bertonanthony@gmail.com>
|
* Copyright (C) 2021-2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -400,9 +400,15 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($thirdparty instanceof Contact) {
|
} elseif ($thirdparty instanceof Contact) {
|
||||||
$socname = $thirdparty->socname;
|
$thirdparty->fetch_thirdparty();
|
||||||
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
|
$socname = $thirdparty->thirdparty->name;
|
||||||
|
if (($includealias || getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->thirdparty->name_alias)) {
|
||||||
// TODO PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME not completely implemented
|
// TODO PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME not completely implemented
|
||||||
|
if (getDolGlobalInt('PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME') == 2) {
|
||||||
|
$socname = $thirdparty->thirdparty->name_alias." - ".$thirdparty->thirdparty->name;
|
||||||
|
} else {
|
||||||
|
$socname = $thirdparty->thirdparty->name." - ".$thirdparty->thirdparty->name_alias;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('Parameter 1 $thirdparty is not a Societe nor Contact');
|
throw new InvalidArgumentException('Parameter 1 $thirdparty is not a Societe nor Contact');
|
||||||
|
|||||||
@ -2189,6 +2189,7 @@ ShowProjectLabel=Libellé du projet
|
|||||||
PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME=Inclure un alias dans le nom du tiers
|
PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME=Inclure un alias dans le nom du tiers
|
||||||
THIRDPARTY_ALIAS=Nom du tiers - Alias du tiers
|
THIRDPARTY_ALIAS=Nom du tiers - Alias du tiers
|
||||||
ALIAS_THIRDPARTY=Alias du tiers - Nom du tiers
|
ALIAS_THIRDPARTY=Alias du tiers - Nom du tiers
|
||||||
|
MAIN_USE_COMPANY_NAME_OF_CONTACT=Use company name of contact
|
||||||
PDF_USE_ALSO_LANGUAGE_CODE=Si vous souhaitez que certains textes de votre PDF soient dupliqués dans 2 langues différentes dans le même PDF généré, vous devez définir ici cette deuxième langue pour que le PDF généré contienne 2 langues différentes dans la même page, celle choisie lors de la génération du PDF et celle-ci (seuls quelques modèles PDF prennent en charge cette fonction). Gardez vide pour 1 langue par PDF.
|
PDF_USE_ALSO_LANGUAGE_CODE=Si vous souhaitez que certains textes de votre PDF soient dupliqués dans 2 langues différentes dans le même PDF généré, vous devez définir ici cette deuxième langue pour que le PDF généré contienne 2 langues différentes dans la même page, celle choisie lors de la génération du PDF et celle-ci (seuls quelques modèles PDF prennent en charge cette fonction). Gardez vide pour 1 langue par PDF.
|
||||||
PDF_USE_A=Générer document PDF avec le format PDF/A à la place du format PDF standard
|
PDF_USE_A=Générer document PDF avec le format PDF/A à la place du format PDF standard
|
||||||
FafaIconSocialNetworksDesc=Entrez ici le code d'une icône FontAwesome. Si vous ne savez pas ce qu'est FontAwesome, vous pouvez utiliser la valeur générique fa-address-book.
|
FafaIconSocialNetworksDesc=Entrez ici le code d'une icône FontAwesome. Si vous ne savez pas ce qu'est FontAwesome, vous pouvez utiliser la valeur générique fa-address-book.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user