Merge pull request #1254 from gktgroup/pr-banche-bic-non-obbligatorio

Gestire l'obbligatorietà del campo BIC in gestione banche
This commit is contained in:
Valentina 2023-03-22 17:51:33 +01:00 committed by GitHub
commit ec53c0ac31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -76,6 +76,7 @@ echo '
var branch_code = input("branch_code"); var branch_code = input("branch_code");
var bank_code = input("bank_code"); var bank_code = input("bank_code");
var id_nazione = input("id_nazione"); var id_nazione = input("id_nazione");
var bic = input("bic");
var components = [branch_code, bank_code, id_nazione]; var components = [branch_code, bank_code, id_nazione];
@ -117,6 +118,12 @@ echo '
dataType: "json", dataType: "json",
success: function (response) { success: function (response) {
compilaCampi(response); compilaCampi(response);
if (response.id_nazione.text === "Italia"){
bic.setRequired(false);
} else {
bic.setRequired(true);
}
}, },
error: function() { error: function() {
toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>"); toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>");

View File

@ -60,7 +60,7 @@ include_once __DIR__.'/../../core.php';
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
{[ "type": "text", "label": "<?php echo tr('BIC'); ?>", "name": "bic", "required": "1", "class": "alphanumeric-mask", "minlength": 8, "maxlength": 11, "value": "$bic$", "help": "<?php echo $help_codice_bic; ?>" ]} {[ "type": "text", "label": "<?php echo tr('BIC'); ?>", "name": "bic", "class": "alphanumeric-mask", "minlength": 8, "maxlength": 11, "value": "$bic$", "help": "<?php echo $help_codice_bic; ?>" ]}
</div> </div>
</div> </div>
@ -149,6 +149,7 @@ if (!empty($numero_documenti)) {
var check_digits = input("check_digits"); var check_digits = input("check_digits");
var national_check_digits = input("national_check_digits"); var national_check_digits = input("national_check_digits");
var id_nazione = input("id_nazione"); 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]; 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", dataType: "json",
success: function (response) { success: function (response) {
compilaCampi(response); compilaCampi(response);
if (response.id_nazione.text === "Italia"){
bic.setRequired(false);
} else {
bic.setRequired(true);
}
}, },
error: function() { error: function() {
toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>"); toastr["error"]("<?php echo tr('Formato IBAN non valido'); ?>");