Correção da validação nosso numero sicoob fix bug#AL-3124

master
Fabio Faria 2023-08-24 09:39:33 -03:00
parent cd283d078a
commit 2e8e906f9a
2 changed files with 5 additions and 9 deletions

View File

@ -175,7 +175,7 @@
<dependency> <dependency>
<groupId>br.com.rjconsultores</groupId> <groupId>br.com.rjconsultores</groupId>
<artifactId>GeneradorBoletosCNAB</artifactId> <artifactId>GeneradorBoletosCNAB</artifactId>
<version>1.1.0</version> <version>1.1.2</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -111,25 +111,21 @@ public class ArquivoRemessaCNABImpl implements ArquivoRemessaCNAB {
public boolean boletosOk(List<FechamentoBoleto> boletos) { public boolean boletosOk(List<FechamentoBoleto> boletos) {
BancoLayout banco = null; BancoLayout banco = null;
boolean toReturn = Boolean.TRUE;
if(boletos != null && !boletos.isEmpty()) { if(boletos != null && !boletos.isEmpty()) {
for (java.util.Iterator<FechamentoBoleto> it = boletos.iterator(); it.hasNext();) { for (FechamentoBoleto fechamentoBoleto : boletos) {
FechamentoBoleto fechamentoBoleto = it.next();
if(banco == null){ if(banco == null){
banco = BancoLayout.getInstanceByCodBanco(remessaCNABBancosDAO.findBanco(fechamentoBoleto.getFechamentoCntcorrente().getEmpresa())); banco = BancoLayout.getInstanceByCodBanco(remessaCNABBancosDAO.findBanco(fechamentoBoleto.getFechamentoCntcorrente().getEmpresa()));
} }
if(!NossoNumeroUtils.validaNossoNumero(fechamentoBoleto.getNossonumero(), banco)){ if(!NossoNumeroUtils.validaNossoNumero(fechamentoBoleto.getNossonumero(), banco)){
it.remove(); return false;
toReturn = Boolean.FALSE;
} }
} }
} }
return toReturn; return true;
} }
@Override @Override