diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java index 9043e1d5a..03c01bda6 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAproveitamentoFinanceiro.java @@ -70,10 +70,10 @@ public class RelatorioAproveitamentoFinanceiro extends Relatorio { sql.append(" r.ruta_id as rutaid, "); sql.append(" count( c.caja_id) as passageiros, "); sql.append(" sum( c.PRECIOPAGADO )as valor, "); - sql.append(" to_char( c.FECHORVENTA, 'D') as dia, "); + sql.append(" to_char( c.FECCORRIDA, 'D') as dia, "); // Quantidade de dias da semana diferente vendidas // "WW" Esse parāmetro para o to_char tras o dia da semana da data - sql.append(" coalesce(count(DISTINCT to_char( c.FECHORVENTA, 'WW')), 0) as qtde, "); + sql.append(" coalesce(count(DISTINCT to_char( c.FECCORRIDA, 'WW')), 0) as qtde, "); sql.append(" r.indsentidoida as sentido, "); sql.append(" da.cantasientos as assentos, "); sql.append(" TO_CHAR(co.fechorsalidaoriginal ,'HH24:mi') as horario, "); @@ -95,24 +95,26 @@ public class RelatorioAproveitamentoFinanceiro extends Relatorio { sql.append(" on ro.diagramaautobus_id = da.diagramaautobus_id "); sql.append(" WHERE c.activo = 1 "); sql.append(" AND m.EMPRESA_ID = :EMPRESA_ID "); - sql.append(" and c.FECHORVENTA >= :DATA_INICIAL "); - sql.append(" and c.FECHORVENTA <= :DATA_FINAL "); + sql.append(" and c.FECCORRIDA >= :DATA_INICIAL "); + sql.append(" and c.FECCORRIDA <= :DATA_FINAL "); if (parametros.get("LINHAS") != null && !possuiFiltroTodos("LINHAS")) { sql.append(" and c.ruta_id IN (" + parametros.get("LINHAS").toString() + ")"); } sql.append(" and c.MOTIVOCANCELACION_ID is null "); + sql.append(" and c.INDREIMPRESION = 0 "); + sql.append(" and c.MOTIVOREIMPRESION_ID is null "); sql.append(" and c.INDSTATUSBOLETO = 'V' "); sql.append(" GROUP by r.DESCRUTA, r.ruta_id, r.indsentidoida, da.cantasientos, "); - sql.append(" to_char( c.FECHORVENTA, 'D'), TO_CHAR(co.fechorsalidaoriginal ,'HH24:mi'), "); + sql.append(" to_char( c.FECCORRIDA, 'D'), TO_CHAR(co.fechorsalidaoriginal ,'HH24:mi'), "); sql.append(" c.CORRIDA_ID "); - sql.append(" ORDER by r.DESCRUTA, r.indsentidoida desc, to_char( c.FECHORVENTA, 'D') "); + sql.append(" ORDER by r.DESCRUTA, r.indsentidoida desc, to_char( c.FECCORRIDA, 'D') "); sql.append(" ) "); sql.append("PIVOT "); sql.append("( "); sql.append(" max(valor) receita_ope, "); - sql.append(" count(qtde) qtde, "); + sql.append(" max(qtde) qtde, "); sql.append(" max(passageiros) tot "); sql.append(" for dia in ('1', '2', '3', '4', '5', '6', '7') "); sql.append(") "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper index 5fdb6eaa6..e74cd0645 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml index 15acb53df..21244f54b 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAproveitamentoFinanceiro.jrxml @@ -114,133 +114,126 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - - + $V{totSegReceitaServico}.divide( + ($V{totSegQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> - + $V{totTerReceitaServico}.divide( + ($V{totTerQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> - + $V{totQuaReceitaServico}.divide( + ($V{totQuaQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> - + $V{totQuiReceitaServico}.divide( + ($V{totQuiQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> - + $V{totSexReceitaServico}.divide( + ($V{totSexQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> - + $V{totSabReceitaServico}.divide( + ($V{totSabQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP ) + ).multiply( new BigDecimal(new Integer(100))).setScale(2) + )]]> @@ -339,105 +332,117 @@ - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + - - - - - - 0 && $F{TOT_RECEITA}.intValue() > 0 ? ($F{TOT_RECEITA}.divide ( - $F{TARIFA}.multiply( - $F{VIAGENS}.multiply( - $F{ASSENTOS} - ) - ) -, 4, BigDecimal.ROUND_HALF_UP ) -.multiply( new BigDecimal(new Integer(100)) )).setScale(2) : BigDecimal.ZERO;]]> - - - 0 && $F{TOT_RECEITA}.intValue() > 0 ? ($F{TOT_RECEITA}.divide ( - $F{TARIFA}.multiply( - $F{VIAGENS}.multiply( - $F{ASSENTOS} - ) - ) -, 2, BigDecimal.ROUND_HALF_UP ) -.multiply( new BigDecimal("100") )) : new BigDecimal(0)]]> + + + + + + + + + + + + + + + + @@ -529,7 +534,7 @@ - + @@ -567,7 +572,7 @@ - + @@ -592,7 +597,7 @@ - + @@ -617,7 +622,7 @@ - + @@ -655,7 +660,7 @@ - + @@ -693,7 +698,7 @@ - + @@ -734,6 +739,19 @@ + + + + + + + + + + + + + @@ -1398,7 +1416,7 @@ - + @@ -1439,247 +1457,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +