diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 1532aeb8506..ce623313c7b 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -450,6 +450,15 @@ if (!empty($conf->use_javascript_ajax)) {
document.form_index.action.value="updateedit";
document.form_index.submit();
});
+
+ // Show/hide VAT exemption code field based on VAT option
+ $("input[name=\"optiontva\"]").change(function() {
+ if ($(this).val() == "0") {
+ $("#vat_exemption_code_div").show();
+ } else {
+ $("#vat_exemption_code_div").hide();
+ }
+ });
});';
print ''."\n";
}
@@ -781,14 +790,14 @@ if ($mysoc->country_code == 'FR') {
}
print '";
-print '
';
+print '
';
$placeholder = (($mysoc->country_code == 'FR') ? 'VATEX-FR-FRANCHISE' : '');
$tooltiptext = $langs->trans("VATExemptionCodeDesc").'
'.$langs->trans("VATExemptionCodeDesc2").'
'.$langs->trans("VATExemptionCodeDesc3");
if (($mysoc->country_code == 'FR')) {
$tooltiptext .= '
'.$langs->trans("Example").':
';
$tooltiptext .= 'VATEX-FR-FRANCHISE, VATEX-FR-CGI261-4, VATEX-FR-J, VATEX-FR-I, VATEX-FR-D, ...';
}
-print $form->textwithpicto($langs->trans("VATExemptionCode"), $tooltiptext, 1, 'help', 'valignmiddle', 0, 3, 'exemptioncode').' ';
+print $form->textwithpicto($langs->trans("VATExemptionCode"), $tooltiptext, 1, 'help', 'valignmiddle', 0, 3, 'exemptioncode').' ';
print '
';
print "\n";