diff --git a/src/com/rjconsultores/ventaboletos/dao/AidfDAO.java b/src/com/rjconsultores/ventaboletos/dao/AidfDAO.java index f25473f2b..63d8476dc 100644 --- a/src/com/rjconsultores/ventaboletos/dao/AidfDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/AidfDAO.java @@ -17,7 +17,7 @@ public interface AidfDAO extends GenericDAO { public Boolean existeAidfComCodFiscalEEstado(Long idAidf, Integer especieId, String docFiscal, Estado estado); - public List buscaAidfRMD(Integer empresaId, Integer estadoId); + public List buscaAidfEstadoEmpresa(Integer empresaId, Integer estadoId,Boolean isRMD); public String buscaUltimoAidfRMDUtilizado(Long idAidf, Integer empresaId, Integer estadoId); diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/AidfHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/AidfHibernateDAO.java index e52b11ee1..afc4115d7 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/AidfHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/AidfHibernateDAO.java @@ -136,15 +136,17 @@ public class AidfHibernateDAO extends GenericHibernateDAO implements } @Override - public List buscaAidfRMD(Integer empresaId, Integer estadoId) { + public List buscaAidfEstadoEmpresa(Integer empresaId, Integer estadoId, Boolean isRMD) { StringBuilder sb = new StringBuilder(); sb.append(" from Aidf "); sb.append(" where activo = :activo "); sb.append(" and estado.estadoId = :estadoId "); sb.append(" and empresa.empresaId = :empresaId "); - sb.append(" and aidfEspecie.decespecie = 'RMD' "); - + if(isRMD){ + sb.append(" and aidfEspecie.decespecie = 'RMD' "); + } + Query query = getSession().createQuery(sb.toString()); query.setBoolean("activo", Boolean.TRUE); diff --git a/src/com/rjconsultores/ventaboletos/service/AidfService.java b/src/com/rjconsultores/ventaboletos/service/AidfService.java index b5bea01bd..04d9b9d3d 100644 --- a/src/com/rjconsultores/ventaboletos/service/AidfService.java +++ b/src/com/rjconsultores/ventaboletos/service/AidfService.java @@ -39,7 +39,7 @@ public interface AidfService { public Boolean validarVendaManual(Integer idTipo, String serie); - public List buscaAidfRMD(Integer empresaId, Integer estadoId); + public List buscaAidfEstadoEmpresa(Integer empresaId, Integer estadoId, Boolean isRMD); public String buscaUltimoAidfRMDUtilizado(Long idAidf, Integer empresaId, Integer estadoId); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/AidfServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/AidfServiceImpl.java index e9d84a964..38b9f0120 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/AidfServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/AidfServiceImpl.java @@ -132,8 +132,8 @@ public class AidfServiceImpl implements AidfService { } @Override - public List buscaAidfRMD(Integer empresaId, Integer estadoId) { - return aidfDAO.buscaAidfRMD(empresaId, estadoId); + public List buscaAidfEstadoEmpresa(Integer empresaId, Integer estadoId, Boolean isRMD) { + return aidfDAO.buscaAidfEstadoEmpresa(empresaId, estadoId, isRMD); } @Override