diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/RemessaCNABBancosHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/RemessaCNABBancosHibernateDAO.java index 9b9c6d8bb..597e3894f 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/RemessaCNABBancosHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/RemessaCNABBancosHibernateDAO.java @@ -89,10 +89,10 @@ public class RemessaCNABBancosHibernateDAO extends GenericHibernateDAO boletos) { BancoLayout banco = null; + boolean toReturn = Boolean.TRUE; - for (FechamentoBoleto fechamentoBoleto : boletos) { + for (java.util.Iterator it = boletos.iterator(); it.hasNext();) { + + FechamentoBoleto fechamentoBoleto = it.next(); if(banco == null){ banco = BancoLayout.getInstanceByCodBanco(remessaCNABBancosDAO.findBanco(fechamentoBoleto.getFechamentoCntcorrente().getEmpresa())); } if(!NossoNumeroUtils.validaNossoNumero(fechamentoBoleto.getNossonumero(), banco)){ - return Boolean.FALSE; + it.remove(); + toReturn = Boolean.FALSE; } } - return Boolean.TRUE; + return toReturn; } }