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>
<groupId>br.com.rjconsultores</groupId>
<artifactId>GeneradorBoletosCNAB</artifactId>
<version>1.1.0</version>
<version>1.1.2</version>
</dependency>
<dependency>

View File

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