Fix pr-banche-bic-non-obbligatorio

This commit is contained in:
Luca 2023-03-23 18:19:13 +01:00
parent ec53c0ac31
commit 0f60af2713
3 changed files with 7 additions and 2 deletions

View File

@ -102,6 +102,7 @@ switch (filter('op')) {
echo json_encode([
'id_nazione' => [
'id' => $nazione->id,
'iso2' => $nazione->iso2,
'text' => $nazione->nome,
],
'bank_code' => $iban->getBankCode(),

View File

@ -119,10 +119,12 @@ echo '
success: function (response) {
compilaCampi(response);
if (response.id_nazione.text === "Italia"){
if (response.id_nazione.iso2 === "IT"){
bic.setRequired(false);
$("label[for=bic]").html('<?php echo tr('BIC'); ?>');
} else {
bic.setRequired(true);
$("label[for=bic]").html('<?php echo tr('BIC'); ?><span class="text-red">*</span>');
}
},
error: function() {

View File

@ -192,10 +192,12 @@ if (!empty($numero_documenti)) {
success: function (response) {
compilaCampi(response);
if (response.id_nazione.text === "Italia"){
if (response.id_nazione.iso2 === "IT"){
bic.setRequired(false);
$("label[for=bic]").html('<?php echo tr('BIC'); ?>');
} else {
bic.setRequired(true);
$("label[for=bic]").html('<?php echo tr('BIC'); ?><span class="text-red">*</span>');
}
},
error: function() {