From 4622a7b543a6f56720a5c5e854932051b787f7d3 Mon Sep 17 00:00:00 2001 From: frederico Date: Fri, 9 Mar 2018 20:59:02 +0000 Subject: [PATCH] bug#10328 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@79757 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../relatorios/impl/RelatorioHistoricoClientes.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioHistoricoClientes.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioHistoricoClientes.java index e7588389e..be793b49d 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioHistoricoClientes.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioHistoricoClientes.java @@ -113,7 +113,8 @@ public class RelatorioHistoricoClientes extends Relatorio { sql.append("INNER JOIN CLIENTE cliente ON caja.CLIENTE_ID = cliente.CLIENTE_ID "); sql.append("WHERE caja.MOTIVOCANCELACION_ID IS NULL "); - sql.append("AND caja.INDREIMPRESION = 0 "); + sql.append("AND (caja.INDSTATUSBOLETO in( 'V','T') and INDREIMPRESION = 0 and not exists(select * from caja c1 where c1.indstatusboleto = 'E' and caja.transacao_id = C1.TRANSACAOORIGINAL_ID ) or caja.INDSTATUSBOLETO = 'E' ) "); + if (empresaId != null) { sql.append("AND caja.EMPRESACORRIDA_ID = " + empresaId + " "); }