bug#11600
dev: julio qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@85145 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
ba94cf1477
commit
69168e9c08
|
@ -36,7 +36,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
|
||||||
private static Logger log = Logger.getLogger(BpeHibernateDAO.class);
|
private static Logger log = Logger.getLogger(BpeHibernateDAO.class);
|
||||||
|
|
||||||
private static final String DATE_FORMAT_DMY = "dd/MM/yyyy";
|
private static final String DATE_FORMAT_DMY = "dd/MM/yyyy";
|
||||||
private static final BigDecimal ZERO = BigDecimal.ZERO;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public BpeHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
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(" 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("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.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 bpe.codstat in (100,135,150) ");
|
||||||
sql.append(" and (tipoevento <> 110115 or tipoevento is null) ");
|
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') ");
|
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.importeseguro, 0) as seguro, ");
|
||||||
sql.append(" coalesce(c.importeoutros, 0) as outros, ");
|
sql.append(" coalesce(c.importeoutros, 0) as outros, ");
|
||||||
sql.append(" to_char(trunc(c.feccreacion), 'yyyymmdd') as datamov, ");
|
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) 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, 3001) as xml_bpe_2, ");
|
||||||
sql.append(" DBMS_LOB.substr(coalesce(bpe.xmlregular, bpe.xmlcontingencia), 3000, 6001) as xml_bpe_3 ");
|
sql.append(" DBMS_LOB.substr(coalesce(bpe.xmlregular, bpe.xmlcontingencia), 3000, 6001) as xml_bpe_3 ");
|
||||||
|
|
||||||
sql.append("from boleto c ");
|
sql.append("from boleto c ");
|
||||||
sql.append(" join bpe bpe on c.boleto_id = bpe.boleto_id ");
|
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) ");
|
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(" 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(" 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("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 (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_INICIO ");
|
||||||
sql.append(" and (case when ei.indtribviagem = 1 then c.fechorviaje else c.feccreacion end) <= :DATE_FIM ");
|
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("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(" 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 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_INICIO ");
|
||||||
sql.append(" and bori.feccreacion <= :DATE_FIM ");
|
sql.append(" and bori.feccreacion <= :DATE_FIM ");
|
||||||
sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) ");
|
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("where ");
|
||||||
sql.append(" (bpe.codstat = 135 and to_char(b.feccreacion, 'mm/yyyy') < to_char(bori.feccreacion, 'mm/yyyy')) ");
|
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 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_INICIO ");
|
||||||
sql.append(" and bori.feccreacion <= :DATE_FIM ");
|
sql.append(" and bori.feccreacion <= :DATE_FIM ");
|
||||||
sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) ");
|
sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) ");
|
||||||
|
|
|
@ -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(" 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.motivocancelacion_id is null or b.motivocancelacion_id <> 35) ");
|
||||||
sql.append(" and b.indcancelacion = 0 ");
|
sql.append(" and b.indcancelacion = 0 ");
|
||||||
sql.append(" and s.activo = 1 ");
|
|
||||||
sql.append(" and b.empresacorrida_id = :EMPRESA_ID ");
|
sql.append(" and b.empresacorrida_id = :EMPRESA_ID ");
|
||||||
sql.append(" and b.feccreacion between :DATE_INICIO and :DATE_FIM ");
|
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 ");
|
sql.append(" and coalesce(ae.cveestado, e_ag.cveestado, eos.cveestado, eo.cveestado) = :CVEESTADO ");
|
||||||
|
|
Loading…
Reference in New Issue