diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jasper index 9a0e79d94..65a9ce584 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jrxml index 19d485eef..7d46f2808 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioTrechoVendido.jrxml @@ -2,7 +2,7 @@ - + @@ -19,22 +19,27 @@ destino.DESCPARADA AS DESTINO, TO_CHAR(cor.FECHORSALIDA ,'HH24:MI') AS FECHORSALIDA, e.NOMBEMPRESA AS NOMBEMPRESA, - SUM (c.PRECIOPAGADO) AS SOMA, + SUM (CASE + WHEN c.motivocancelacion_id is null + then 1 + else -1 + end * + c.PRECIOPAGADO) AS SOMA, COUNT( CASE WHEN c.PRECIOPAGADO = 0 - OR c.PRECIOPAGADO IS NULL + OR c.PRECIOPAGADO IS NULL AND c.motivocancelacion_id is null THEN 1 ELSE NULL END) AS LIVRE, COUNT( CASE - WHEN c.PRECIOPAGADO <> 0 + WHEN c.PRECIOPAGADO <> 0 AND c.motivocancelacion_id is null THEN 1 ELSE NULL END) AS VENDA FROM - BOLETO c + CAJA c LEFT JOIN PARADA origem ON ( @@ -66,8 +71,9 @@ WHERE c.FECHORVENTA BETWEEN $P{DATA_INICIO} AND $P{DATA_FINAL} AND ((c.PUNTOVENTA_ID IN ( $P!{PUNTOVENTA_ID} )) OR ($P{PUNTOVENTA_ID} = '-1')) - AND c.motivocancelacion_id is null + AND e.NOMBEMPRESA LIKE $P{NOMBEMPRESA_SEARCH} + AND c.INDREIMPRESION = 0 GROUP BY origem.DESCPARADA , destino.DESCPARADA ,