fixes bug#AL-3274

master
wallace.henrique 2023-10-05 15:18:32 -03:00
parent 5994e5cab5
commit 9dfad0ca76
5 changed files with 261 additions and 108 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.24.0</version>
<version>1.24.1</version>
<packaging>war</packaging>
<properties>

View File

@ -1,6 +1,3 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
@ -47,8 +44,10 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
Map<Integer, List<RutaVO>> mapRutaTrecho = (Map<Integer, List<RutaVO>>) parametros.get("MAPRUTATRECHO");
for (Entry<Integer, List<RutaVO>> entry : mapRutaTrecho.entrySet()) {
if(entry.getValue() != null && !entry.getValue().isEmpty()) {
if(entry.getValue() != null && !entry.getValue().isEmpty()&& !entry.getValue().isEmpty()) {
paradasIds.append(entry.getValue().get(0).getOrigenId()+","+entry.getValue().get(entry.getValue().size()-1).getOrigenId()+",");
}else {
continue;
}
if (paradasIds.length() > 0) {
paradasIds.delete(paradasIds.length() - 1, paradasIds.length());
@ -56,7 +55,7 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
String sqlCombinacoes = gerarCombinacaoTrechos(parametros);
StringBuilder sql = getSQL(parametros, sqlCombinacoes, paradasIds, entry.getKey() );
paradasIds = new StringBuilder();
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString());
@ -70,6 +69,7 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
while (rset2.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("LINHA", rset2.getString("linha"));
dataResult.put("NUMLINHA", rset2.getString("numLinha"));
dataResult.put("SENTIDO", rset2.getString("sentido"));
@ -176,8 +176,60 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
this.dados.add(dataResult);
}
StringBuilder sql2 = buscarTotalViagem(parametros, paradasIds, entry.getKey() );
stmt = new NamedParameterStatement(conexao, sql2.toString());
stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
stmt.setTimestamp("DATA_INICIAL", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("DATA_INICIAL")).getTime()));
stmt.setTimestamp("DATA_FINAL", new Timestamp(DateUtil.fimFecha((Date) parametros.get("DATA_FINAL")).getTime()));
ResultSet rset3 = stmt.executeQuery();
List<Map<String, Object>> dadosAux = new ArrayList<Map<String, Object>>();
while (rset3.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("SERVICO", rset3.getString("servico"));
Integer viagens =0;
Integer segQtde = rset3.getInt("'2'_QTDE");
viagens = viagens + segQtde;
Integer terQtde = rset3.getInt("'3'_QTDE");
viagens = viagens .intValue() + terQtde.intValue();
Integer quaQtde = rset3.getInt("'4'_QTDE");
viagens = viagens.intValue() + quaQtde.intValue();
Integer quiQtde = rset3.getInt("'5'_QTDE");
viagens = viagens.intValue() + quiQtde.intValue();
Integer sexQtde = rset3.getInt("'6'_QTDE");
viagens = viagens.intValue() + sexQtde.intValue();
Integer sabQtde = rset3.getInt("'7'_QTDE");
viagens = viagens.intValue() + sabQtde.intValue();
Integer domQtde = rset3.getInt("'1'_QTDE");
viagens = viagens.intValue() + domQtde.intValue();
dataResult.put("VIAGENS", new BigDecimal(viagens));
dadosAux.add(dataResult);
}
for (Map<String, Object> map : dados) {
for (Map<String, Object> mapAux : dadosAux) {
if(map.get("SERVICO").equals(mapAux.get("SERVICO"))) {
map.put("VIAGENS_TOTAL_GERAL", new BigDecimal(recuperarMaiorValorQuantidadeViagem(map.get("SERVICO"), dados)));
map.put("VIAGENS_TOTAL", mapAux.get("VIAGENS"));
}
}
}
this.resultSet = rset2;
paradasIds = new StringBuilder();
this.resultSet = rset3;
}
Collections.sort(dados, new Comparator<Map<String, Object>> () {
@ -305,7 +357,7 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
sql.append(" " +sqlCombinacoes+ " ");
}
sql.append(" and c.MOTIVOCANCELACION_ID is null ");
sql.append(" and c.MOTIVOCANCELACION_ID is null ");
sql.append(" GROUP by r.DESCRUTA, r.ruta_id, r.indsentidoida, r.NUMRUTA, da.cantasientos, ");
sql.append(" to_char( co.FECCORRIDA, 'D'), TO_CHAR(co.fechorsalidaoriginal ,'HH24:mi'), ");
sql.append(" co.CORRIDA_ID, ORI.descparada, DES.descparada, ORI.parada_id, DES.parada_id ");
@ -320,7 +372,6 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
sql.append(") ");
sql.append(") TB ");
sql.append(")TB2 ");
System.out.println(sql);
return sql;
}
});
@ -420,5 +471,64 @@ public class RelatorioAproveitamentoFinanceiroTrecho extends Relatorio {
return sql.toString();
}
//método criado para buscar a soma das viagens da semana ( nao foi possivel fazer no jasper
private StringBuilder buscarTotalViagem(Map<String, Object> parametros, StringBuilder paradasIds, Integer rutaId) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT * ");
sql.append(" FROM");
sql.append(" (SELECT ");
sql.append(" to_char(c.FECCORRIDA, 'D') AS dia,");
sql.append(" coalesce(count(DISTINCT to_char(co.FECCORRIDA, 'WW')), 0) AS qtde, ");
sql.append(" TO_CHAR(co.fechorsalidaoriginal, 'HH24:mi') AS horario, ");
sql.append(" co.CORRIDA_ID AS servico");
sql.append(" FROM boleto c");
sql.append(" RIGHT OUTER JOIN corrida co ON c.CORRIDA_ID = co.CORRIDA_ID ");
sql.append(" AND c.FECCORRIDA = co.FECCORRIDA");
sql.append(" AND co.ACTIVO = 1");
sql.append(" INNER JOIN ruta r ON co.RUTA_ID = r.RUTA_ID ");
sql.append(" AND r.ACTIVO = 1 ");
sql.append(" INNER JOIN MARCA m ON m.marca_id = co.marca_id ");
sql.append(" AND m.activo = 1");
sql.append(" LEFT JOIN rol_operativo ro ON ro.roloperativo_id = co.roloperativo_id ");
sql.append(" LEFT JOIN diagrama_autobus da ON ro.diagramaautobus_id = da.diagramaautobus_id ");
sql.append(" WHERE co.activo = 1");
sql.append(" AND c.activo = 1 ");
sql.append(" AND m.EMPRESA_ID =:EMPRESA_ID ");
sql.append(" AND co.FECCORRIDA BETWEEN :DATA_INICIAL and :DATA_FINAL ");
if (parametros.get("LINHAS") != null && !possuiFiltroTodos("LINHAS")) {
sql.append(" and co.ruta_id IN (" + rutaId + ")");
}
sql.append(" AND c.MOTIVOCANCELACION_ID IS NULL ");
sql.append(" GROUP BY ");
sql.append(" to_char(c.FECCORRIDA, 'D'), ");
sql.append(" TO_CHAR(co.fechorsalidaoriginal, 'HH24:mi'),");
sql.append(" co.CORRIDA_ID");
sql.append(" ORDER BY r.DESCRUTA,");
sql.append(" r.indsentidoida DESC, to_char(c.FECCORRIDA, 'D')) PIVOT (max(qtde) qtde ");
sql.append(" FOR dia in ('1', '2', '3', '4', '5', '6', '7')) TB ");
return sql;
}
private int recuperarMaiorValorQuantidadeViagem(Object servico, List<Map<String, Object>> dados){
String[] dias = {"SEG_QTDE", "TER_QTDE", "QUA_QTDE", "QUI_QTDE", "SEX_QTDE","SAB_QTDE", "DOM_QTDE"};
String servicoaux = (String) servico;
Integer qtdViagens = 0;
for (String dia : dias) {
int max = 0;
for (Map<String, Object> map : dados) {
if(map.get("SERVICO").toString().equals(servicoaux.toString()) && map.get(dia) != null && Integer.valueOf(((BigDecimal) map.get(dia)).intValue()) > max){
max = Integer.valueOf(((BigDecimal) map.get(dia)).intValue());
}
}
qtdViagens = qtdViagens + max;
}
return qtdViagens;
}
}

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="RelatorioAproveitamentoFinanceiro" pageWidth="873" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="833" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="b92fb063-a827-4619-8a69-5c78e3afbb8c">
<property name="ireport.zoom" value="3.897434200000018"/>
<property name="ireport.zoom" value="2.4200000000000106"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="pageHeader"/>
<property name="ireport.x" value="633"/>
<property name="ireport.y" value="285"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="123"/>
<style name="textStyle" isDefault="true" fontSize="6" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="table">
<box>
@ -74,9 +74,11 @@
<field name="DOM_FIN" class="java.math.BigDecimal"/>
<field name="ORIGEM" class="java.lang.String"/>
<field name="DESTINO" class="java.lang.String"/>
<variable name="totViagemLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variableExpression><![CDATA[$F{VIAGENS}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
<field name="VIAGENS_TOTAL" class="java.math.BigDecimal"/>
<field name="VIAGENS_TOTAL_GERAL" class="java.math.BigDecimal"/>
<variable name="totViagemLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$F{VIAGENS_TOTAL_GERAL}]]></variableExpression>
<initialValueExpression><![CDATA[]]></initialValueExpression>
</variable>
<variable name="totReceitaLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Sum">
<variableExpression><![CDATA[$F{TOT_RECEITA}]]></variableExpression>
@ -114,31 +116,31 @@
<variableExpression><![CDATA[$F{SAB_TOT}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totDomQtdeLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totDomQtdeLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{DOM_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSegQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totSegQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{SEG_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTerQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totTerQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{TER_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
<initialValueExpression><![CDATA[]]></initialValueExpression>
</variable>
<variable name="totQuaQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totQuaQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{QUA_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totQuiQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totQuiQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{QUI_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSexQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totSexQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{SEX_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSabQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" calculation="Highest">
<variable name="totSabQtdeServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA_SERVICO_SENTIDO" calculation="Highest">
<variableExpression><![CDATA[$F{SAB_QTDE}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
@ -171,71 +173,71 @@
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totDomFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totDomQtdeLinha}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totDomQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totDomReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totDomReceitaServico}.divide(
($V{totDomQtdeLinha}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totDomQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSegFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totSegQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totSegQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totSegReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totSegReceitaServico}.divide(
($V{totSegQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totSegQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTerFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totTerQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totTerQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totTerReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totTerReceitaServico}.divide(
($V{totTerQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totTerQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totQuaFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totQuaQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totTQuaQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totQuaReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totQuaReceitaServico}.divide(
($V{totQuaQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totTQuaQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totQuiFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totQuiQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totTQuiQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totQuiReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totQuiReceitaServico}.divide(
($V{totQuiQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totTQuiQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSexFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totSexQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totTSexQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totSexReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totSexReceitaServico}.divide(
($V{totSexQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totTSexQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSabFinLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{totSabQtdeServico}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{totTSabQtdeLinhaSoma}.intValue()==0 || $V{assentosLinha}.intValue()==0 || $V{tarifaLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totSabReceitaServico}.intValue()==0?BigDecimal.ZERO:
(
$V{totSabReceitaServico}.divide(
($V{totSabQtdeServico}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
($V{totTSabQtdeLinhaSoma}).multiply($V{assentosLinha}).multiply($V{tarifaLinha}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
@ -407,11 +409,11 @@
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="finMediaServico" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$F{VIAGENS}.intValue()==0 || $F{ASSENTOS}.intValue()==0 || $F{TARIFA}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$F{VIAGENS_TOTAL}.intValue()==0 || $F{ASSENTOS}.intValue()==0 || $F{TARIFA}.intValue()==0 ? BigDecimal.ZERO:
($F{TOT_RECEITA}.intValue()==0?BigDecimal.ZERO:
(
$F{TOT_RECEITA}.divide(
($F{VIAGENS}).multiply($F{ASSENTOS}).multiply($F{TARIFA}), 4, BigDecimal.ROUND_HALF_UP )
($F{VIAGENS_TOTAL}).multiply($F{ASSENTOS}).multiply($F{TARIFA}), 4, BigDecimal.ROUND_HALF_UP )
).multiply( new BigDecimal(new Integer(100))).setScale(2)
)]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
@ -435,7 +437,7 @@
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="finMediaLinha" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA">
<variableExpression><![CDATA[$V{assentosLinha}.intValue()==0 || $F{TARIFA}.intValue()==0 ? BigDecimal.ZERO:
<variableExpression><![CDATA[$V{assentosLinha}.intValue()==0 || $F{TARIFA}.intValue()==0 || $V{totViagemLinha}.intValue()==0 ? BigDecimal.ZERO:
($V{totReceitaLinha}.intValue()==0?BigDecimal.ZERO:
(
$V{totReceitaLinha}.divide(
@ -448,7 +450,7 @@
<variableExpression><![CDATA[$F{ASSENTOS}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totAssentos" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA" calculation="Sum">
<variable name="totAssentos" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$F{ASSENTOS}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
@ -562,13 +564,48 @@
<variableExpression><![CDATA[$V{totAssentos}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totDomQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totDomQtdeLinha}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totSegQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totSegQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTerQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totTerQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTQuaQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totQuaQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTQuiQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totQuiQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTSexQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totSexQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="totTSabQtdeLinhaSoma" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$V{totSabQtdeServico}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<variable name="somaDiasSemana" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="First">
<variableExpression><![CDATA[$F{VIAGENS}]]></variableExpression>
</variable>
<variable name="totViagemLinhaSomatorio" class="java.math.BigDecimal" resetType="Group" resetGroup="LINHA" incrementType="Group" incrementGroup="LINHA_SERVICO_SENTIDO" calculation="Sum">
<variableExpression><![CDATA[$F{VIAGENS_TOTAL}]]></variableExpression>
<initialValueExpression><![CDATA[BigDecimal.ZERO]]></initialValueExpression>
</variable>
<group name="LINHA_GERAL">
<groupExpression><![CDATA[$F{LINHA}]]></groupExpression>
<groupFooter>
<band height="14">
<printWhenExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1]]></printWhenExpression>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="4" y="0" width="154" height="14" isPrintWhenDetailOverflows="true" uuid="741bc10a-2b94-4c77-bb70-f6b591caf593"/>
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="158" height="14" isPrintWhenDetailOverflows="true" uuid="741bc10a-2b94-4c77-bb70-f6b591caf593"/>
<box>
<topPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
@ -585,7 +622,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totTerQtdeServicoGeral}+"/"+$V{totTerTotLinhaGeral}]]></textFieldExpression>
@ -597,7 +634,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuiQtdeServicoGeral}+"/"+$V{totQuiTotLinhaGeral}]]></textFieldExpression>
@ -609,7 +646,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSegQtdeServicoGeral}+"/"+$V{totSegTotLinhaGeral}]]></textFieldExpression>
@ -621,7 +658,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuaQtdeServicoGeral}+"/"+$V{totQuaTotLinhaGeral}]]></textFieldExpression>
@ -633,7 +670,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSexQtdeServicoGeral}+"/"+$V{totSexTotLinhaGeral}]]></textFieldExpression>
@ -645,7 +682,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSabQtdeServicoGeral}+"/"+$V{totSabTotLinhaGeral}]]></textFieldExpression>
@ -658,7 +695,7 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totDomQtdeServicoGeral}+"/"+$V{totDomTotLinhaGeral}]]></textFieldExpression>
@ -671,7 +708,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totTerFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totTerFinLinhaGeralGeral}]]></textFieldExpression>
@ -684,7 +721,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totQuaFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totQuaFinLinhaGeralGeral}]]></textFieldExpression>
@ -697,7 +734,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totQuiFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totQuiFinLinhaGeralGeral}]]></textFieldExpression>
@ -710,7 +747,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totSexFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totSexFinLinhaGeralGeral}]]></textFieldExpression>
@ -723,7 +760,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totSabFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totSabFinLinhaGeralGeral}]]></textFieldExpression>
@ -736,7 +773,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totDomFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totDomFinLinhaGeralGeral}]]></textFieldExpression>
@ -749,7 +786,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{totSegFinLinhaGeralGeral}.divide(new BigDecimal(2)) : $V{totSegFinLinhaGeralGeral}]]></textFieldExpression>
@ -762,7 +799,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{contadorLinhaIdaVolta} > 1 ? $V{finMediaLinhaGeral}.divide(new BigDecimal(2)) : $V{finMediaLinhaGeral}]]></textFieldExpression>
@ -775,7 +812,7 @@
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totViagemLinhaGeral}.intValue()]]></textFieldExpression>
@ -788,7 +825,7 @@
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totReceitaLinhaGeral}]]></textFieldExpression>
@ -801,7 +838,7 @@
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totPassageiroLinhaGeral}.intValue()]]></textFieldExpression>
@ -809,7 +846,7 @@
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="405" y="0" width="40" height="14" isPrintWhenDetailOverflows="true" uuid="72e4c366-dc71-4d10-9cc4-80ba6a74515c"/>
<textElement textAlignment="Right">
<font size="8" isBold="true"/>
<font size="7" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totAssentosGeral}]]></textFieldExpression>
</textField>
@ -880,17 +917,6 @@
</groupHeader>
<groupFooter>
<band height="15">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="4" y="0" width="125" height="15" isPrintWhenDetailOverflows="true" uuid="34d279b6-79af-4c20-9bc6-f0a191fc0737"/>
<box>
<topPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
<font size="7" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Aproveitamento: "]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="-445" y="-10" width="40" height="14" isPrintWhenDetailOverflows="true" uuid="565d6757-182d-4a00-995f-0d08806071d1"/>
<textElement textAlignment="Center"/>
@ -903,10 +929,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuaQtdeServico}+"/"+$V{totQuaTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totTQuaQtdeLinhaSoma}+"/"+$V{totQuaTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="627" y="0" width="25" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="4c9dbc16-1daf-4077-97a6-951ce1a0807a"/>
@ -916,7 +942,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuaFinLinha}]]></textFieldExpression>
@ -929,7 +955,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totTerFinLinha}]]></textFieldExpression>
@ -941,10 +967,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSexQtdeServico}+"/"+$V{totSexTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totTSexQtdeLinhaSoma}+"/"+$V{totSexTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="779" y="0" width="25" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="e7449824-474e-44de-823b-7940c3bd7df3"/>
@ -954,7 +980,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSabFinLinha}]]></textFieldExpression>
@ -966,10 +992,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totTerQtdeServico}+"/"+$V{totTerTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totTerQtdeLinhaSoma}+"/"+$V{totTerTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="524" y="0" width="27" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="be2fa440-3a9d-45ca-9b50-8a889516b66f"/>
@ -979,7 +1005,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSegFinLinha}]]></textFieldExpression>
@ -991,10 +1017,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuiQtdeServico}+"/"+$V{totQuiTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totTQuiQtdeLinhaSoma}+"/"+$V{totQuiTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="680" y="0" width="21" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="6fa898d8-a03c-449e-b31a-4955944a2e52"/>
@ -1004,7 +1030,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totQuiFinLinha}]]></textFieldExpression>
@ -1017,7 +1043,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSexFinLinha}]]></textFieldExpression>
@ -1029,10 +1055,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSabQtdeServico}+"/"+$V{totSabTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totTSabQtdeLinhaSoma}+"/"+$V{totSabTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="445" y="0" width="31" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="94739135-6cee-4279-a5c8-5002af1da96c"/>
@ -1042,10 +1068,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totDomQtdeLinha}+"/"+$V{totDomTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totDomQtdeLinhaSoma}+"/"+$V{totDomTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="476" y="0" width="26" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="e6847b00-50c1-455e-a3ae-d0eaff028425"/>
@ -1055,7 +1081,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totDomFinLinha}]]></textFieldExpression>
@ -1067,10 +1093,10 @@
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totSegQtdeServico}+"/"+$V{totSegTotLinha}]]></textFieldExpression>
<textFieldExpression><![CDATA[$V{totSegQtdeLinhaSoma}+"/"+$V{totSegTotLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="804" y="0" width="28" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="d18f9eef-1c91-4d46-8669-9f1a3fe44909"/>
@ -1080,7 +1106,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{finMediaLinha}]]></textFieldExpression>
@ -1093,7 +1119,7 @@
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totPassageiroLinha}.intValue()]]></textFieldExpression>
@ -1106,34 +1132,51 @@
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totReceitaLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="293" y="0" width="36" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="ca6533ec-b661-456b-a6bb-0c16137a6e01"/>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="405" y="0" width="40" height="15" isPrintWhenDetailOverflows="true" uuid="ec22d2c4-8bf5-43a1-8376-4f423c1ff964"/>
<textElement textAlignment="Right">
<font size="7" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totAssentos}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="125" height="15" isPrintWhenDetailOverflows="true" uuid="34d279b6-79af-4c20-9bc6-f0a191fc0737"/>
<box>
<topPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle" markup="none">
<font size="7" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Aproveitamento: "]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="259" y="0" width="70" height="15" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="16b4e51a-f3bf-41e7-a647-9b81a0a2e0af"/>
<box>
<topPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{totViagemLinha}.intValue()]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="405" y="0" width="40" height="15" isPrintWhenDetailOverflows="true" uuid="ec22d2c4-8bf5-43a1-8376-4f423c1ff964"/>
<textElement textAlignment="Right">
<font size="8" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totAssentos}]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<group name="LINHA_SERVICO_SENTIDO">
<groupExpression><![CDATA[$F{LINHA}+ $F{SENTIDO}+ $F{SERVICO}]]></groupExpression>
<groupFooter>
<band height="9"/>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
@ -1833,7 +1876,7 @@
<rightPen lineWidth="0.25"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="8" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<font fontName="SansSerif" size="7" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{finMediaServico}]]></textFieldExpression>

View File

@ -26,7 +26,7 @@ public class RenderRelatorioAproveitamentoFinanceiro implements ListitemRenderer
public void render(Listitem lstm, Object o) throws Exception {
Ruta ruta = (Ruta) o;
Listcell lc = new Listcell(ruta.getNumRuta().toString());
Listcell lc = new Listcell(ruta.getNumRuta() != null ? ruta.getNumRuta().toString() : "");
lc.setParent(lstm);
lc = new Listcell(ruta.getPrefixo());