Merge pull request 'Mudança no filtro para passar a considerar apenas a situação de agrupamento de corridas. Antes olhava só a diferença de datas, o que se mostrou errado.' (!181) from AL-4286 into master

Reviewed-on: adm/ModelWeb#181
master
gleimar 2024-05-09 14:55:09 +00:00
commit c52302f97a
2 changed files with 4 additions and 7 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ModelWeb</artifactId>
<version>1.52.0</version>
<version>1.53.0</version>
<distributionManagement>
<repository>

View File

@ -905,8 +905,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
sql.append(" bpe.pRedBC ");
sql.append("from boleto c ");
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(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" and bpe.activo = (case when c.motivocancelacion_id = 17 and c.boletooriginal_id is null then 0 else 1 end)");
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 ");
@ -1001,8 +1000,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
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 ");
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(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" and bpe.activo = (case when bori.motivocancelacion_id = 17 and bori.boletooriginal_id is null then 0 else 1 end) ");
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 boleto b on b.boleto_id = bpeori.boleto_id ");
@ -1102,8 +1100,7 @@ public class BpeHibernateDAO extends HibernateDaoSupport implements BpeDAO {
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 ");
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(" to_char(to_date(substr(bpe.dhrecbto,0,10), 'YYYY-MM-DD'), 'yyyymmdd') then 0 else 1 end) ");
sql.append(" and (case when bori.motivocancelacion_id = 17 and bori.boletooriginal_id is null then 0 else 1 end) ");
sql.append(" inner join estado est_bpe on bpe.uf = est_bpe.codibge ");
sql.append(" left join boleto b on b.boleto_id = coalesce(bori.boletoanterior_id, bori.boletooriginal_id) ");
sql.append(" left join bpe bpeori on b.boleto_id = bpeori.boleto_id and bpeori.activo = 1 ");