fixes bug#13207

dev:julio
qua:julio

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@88696 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2019-01-10 01:14:44 +00:00
parent c6eb71523e
commit 34a717316a
1 changed files with 2 additions and 7 deletions

View File

@ -604,7 +604,8 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
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 and bpe.activo = 1 ");
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 ");
sql.append(" and (bpecan.tipoevento = 110111 or bpecan.tipoevento is null) and bpecan.activo = 1 ");
sql.append(" join estado e on e.codibge = bpe.uf ");
sql.append(" join marca ma on c.marca_id = ma.marca_id ");
sql.append(" join empresa ep on ma.empresa_id = ep.empresa_id ");
@ -662,11 +663,9 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" coalesce(b.importeseguro, 0) as seguro, ");
sql.append(" coalesce(b.importeoutros, 0) as outros, ");
sql.append(" to_char(trunc(bori.feccreacion), 'yyyymmdd') as datamov, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000) as xml_bpe, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000, 3001) as xml_bpe_2, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000, 6001) as xml_bpe_3 ");
sql.append("from boleto bori ");
sql.append(" inner join marca m on m.marca_id = bori.marca_id and m.activo = 1 ");
sql.append(" inner join empresa e on e.empresa_id = m.empresa_id ");
@ -706,11 +705,9 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" and bori.feccreacion <= :DATE_FIM ");
sql.append(" and est_bpe.cveestado in ( ").append(ufs).append(" ) ");
sql.append(" and e.empresa_id = :EMPRESA_ID ");
sql.append(" ");
sql.append(" union all ");
sql.append(" ");
sql.append("select distinct ");
sql.append(" b.boleto_id as cajaId, ");
sql.append(" 'DEV' as tipoReceita, ");
@ -742,11 +739,9 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" coalesce(b.importeseguro, 0) as seguro, ");
sql.append(" coalesce(b.importeoutros, 0) as outros, ");
sql.append(" to_char(trunc(bori.feccreacion), 'yyyymmdd') as datamov, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000) as xml_bpe, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000, 3001) as xml_bpe_2, ");
sql.append(" dbms_lob.substr((case when bpeori.tipoevento is not null then bpeant.xmlregular else bpeori.xmlregular end), 3000, 6001) as xml_bpe_3 ");
sql.append("from boleto bori ");
sql.append(" inner join marca m on m.marca_id = bori.marca_id and m.activo = 1 ");
sql.append(" inner join empresa e on e.empresa_id = m.empresa_id ");