frederico 2018-03-09 20:59:02 +00:00
parent 19cd08943c
commit 4622a7b543
1 changed files with 2 additions and 1 deletions

View File

@ -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 + " ");
}