Merge pull request #18915 from vincentjdc/vat-number-societe-list

NEW Add `SOCIETE_SHOW_VAT_IN_LIST` to display VAT number in combo list of thirdparties
This commit is contained in:
Laurent Destailleur 2021-10-06 15:33:46 +02:00 committed by GitHub
commit 7e0ec949c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 11 deletions

View File

@ -1268,6 +1268,7 @@ class Form
$selected_input_value = $societetmp->name; $selected_input_value = $societetmp->name;
unset($societetmp); unset($societetmp);
} }
// mode 1 // mode 1
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : ''); $urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions); $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
@ -1443,6 +1444,10 @@ class Form
$label .= ' ('.$obj->name_alias.')'; $label .= ' ('.$obj->name_alias.')';
} }
if ($conf->global->SOCIETE_SHOW_VAT_IN_LIST && !empty($obj->tva_intra)) {
$label .= ' - '.$obj->tva_intra.'';
}
if ($showtype) { if ($showtype) {
if ($obj->client || $obj->fournisseur) { if ($obj->client || $obj->fournisseur) {
$label .= ' ('; $label .= ' (';

View File

@ -1042,7 +1042,7 @@ DictionaryFees=Expense report - Types of expense report lines
DictionarySendingMethods=Shipping methods DictionarySendingMethods=Shipping methods
DictionaryStaff=Number of Employees DictionaryStaff=Number of Employees
DictionaryAvailability=Delivery delay DictionaryAvailability=Delivery delay
DictionaryOrderMethods=Ordering methods DictionaryOrderMethods=Order methods
DictionarySource=Origin of proposals/orders DictionarySource=Origin of proposals/orders
DictionaryAccountancyCategory=Personalized groups for reports DictionaryAccountancyCategory=Personalized groups for reports
DictionaryAccountancysystem=Models for chart of accounts DictionaryAccountancysystem=Models for chart of accounts
@ -1349,6 +1349,7 @@ BrowserIsKO=You are using the %s web browser. This browser is known to be a bad
PHPModuleLoaded=PHP component %s is loaded PHPModuleLoaded=PHP component %s is loaded
PreloadOPCode=Preloaded OPCode is used PreloadOPCode=Preloaded OPCode is used
AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp". AddRefInList=Display Customer/Vendor ref. info list (select list or combobox) and most of hyperlink.<br>Third Parties will appear with a name format of "CC12345 - SC45678 - The Big Company corp." instead of "The Big Company corp".
AddVatInList=Display Customer/Vendor VAT number. info list (select list or combobox).
AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp". AddAdressInList=Display Customer/Vendor adress info list (select list or combobox)<br>Third Parties will appear with a name format of "The Big Company corp. - 21 jump street 123456 Big town - USA" instead of "The Big Company corp".
AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)<br>Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand". AddEmailPhoneTownInContactList=Display Contact email (or phones if not defined) and town info list (select list or combobox)<br>Contacts will appear with a name format of "Dupond Durand - dupond.durand@email.com - Paris" or "Dupond Durand - 06 07 59 65 66 - Paris" instead of "Dupond Durand".
AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties. AskForPreferredShippingMethod=Ask for preferred shipping method for Third Parties.

View File

@ -1341,6 +1341,7 @@ BrowserIsKO=Vous utilisez le navigateur %s. Ce navigateur est déconseillé pour
PHPModuleLoaded=Le composant PHP %s est chargé PHPModuleLoaded=Le composant PHP %s est chargé
PreloadOPCode=Le code OP préchargé est utilisé PreloadOPCode=Le code OP préchargé est utilisé
AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.<br>Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp". AddRefInList=Afficher les références client/fournisseur dans les listes (listes déroulantes ou à autocomplétion) et les libellés des liens clicables.<br>Les tiers apparaîtront alors sous la forme "CC12345 - SC45678 - La big company coorp", au lieu de "La big company coorp".
AddVatInList=Afficher le numéro de TVA client/fournisseur dans les listes (listes déroulantes ou à autocomplétion).
AddAdressInList=Affiche les informations sur l’adresse du client/fournisseur (liste de sélection ou liste déroulante) <br> Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp". AddAdressInList=Affiche les informations sur l’adresse du client/fournisseur (liste de sélection ou liste déroulante) <br> Les tiers apparaîtront avec le format de nom suivant: "The Big Company corp. - 21, rue du saut 123456 Big town - USA" au lieu de "The Big Company corp".
AddEmailPhoneTownInContactList=Afficher l'adresse e-mail du contact (ou les téléphones si non définis) et la ville <br> Les contacts apparaîtront avec un nom au format "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand". AddEmailPhoneTownInContactList=Afficher l'adresse e-mail du contact (ou les téléphones si non définis) et la ville <br> Les contacts apparaîtront avec un nom au format "Dupond Durand - dupond.durand@email.com - Paris" ou "Dupond Durand - 06 07 59 65 66 - Paris" au lieu de "Dupond Durand".
AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers AskForPreferredShippingMethod=Demander la méthode d'expédition préférée pour les Tiers

View File

@ -183,6 +183,20 @@ if ($action == "setaddrefinlist") {
} }
} }
//Activate Set vat in list
if ($action == "setvatinlist") {
$setvatinlist = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SOCIETE_SHOW_VAT_IN_LIST", $setvatinlist, 'yesno', 0, '', $conf->entity);
if (!($res > 0)) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'errors');
}
}
//Activate Set adress in list //Activate Set adress in list
if ($action == "setaddadressinlist") { if ($action == "setaddadressinlist") {
$val = GETPOST('value', 'int'); $val = GETPOST('value', 'int');
@ -776,6 +790,20 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) {
print '</a></td>'; print '</a></td>';
print '</tr>'; print '</tr>';
print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("AddVatInList").'</td>';
print '<td>&nbsp;</td>';
print '<td class="center">';
if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST)) {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatinlist&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
}
print '</a></td>';
print '</tr>';
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td width="80%">'.$langs->trans("AddAdressInList").'</td>'; print '<td width="80%">'.$langs->trans("AddAdressInList").'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';