From 97985a52124391dee679a04d5d912a73a8bbb00f Mon Sep 17 00:00:00 2001 From: "Emanuele \"ToX\" Toscano" Date: Tue, 21 Mar 2023 18:32:51 +0100 Subject: [PATCH] =?UTF-8?q?Rendere=20il=20bic=20obbligatorio=20solo=20se?= =?UTF-8?q?=20nazione=20non=20=C3=A8=20Italia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/banche/add.php | 7 +++++++ modules/banche/edit.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/modules/banche/add.php b/modules/banche/add.php index 5744b643d..91c3613a6 100755 --- a/modules/banche/add.php +++ b/modules/banche/add.php @@ -76,6 +76,7 @@ echo ' var branch_code = input("branch_code"); var bank_code = input("bank_code"); var id_nazione = input("id_nazione"); + var bic = input("bic"); var components = [branch_code, bank_code, id_nazione]; @@ -117,6 +118,12 @@ echo ' dataType: "json", success: function (response) { compilaCampi(response); + + if (response.id_nazione.text === "Italia"){ + bic.setRequired(false); + } else { + bic.setRequired(true); + } }, error: function() { toastr["error"](""); diff --git a/modules/banche/edit.php b/modules/banche/edit.php index f1c66be7b..63e62cb0e 100644 --- a/modules/banche/edit.php +++ b/modules/banche/edit.php @@ -149,6 +149,7 @@ if (!empty($numero_documenti)) { var check_digits = input("check_digits"); var national_check_digits = input("national_check_digits"); var id_nazione = input("id_nazione"); + var bic = input("bic"); var components = [branch_code, bank_code, account_number, check_digits, national_check_digits, id_nazione]; @@ -190,6 +191,12 @@ if (!empty($numero_documenti)) { dataType: "json", success: function (response) { compilaCampi(response); + + if (response.id_nazione.text === "Italia"){ + bic.setRequired(false); + } else { + bic.setRequired(true); + } }, error: function() { toastr["error"]("");