Ver código fonte

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

Faustin 2 anos atrás
pai
commit
42d3d431a1
1 arquivos alterados com 30 adições e 0 exclusões
  1. 30 0
      htdocs/societe/admin/societe.php

+ 30 - 0
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 "</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>';