Skip to content

Commit

Permalink
Corretto bug nella lettura di un avviso in modalita' anonima, il vers…
Browse files Browse the repository at this point in the history
…amento veniva messo in stato da pagare anche se era gia' stato pagato.
  • Loading branch information
pintorig committed Mar 3, 2022
1 parent e423125 commit e07f417
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import it.govpay.core.utils.IuvUtils;
import it.govpay.core.utils.SimpleDateFormatUtils;
import it.govpay.model.Utenza.TIPO_UTENZA;
import it.govpay.model.Versamento.StatoVersamento;

public class AvvisiDAO extends BaseDAO{

Expand Down Expand Up @@ -95,12 +96,15 @@ public GetAvvisoDTOResponse getAvviso(GetAvvisoDTO getAvvisoDTO, VersamentiBD ve
try {
it.govpay.bd.model.Versamento versamentoLetto = versamentiBD.getVersamento(versamentoFromSession.getIdApplicazione(), versamentoFromSession.getCodVersamentoEnte(), true);

versamentiBD.updateVersamento(versamentoFromSession, true);

if(versamentoFromSession.getId()==null)
versamentoFromSession.setId(versamentoLetto.getId());

ctx.getApplicationLogger().log("versamento.aggioramentoOk", versamentoFromSession.getApplicazione(configWrapper).getCodApplicazione(), versamentoFromSession.getCodVersamentoEnte());
// il versamento viene aggiornato solo se e' in stato aggiornabile
if(versamentoLetto.getStatoVersamento().equals(StatoVersamento.NON_ESEGUITO)) {
versamentiBD.updateVersamento(versamentoFromSession, true);

if(versamentoFromSession.getId()==null)
versamentoFromSession.setId(versamentoLetto.getId());

ctx.getApplicationLogger().log("versamento.aggioramentoOk", versamentoFromSession.getApplicazione(configWrapper).getCodApplicazione(), versamentoFromSession.getCodVersamentoEnte());
}
} catch (NotFoundException e) {
versamentiBD.insertVersamento(versamentoFromSession);
ctx.getApplicationLogger().log("versamento.inserimentoOk", versamentoFromSession.getApplicazione(configWrapper).getCodApplicazione(), versamentoFromSession.getCodVersamentoEnte());
Expand Down

0 comments on commit e07f417

Please sign in to comment.