NEW #25594: can chose if VAT ID is unique or not for third parties

This commit is contained in:
Faustin 2022-10-15 22:42:15 +02:00
parent 388f55f056
commit 42d3d431a1

View File

@ -181,6 +181,20 @@ if ($action == "setaccountancycodecustomerinvoicemandatory") {
}
}
//Activate Set vat id unique
if ($action == "setvatintraunique") {
$setvatintraunique = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "SOCIETE_VAT_INTRA_UNIQUE", $setvatintraunique, '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 ref in list
if ($action == "setaddrefinlist") {
$setaddrefinlist = GETPOST('value', 'int');
@ -731,6 +745,22 @@ if (isModEnabled('accounting')) {
print "</tr>\n";
}
// VAT ID
print '<tr class="oddeven">';
print '<td colspan="2">'.$langs->trans('VATIntra')."</td>\n";
if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatintraunique&token='.newToken().'&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="center"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=setvatintraunique&token='.newToken().'&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '<td colspan="2"></td>';
print "</tr>\n";
print "</table>\n";
print '</div>';