diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPTA.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPTA.java index 807ed0b91..9376e1231 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPTA.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPTA.java @@ -221,10 +221,10 @@ public class RelatorioVendasPTA extends Relatorio { sql.append("INNER JOIN PARADA po ON (ORIGINAL.ORIGEN_ID = po.PARADA_ID) "); sql.append("INNER JOIN PARADA pd ON (ORIGINAL.DESTINO_ID = pd.PARADA_ID) "); sql.append("WHERE to_date(original.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL "); - sql.append(" AND ORIGINAL.INDSTATUSBOLETO IN('C') "); + sql.append(" AND ORIGINAL.INDSTATUSBOLETO IN('C') AND ORIGINAL.MOTIVOCANCELACION_ID in ("+motivoCancelacion+") "); sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49,81) "); - sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND (ORIGINAL.PUNTOVENTA_ID in (" + agencia + ") "); - sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " OR utilizado.PUNTOVENTA_ID in (" + agencia + ")) "); + sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND (utilizado.PUNTOVENTA_ID in (" + agencia + ")) AND ORIGINAL.MOTIVOCANCELACION_ID IN ( "+motivoCancelacion+") "); + sql.append("AND ORIGINAL.EMPRESACORRIDA_ID =" + empresa.getEmpresaId() + " "); } else { // somente cancelados @@ -256,8 +256,7 @@ public class RelatorioVendasPTA extends Relatorio { sql.append("WHERE to_date(original.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL "); sql.append(" AND ORIGINAL.INDSTATUSBOLETO IN('C') "); sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49,81) "); - sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND (ORIGINAL.PUNTOVENTA_ID in (" + agencia + ") "); - sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " OR utilizado.PUNTOVENTA_ID in (" + agencia + ")) AND ORIGINAL.MOTIVOCANCELACION_ID = "+motivoCancelacion+" "); + sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND (utilizado.PUNTOVENTA_ID in (" + agencia + ")) AND ORIGINAL.MOTIVOCANCELACION_ID IN ("+motivoCancelacion+") "); } return sql.toString(); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jasper index cf9e00101..aae3405fd 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jrxml index 5aa652c95..7dcddc0db 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPTA.jrxml @@ -1,8 +1,8 @@ - - - + + + @@ -194,7 +194,7 @@ - +