diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTaxasLinha.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTaxasLinha.java index fa6ef4348..10d0c8ffe 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTaxasLinha.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioTaxasLinha.java @@ -247,9 +247,9 @@ public class RelatorioTaxasLinha extends Relatorio { sql.append(" EM.EMPRESA_ID, "); sql.append(" CJ.PUNTOVENTA_ID, "); sql.append(" PV.NOMBPUNTOVENTA, "); - sql.append(" SUM(CASE WHEN (CJ.IMPORTETAXAEMBARQUE>0 and cj.motivocancelacion_id is null ) THEN 1 WHEN (CJ.IMPORTETAXAEMBARQUE>0 and cj.motivocancelacion_id is not null ) then 0 ELSE 0 END) EMBARQUE_VENDIDOS, "); - sql.append(" SUM(CASE WHEN (CJ.IMPORTEPEDAGIO>0 and cj.motivocancelacion_id is null) THEN 1 WHEN (CJ.IMPORTEPEDAGIO>0 and cj.motivocancelacion_id is not null) THEN 0 ELSE 0 END) PEDAGIO_VENDIDOS, "); - sql.append(" SUM(CASE WHEN (CJ.IMPORTESEGURO>0 and cj.motivocancelacion_id is null) THEN 1 WHEN (CJ.IMPORTESEGURO>0 and cj.motivocancelacion_id is not null) THEN 0 ELSE 0 END) SEGURO_VENDIDOS, "); + sql.append(" SUM(CASE WHEN (CJ.IMPORTETAXAEMBARQUE>0 and cj.motivocancelacion_id is null ) THEN 1 WHEN (CJ.IMPORTETAXAEMBARQUE>0 and cj.motivocancelacion_id is not null ) then -1 ELSE 0 END) EMBARQUE_VENDIDOS, "); + sql.append(" SUM(CASE WHEN (CJ.IMPORTEPEDAGIO>0 and cj.motivocancelacion_id is null) THEN 1 WHEN (CJ.IMPORTEPEDAGIO>0 and cj.motivocancelacion_id is not null) THEN -1 ELSE 0 END) PEDAGIO_VENDIDOS, "); + sql.append(" SUM(CASE WHEN (CJ.IMPORTESEGURO>0 and cj.motivocancelacion_id is null) THEN 1 WHEN (CJ.IMPORTESEGURO>0 and cj.motivocancelacion_id is not null) THEN -1 ELSE 0 END) SEGURO_VENDIDOS, "); sql.append(" CO.ESTADO_ID ORIGEM_ESTADO_ID, "); sql.append(" CD.ESTADO_ID DESTINO_ESTADO_ID, "); sql.append(" CASE "); @@ -258,9 +258,9 @@ public class RelatorioTaxasLinha extends Relatorio { sql.append(" ELSE "); sql.append(" 'N' "); sql.append(" END INTERESTADUAL, "); - sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else 0 end) * CJ.IMPORTETAXAEMBARQUE) TOTAL_EMBARQUE, "); - sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else 0 end) * CJ.IMPORTEPEDAGIO) TOTAL_PEDAGIO, "); - sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else 0 end) * CJ.IMPORTESEGURO) TOTAL_SEGURO, "); + sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else -1 end) * CJ.IMPORTETAXAEMBARQUE) TOTAL_EMBARQUE, "); + sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else -1 end) * CJ.IMPORTEPEDAGIO) TOTAL_PEDAGIO, "); + sql.append(" SUM( (case when cj.motivocancelacion_id is null then 1 else -1 end) * CJ.IMPORTESEGURO) TOTAL_SEGURO, "); sql.append(" EST.ICMS AS ICMS "); sql.append("FROM CAJA CJ ");