fixes bug#15167

dev: wallace
qua: 

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@96321 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2019-08-01 19:02:46 +00:00
parent a80449b511
commit 6ad9f4ca1c
1 changed files with 3 additions and 3 deletions

View File

@ -883,7 +883,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
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(" and bpe.activo = (case when TO_CHAR(c.feccreacion, 'yyyymmdd') <> "); sql.append(" and bpe.activo = (case when TO_CHAR(c.feccreacion, 'yyyymmdd') <> ");
sql.append(" to_char(to_timestamp_tz(bpe.dhrecbto, 'YYYY-MM-DD\"T\"HH24:MI:SSTZH:TZM'), 'yyyymmdd') then 0 else 1 end) "); sql.append(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" join estado e on e.codibge = bpe.uf "); 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 marca ma on c.marca_id = ma.marca_id ");
sql.append(" join empresa ep on ma.empresa_id = ep.empresa_id "); sql.append(" join empresa ep on ma.empresa_id = ep.empresa_id ");
@ -978,7 +978,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" inner join empresa e on e.empresa_id = m.empresa_id "); sql.append(" inner join empresa e on e.empresa_id = m.empresa_id ");
sql.append(" inner join bpe bpe on bpe.boleto_id = bori.boleto_id "); sql.append(" inner join bpe bpe on bpe.boleto_id = bori.boleto_id ");
sql.append(" and bpe.activo = (case when TO_CHAR(bori.feccreacion, 'yyyymmdd') <> "); sql.append(" and bpe.activo = (case when TO_CHAR(bori.feccreacion, 'yyyymmdd') <> ");
sql.append(" to_char(to_timestamp_tz(bpe.dhrecbto, 'YYYY-MM-DD\"T\"HH24:MI:SSTZH:TZM'), 'yyyymmdd') then 0 else 1 end) "); sql.append(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" inner join estado est_bpe on bpe.uf = est_bpe.codibge "); sql.append(" inner join estado est_bpe on bpe.uf = est_bpe.codibge ");
sql.append(" left join bpe bpeori on bpeori.chbpe = bpe.chbpe_substituicao and bpeori.activo = 1 "); sql.append(" left join bpe bpeori on bpeori.chbpe = bpe.chbpe_substituicao and bpeori.activo = 1 ");
sql.append(" left join boleto b on b.boleto_id = bpeori.boleto_id "); sql.append(" left join boleto b on b.boleto_id = bpeori.boleto_id ");
@ -1078,7 +1078,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" inner join empresa e on e.empresa_id = m.empresa_id "); sql.append(" inner join empresa e on e.empresa_id = m.empresa_id ");
sql.append(" inner join bpe bpe on bpe.boleto_id = bori.boleto_id "); sql.append(" inner join bpe bpe on bpe.boleto_id = bori.boleto_id ");
sql.append(" and bpe.activo = (case when TO_CHAR(bori.feccreacion, 'yyyymmdd') <> "); sql.append(" and bpe.activo = (case when TO_CHAR(bori.feccreacion, 'yyyymmdd') <> ");
sql.append(" to_char(to_timestamp_tz(bpe.dhrecbto, 'YYYY-MM-DD\"T\"HH24:MI:SSTZH:TZM'), 'yyyymmdd') then 0 else 1 end) "); sql.append(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" inner join estado est_bpe on bpe.uf = est_bpe.codibge "); sql.append(" inner join estado est_bpe on bpe.uf = est_bpe.codibge ");
sql.append(" left join boleto b on b.boleto_id = (case when bori.motivocancelacion_id = 99 then bori.boletoanterior_id else bori.boletooriginal_id end) "); sql.append(" left join boleto b on b.boleto_id = (case when bori.motivocancelacion_id = 99 then bori.boletoanterior_id else bori.boletooriginal_id end) ");
sql.append(" left join bpe bpeori on b.boleto_id = bpeori.boleto_id and bpeori.activo = 1 "); sql.append(" left join bpe bpeori on b.boleto_id = bpeori.boleto_id and bpeori.activo = 1 ");