Skip to content

Commit

Permalink
643 keyword speciali da non stampare negli avvisi di pagamento (#647)
Browse files Browse the repository at this point in the history
* Issue #643
Aggiunta gestione dell'identificativo debitore anonimo nel caso non si voglia stampare all'interno dell'avviso di pagamento.
E' stata aggiunta la possibilita' di definire un elenco di keyword che identificano il debitore anonimo che non si vogliono stampare.

* Issue #643
Configurato valore di default per la proprieta
it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword.
  • Loading branch information
pintorig committed Oct 26, 2023
1 parent 03fa0cb commit ff3f798
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ear/src/main/application/properties/govpay.properties
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ it.govpay.checkout.enabled=${it.govpay.checkout.enabled}
it.govpay.checkout.baseUrl=${it.govpay.checkout.baseUrl}


# Govpay Stampe

# Lista di keyword che se individuate all'interno dei campi CF e Anagrafica Debitore vengono sostituite con stringa vuota (separati da ',')
it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword=${it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword}


# Configurazione CORS

# Indica se loggare gli errori CORS con severita' DEBUG al posto di ERROR.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ it.govpay.checkout.enabled=${it.govpay.checkout.enabled}
it.govpay.checkout.baseUrl=${it.govpay.checkout.baseUrl}


# Govpay Stampe

# Lista di keyword che se individuate all'interno dei campi CF e Anagrafica Debitore vengono sostituite con stringa vuota (separati da ',')
it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword=${it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword}


# Configurazione CORS

# Indica se loggare gli errori CORS con severita' DEBUG al posto di ERROR.
Expand Down
16 changes: 16 additions & 0 deletions jars/core/src/main/java/it/govpay/core/utils/GovpayConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public static GovpayConfig newInstance(InputStream is) throws Exception {
private boolean batchSpedizioneNotificheAppIO;
private boolean batchSpedizionePromemoria;

private List<String> keywordsDaSostituireIdentificativiDebitoreAvviso;


public GovpayConfig(InputStream is) throws Exception {
// Default values:
Expand Down Expand Up @@ -287,6 +289,8 @@ public GovpayConfig(InputStream is) throws Exception {

this.numeroGiorniValiditaPendenza = null;

this.keywordsDaSostituireIdentificativiDebitoreAvviso = new ArrayList<>();

this.batchRecuperoRPTPendenti = false;
this.batchAcquisizioneRendicontazioni = false;
this.batchChiusuraRPTScadute = false;
Expand Down Expand Up @@ -890,6 +894,14 @@ public void readProperties() throws ConfigException {
if(batchSpedizionePromemoriaString != null && Boolean.valueOf(batchSpedizionePromemoriaString))
this.batchSpedizionePromemoria = true;

String keywordsS = getProperty("it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword", props, false, log);
if(StringUtils.isNotEmpty(keywordsS)) {
String[] split = keywordsS.split(",");
if(split != null && split.length > 0) {
this.keywordsDaSostituireIdentificativiDebitoreAvviso = Arrays.asList(split);
}
}

} catch (PropertyNotFoundException e) {
log.error(MessageFormat.format("Errore di inizializzazione: {0}", e.getMessage()));
throw new ConfigException(e);
Expand Down Expand Up @@ -1358,5 +1370,9 @@ public boolean isBatchSpedizioneNotificheAppIO() {
public boolean isBatchSpedizionePromemoria() {
return batchSpedizionePromemoria;
}

public List<String> getKeywordsDaSostituireIdentificativiDebitoreAvviso() {
return keywordsDaSostituireIdentificativiDebitoreAvviso;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import it.govpay.core.business.model.PrintAvvisoDocumentoDTO;
import it.govpay.core.business.model.PrintAvvisoVersamentoDTO;
import it.govpay.core.exceptions.UnprocessableEntityException;
import it.govpay.core.utils.GovpayConfig;
import it.govpay.core.utils.IuvUtils;
import it.govpay.core.utils.LabelAvvisiProperties;
import it.govpay.core.utils.VersamentoUtils;
Expand Down Expand Up @@ -593,11 +594,35 @@ public static void impostaAnagraficaDebitore(Anagrafica anagraficaDebitore, Avvi
String capCittaDebitore = StringUtils.isNotEmpty(localitaDebitore) ? (capDebitore + " " + localitaDebitore + provinciaDebitore) : "";

input.setNomeCognomeDestinatario(anagraficaDebitore.getRagioneSociale());
input.setCfDestinatario(anagraficaDebitore.getCodUnivoco().toUpperCase());
if(anagraficaDebitore.getCodUnivoco() != null) {
input.setCfDestinatario(anagraficaDebitore.getCodUnivoco().toUpperCase());
}

input.setIndirizzoDestinatario1(indirizzoDestinatario);

input.setIndirizzoDestinatario2(capCittaDebitore);

// Modifica per la sostituzione dei valori impostati negli identificativi del debitore con stringa vuota se
// questi coincidono con una delle keyword indicate nelle proprieta' di sistema
List<String> keywordsDaSostituireIdentificativiDebitoreAvviso = GovpayConfig.getInstance().getKeywordsDaSostituireIdentificativiDebitoreAvviso();
if(keywordsDaSostituireIdentificativiDebitoreAvviso != null) {
if(input.getCfDestinatario() != null) {
for (String keyword : keywordsDaSostituireIdentificativiDebitoreAvviso) {
if(keyword.equalsIgnoreCase(input.getCfDestinatario())) {
input.setCfDestinatario("");
break;
}
}
}

if(input.getNomeCognomeDestinatario() != null) {
for (String keyword : keywordsDaSostituireIdentificativiDebitoreAvviso) {
if(keyword.equalsIgnoreCase(input.getNomeCognomeDestinatario())) {
input.setNomeCognomeDestinatario("");
break;
}
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import it.govpay.core.business.model.PrintAvvisoVersamentoDTO;
import it.govpay.core.exceptions.InvalidSwitchValueException;
import it.govpay.core.exceptions.UnprocessableEntityException;
import it.govpay.core.utils.GovpayConfig;
import it.govpay.core.utils.IuvUtils;
import it.govpay.core.utils.LabelAvvisiProperties;
import it.govpay.core.utils.VersamentoUtils;
Expand Down Expand Up @@ -603,11 +604,35 @@ public static void impostaAnagraficaDebitore(Anagrafica anagraficaDebitore, Avvi
String capCittaDebitore = StringUtils.isNotEmpty(localitaDebitore) ? (capDebitore + " " + localitaDebitore + provinciaDebitore) : "";

input.setNomeCognomeDestinatario(anagraficaDebitore.getRagioneSociale());
input.setCfDestinatario(anagraficaDebitore.getCodUnivoco().toUpperCase());
if(anagraficaDebitore.getCodUnivoco() != null) {
input.setCfDestinatario(anagraficaDebitore.getCodUnivoco().toUpperCase());
}

input.setIndirizzoDestinatario1(indirizzoDestinatario);

input.setIndirizzoDestinatario2(capCittaDebitore);

// Modifica per la sostituzione dei valori impostati negli identificativi del debitore con stringa vuota se
// questi coincidono con una delle keyword indicate nelle proprieta' di sistema
List<String> keywordsDaSostituireIdentificativiDebitoreAvviso = GovpayConfig.getInstance().getKeywordsDaSostituireIdentificativiDebitoreAvviso();
if(keywordsDaSostituireIdentificativiDebitoreAvviso != null) {
if(input.getCfDestinatario() != null) {
for (String keyword : keywordsDaSostituireIdentificativiDebitoreAvviso) {
if(keyword.equalsIgnoreCase(input.getCfDestinatario())) {
input.setCfDestinatario("");
break;
}
}
}

if(input.getNomeCognomeDestinatario() != null) {
for (String keyword : keywordsDaSostituireIdentificativiDebitoreAvviso) {
if(keyword.equalsIgnoreCase(input.getNomeCognomeDestinatario())) {
input.setNomeCognomeDestinatario("");
break;
}
}
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ it.govpay.backoffice.gui.export.polling=15000
# ambiente di deploy (lasciare vuoto in ambiente di produzione)
it.govpay.backoffice.gui.ambienteDeploy=


# Govpay Stampe

# Lista di keyword che se individuate all'interno dei campi CF e Anagrafica Debitore vengono sostituite con stringa vuota (separati da ',')
it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword=


# Configurazione CORS

# Indica se loggare gli errori CORS con severita' DEBUG al posto di ERROR.
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/filters/template.filter.properties
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,13 @@ it.govpay.backoffice.gui.export.polling=15000
# ambiente di deploy, viene mostrato come sfondo della console
it.govpay.backoffice.gui.ambienteDeploy=


# Govpay Stampe

# Lista di keyword che se individuate all'interno dei campi CF e Anagrafica Debitore vengono sostituite con stringa vuota (separati da ',')
it.govpay.stampe.avvisoPagamento.identificativoDebitore.nascondiKeyword=


# Configurazione CORS

# Indica se loggare gli errori CORS con severita' DEBUG al posto di ERROR.
Expand Down

0 comments on commit ff3f798

Please sign in to comment.