mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Ask and validate VAT IDs for Switzerland (#2259)
Co-authored-by: Richard Schreiber <schreiber@rami.io>
This commit is contained in:
@@ -355,14 +355,14 @@ var form_handlers = function (el) {
|
||||
dependency.closest('.form-group').find('input[name=' + dependency.attr("name") + ']').on("dp.change", update);
|
||||
});
|
||||
|
||||
$("input[name$=vat_id][data-countries-in-eu]").each(function () {
|
||||
$("input[name$=vat_id][data-countries-with-vat-id]").each(function () {
|
||||
var dependent = $(this),
|
||||
dependency_country = $(this).closest(".panel-body, form").find('select[name$=country]'),
|
||||
dependency_id_is_business_1 = $(this).closest(".panel-body, form").find('input[id$=id_is_business_1]'),
|
||||
update = function (ev) {
|
||||
if (dependency_id_is_business_1.length && !dependency_id_is_business_1.prop("checked")) {
|
||||
dependent.closest(".form-group").hide();
|
||||
} else if (dependent.attr('data-countries-in-eu').split(',').includes(dependency_country.val())) {
|
||||
} else if (dependent.attr('data-countries-with-vat-id').split(',').includes(dependency_country.val())) {
|
||||
dependent.closest(".form-group").show();
|
||||
} else {
|
||||
dependent.closest(".form-group").hide();
|
||||
|
||||
@@ -403,14 +403,14 @@ $(function () {
|
||||
dependency.closest('.form-group, form').find('input[name=' + dependency.attr("name") + ']').on("dp.change", update);
|
||||
});
|
||||
|
||||
$("input[name$=vat_id][data-countries-in-eu]").each(function () {
|
||||
$("input[name$=vat_id][data-countries-with-vat-id]").each(function () {
|
||||
var dependent = $(this),
|
||||
dependency_country = $(this).closest(".panel-body, form").find('select[name$=country]'),
|
||||
dependency_id_is_business_1 = $(this).closest(".panel-body, form").find('input[id$=id_is_business_1]'),
|
||||
update = function (ev) {
|
||||
if (dependency_id_is_business_1.length && !dependency_id_is_business_1.prop("checked")) {
|
||||
dependent.closest(".form-group").hide();
|
||||
} else if (dependent.attr('data-countries-in-eu').split(',').includes(dependency_country.val())) {
|
||||
} else if (dependent.attr('data-countries-with-vat-id').split(',').includes(dependency_country.val())) {
|
||||
dependent.closest(".form-group").show();
|
||||
} else {
|
||||
dependent.closest(".form-group").hide();
|
||||
|
||||
Reference in New Issue
Block a user