bug#11600

dev: julio
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@84273 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2018-08-15 18:05:33 +00:00
parent 03f45f5dd5
commit b49459335d
1 changed files with 3 additions and 7 deletions

View File

@ -50,7 +50,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
StringBuilder sql = new StringBuilder(); StringBuilder sql = new StringBuilder();
sql.append("select distinct "); sql.append("select distinct ");
sql.append(" c.boleto_id, "); sql.append(" c.boleto_id, ");
sql.append(" c.num_bpe, "); sql.append(" coalesce(c.num_bpe, c.numfoliosistema) as num_bpe, ");
sql.append(" c.numfoliosistema as numfoliosistema, "); sql.append(" c.numfoliosistema as numfoliosistema, ");
sql.append(" coalesce(c.preciopagado,0) + coalesce(c.importetaxaembarque,0) + coalesce(c.importeseguro,0) + coalesce(c.importepedagio,0) + coalesce(c.importeoutros,0) as valortotal, "); sql.append(" coalesce(c.preciopagado,0) + coalesce(c.importetaxaembarque,0) + coalesce(c.importeseguro,0) + coalesce(c.importepedagio,0) + coalesce(c.importeoutros,0) as valortotal, ");
sql.append(" bpe.codstat as codstatus, "); sql.append(" bpe.codstat as codstatus, ");
@ -99,13 +99,14 @@ 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 <> 150 "); // não deve ser enviados os registros de contigencia
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') ");
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')");
sql.append(" and ep.empresa_id = ? "); sql.append(" and ep.empresa_id = ? ");
sql.append(" and e.cveestado = ? "); sql.append(" and e.cveestado = ? ");
sql.append("order by to_number(c.numfoliosistema), to_number(c.num_bpe), dhrecbto "); sql.append("order by to_number(c.numfoliosistema), to_number(num_bpe), dhrecbto ");
try { try {
PreparedStatement ps = connection.prepareStatement(sql.toString()); PreparedStatement ps = connection.prepareStatement(sql.toString());
@ -227,11 +228,6 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000) as xml_bpe, "); sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000) as xml_bpe, ");
sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000, 3001) as xml_bpe_2, "); sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000, 3001) as xml_bpe_2, ");
sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000, 6001) as xml_bpe_3 "); sql.append(" DBMS_LOB.substr(bpe.xmlregular, 3000, 6001) as xml_bpe_3 ");
// sql.append(" DBMS_LOB.substr(bpe.xmlregular, 4000) as xml_bpe, ");
// sql.append(" DBMS_LOB.substr(bpe.xmlregular, 4000, 4001) as xml_bpe_2, ");
// sql.append(" DBMS_LOB.substr(bpe.xmlregular, 4000, 8001) as xml_bpe_3 ");
sql.append(" from bpe bpe "); sql.append(" from bpe bpe ");
sql.append(" where bpe.activo = 1 "); sql.append(" where bpe.activo = 1 ");
sql.append(" and bpe.tipoamb = 1 "); sql.append(" and bpe.tipoamb = 1 ");