From 42d3d431a18e88b7d0f6ccd39e987d156a0656a3 Mon Sep 17 00:00:00 2001 From: Faustin Date: Sat, 15 Oct 2022 22:42:15 +0200 Subject: [PATCH] NEW #25594: can chose if VAT ID is unique or not for third parties --- htdocs/societe/admin/societe.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 76fd9297e2b..d466f1fe9a7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -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 "\n"; } +// VAT ID +print ''; +print ''.$langs->trans('VATIntra')."\n"; + +if (!empty($conf->global->SOCIETE_VAT_INTRA_UNIQUE)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ''; +} else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; +} +print ''; +print "\n"; + print "\n"; print '';