fixes bug#13207

dev:julio
qua:

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@88751 d1611594-4594-4d17-8e1d-87c2c4800839
master
julio 2019-01-11 01:33:47 +00:00
parent cfa7a7b6f6
commit d31abf2154
1 changed files with 2 additions and 1 deletions

View File

@ -597,7 +597,8 @@ 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 (to_char(bpe.fecmodif, 'mm/yyyy') < to_char(bpecan.fecmodif, 'mm/yyyy') or bpecan.fecmodif is null) ");
sql.append(" and (bpe.fecmodif < (case when (to_char(bpe.fecmodif, 'mm/yyyy') <> to_char(bpecan.fecmodif, 'mm/yyyy') ) ");
sql.append(" then bpecan.fecmodif else bpe.fecmodif end) 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 ");
sql.append(" and ep.empresa_id = :EMPRESA_ID ");