diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java index 0758ee2b4..8234bb156 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/BpeHibernateDAO.java @@ -36,7 +36,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { private static Logger log = Logger.getLogger(BpeHibernateDAO.class); private static final String DATE_FORMAT_DMY = "dd/MM/yyyy"; - private static final BigDecimal ZERO = BigDecimal.ZERO; @Autowired public BpeHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) { @@ -101,8 +100,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append(" left join empresa_imposto ei on ei.empresa_id = ep.empresa_id and ei.estado_id = e.estado_id "); sql.append("where c.activo = 1 and e.activo = 1 and ei.activo = 1 "); sql.append(" and bpe.tipoamb = 1 and ep.activo = 1 "); - // sql.append(" and bpe.errocontingencia is null "); - // sql.append(" and bpe.codstat <> 150 "); // não deve ser enviados os registros de contigencia sql.append(" and bpe.codstat in (100,135,150) "); sql.append(" and (tipoevento <> 110115 or tipoevento is null) "); sql.append(" and (case when ei.indtribviagem = 1 then c.fechorviaje else c.feccreacion end) >= to_date(?,'DD/MM/YYYY HH24:MI:SS') "); @@ -583,11 +580,9 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append(" coalesce(c.importeseguro, 0) as seguro, "); sql.append(" coalesce(c.importeoutros, 0) as outros, "); sql.append(" to_char(trunc(c.feccreacion), 'yyyymmdd') as datamov, "); - sql.append(" DBMS_LOB.substr(coalesce(bpe.xmlregular, bpe.xmlcontingencia), 3000) as xml_bpe, "); sql.append(" DBMS_LOB.substr(coalesce(bpe.xmlregular, bpe.xmlcontingencia), 3000, 3001) as xml_bpe_2, "); sql.append(" DBMS_LOB.substr(coalesce(bpe.xmlregular, bpe.xmlcontingencia), 3000, 6001) as xml_bpe_3 "); - sql.append("from boleto c "); sql.append(" join bpe bpe on c.boleto_id = bpe.boleto_id "); sql.append(" left join bpe bpecan on bpecan.chbpe = bpe.chbpe and bpecan.codstat = 135 and bpe.codstat = 100 and (bpecan.tipoevento = 110111 or bpecan.tipoevento is null) "); @@ -605,7 +600,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append(" inner join estado ed on ed.estado_id = cd.estado_id "); sql.append(" left join empresa_imposto ei on ei.empresa_id = ep.empresa_id and ei.estado_id = e.estado_id and ei.activo = 1 "); sql.append("where c.activo = 1 and bpe.tipoamb = 1 and bpe.codstat in (100,150) "); - sql.append(" and (bpe.tipoevento <> 110115 or bpe.tipoevento is null) "); sql.append(" and (to_char(bpe.fecmodif, 'mm/yyyy') < to_char(bpecan.fecmodif, 'mm/yyyy') or bpecan.fecmodif is null) "); sql.append(" and (case when ei.indtribviagem = 1 then c.fechorviaje else c.feccreacion end) >= :DATE_INICIO "); sql.append(" and (case when ei.indtribviagem = 1 then c.fechorviaje else c.feccreacion end) <= :DATE_FIM "); @@ -688,7 +682,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append("where ( (bpe.codstat in (100,135,150) and bpe.chbpe_substituicao is not null) "); sql.append(" or (bpe.codstat = 135 and to_char(b.feccreacion, 'mm/yyyy') < to_char(bori.feccreacion, 'mm/yyyy')) ) "); sql.append(" and (bpe.codstat in (100,135,150) and bpe.tipoevento <> 110115 or bpe.tipoevento is null) "); - sql.append(" and (bpe.codstat in (100,135,150) and bpeori.tipoevento <> 110115 or bpeori.tipoevento is null) "); + sql.append(" and (bpeori.codstat in (100,135,150) and bpeori.tipoevento <> 110115 or bpeori.tipoevento is null) "); sql.append(" and bori.feccreacion >= :DATE_INICIO "); sql.append(" and bori.feccreacion <= :DATE_FIM "); sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) "); @@ -771,7 +765,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO { sql.append("where "); sql.append(" (bpe.codstat = 135 and to_char(b.feccreacion, 'mm/yyyy') < to_char(bori.feccreacion, 'mm/yyyy')) "); sql.append(" and (bpe.codstat in (100,135,150) and bpe.tipoevento <> 110115 or bpe.tipoevento is null) "); - sql.append(" and (bpe.codstat in (100,135,150) and bpeori.tipoevento <> 110115 or bpeori.tipoevento is null) "); + sql.append(" and (bpeori.codstat in (100,135,150) and bpeori.tipoevento <> 110115 or bpeori.tipoevento is null) "); sql.append(" and bori.feccreacion >= :DATE_INICIO "); sql.append(" and bori.feccreacion <= :DATE_FIM "); sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) "); diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java index 7eb3f91fc..0ebc1256d 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java @@ -3801,7 +3801,6 @@ public class FiscalHibernateDAO extends HibernateDaoSupport implements FiscalDAO sql.append(" or (b.tipoventa_id in (12,18) and b.indstatusboleto = 'E' and b.numfoliosistema = b.numfoliopreimpreso)) "); sql.append(" and (b.motivocancelacion_id is null or b.motivocancelacion_id <> 35) "); sql.append(" and b.indcancelacion = 0 "); - sql.append(" and s.activo = 1 "); sql.append(" and b.empresacorrida_id = :EMPRESA_ID "); sql.append(" and b.feccreacion between :DATE_INICIO and :DATE_FIM "); sql.append(" and coalesce(ae.cveestado, e_ag.cveestado, eos.cveestado, eo.cveestado) = :CVEESTADO ");