Correção no relatorio de recarga fix bug#AL-3512

master
Fabio 2024-02-01 08:22:44 -03:00
parent 532a887c09
commit c8d6aac1f7
6 changed files with 389 additions and 259 deletions

View File

@ -4,11 +4,11 @@
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.rjconsultores</groupId>
<artifactId>ventaboletosadm</artifactId>
<version>1.47.0</version>
<version>1.47.1</version>
<packaging>war</packaging>
<properties>
<modelWeb.version>1.36.0</modelWeb.version>
<modelWeb.version>1.36.1</modelWeb.version>
<flyway.version>1.28.0</flyway.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

View File

@ -10,8 +10,8 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import com.rjconsultores.ventaboletos.enums.StatusRecargaEnum;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.IndStatusBoleto;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
@ -31,251 +31,60 @@ public class RelatorioRecargaRvhub extends Relatorio {
StringBuilder sql = new StringBuilder();
if (parametros.get("IDAVOLTA").equals("1")) {
sql.append(" select ");
sql.append(" u.CVEUSUARIO CVEBILHETEIRO, ");
sql.append(" uc.CVEUSUARIO CVEBILHETEIRO_CANCELADO, ");
sql.append(" B.indstatusboleto IMPRESSAO_POSTERIOR, ");
sql.append(" B.NUMFOLIOSISTEMA NUMERO_PASSAGEM, ");
sql.append(" B.NUMSERIEPREIMPRESA SERIE, ");
sql.append(" B.NUMSERIEPREIMPRESA SUB_SERIE, ");
sql.append(" B.NUMFOLIOPREIMPRESO PRE_IMPRESSO, ");
sql.append(" p_origen.PARADA_ID COD_ORIGEM, ");
sql.append(" p_origen.DESCPARADA ORIGEM, ");
sql.append(" p_destino.PARADA_ID COD_DESTINO, ");
sql.append(" p_destino.DESCPARADA DESTINO, ");
sql.append(" pv.NUMPUNTOVENTA COD_AGENCIA, ");
sql.append(" pv.NOMBPUNTOVENTA NOME_AGENCIA, ");
sql.append(" CASE WHEN B.indstatusboleto = 'E' THEN utilizado.fechorventa_h ELSE B.fechorventa_h END DATA_VENDA, ");
sql.append(" CASE WHEN b.fechorventa is null THEN utilizado.fechorventa ELSE b.fechorventa_h END DATA_EMISSAO, ");
sql.append(" B.fechorviaje DATA_VIAGEM, ");
sql.append(" B.CORRIDA_ID SERVICO, ");
sql.append(" to_char(B.fechorviaje, 'hh24:mi:ss') HORA, ");
sql.append(" B.NUMASIENTO NUMASIENTO, ");
sql.append(" ct.DESCCATEGORIA CATEGORIA, ");
sql.append(" R.INDSENTIDOIDA SENTIDO, ");
sql.append(" R.NUMRUTA COD_LINHA, ");
sql.append(" R.DESCRUTA DESC_LINHA, ");
sql.append(" CASE WHEN b.MOTIVOCANCELACION_ID IS NULL THEN 'V' ELSE 'C' END STATUS_PASSAGEM, ");
sql.append(" B.PRECIOPAGADO TARIFA, ");
sql.append(" B.IMPORTETAXAEMBARQUE TX_EMBARQUE, ");
sql.append(" B.IMPORTEPEDAGIO PEDAGIO, ");
sql.append(" B.IMPORTESEGURO SEGURO, ");
sql.append(" u.NOMBUSUARIO BILHETEIRO, ");
sql.append(" uc.NOMBUSUARIO BILHETEIRO_CANCELAMENTO, ");
sql.append(" B.NOMBPASAJERO AS PASSAGEIRO, ");
sql.append(" B.DESCNUMDOC AS DOC, ");
sql.append(" COALESCE(b.NUMOPERACION, bo.NUMOPERACION) AS LOCALIZADOR ");
sql.append(" FROM caja B ");
sql.append(" LEFT JOIN boleto bo ON (bo.boleto_id = b.transacaooriginal_id AND b.indstatusboleto = 'C') ");
sql.append(" JOIN RUTA R ON R.RUTA_ID = B.RUTA_ID ");
sql.append(" JOIN PUNTO_VENTA pv on B.PUNTOVENTA_ID = pv.PUNTOVENTA_ID ");
sql.append(" JOIN USUARIO u on u.USUARIO_ID = B.USUARIO_ID ");
sql.append(" LEFT JOIN USUARIO uc ON uc.USUARIO_ID = bo.USUARIO_ID ");
sql.append(" JOIN PARADA p_origen on p_origen.PARADA_ID = B.ORIGEN_ID ");
sql.append(" JOIN PARADA p_destino on p_destino.PARADA_ID = B.DESTINO_ID ");
sql.append(" JOIN CATEGORIA ct on ct.CATEGORIA_ID = B.CATEGORIA_ID ");
sql.append(" JOIN CLASE_SERVICIO cs on cs.CLASESERVICIO_ID = B.CLASESERVICIO_ID ");
sql.append(" JOIN MARCA m on m.marca_id = b.marca_id ");
sql.append(" left join ciudad co ON co.ciudad_id = p_origen.ciudad_id ");
sql.append(" left join estado est ON est.estado_id = co.estado_id ");
sql.append(" LEFT JOIN boleto utilizado ON (utilizado.boleto_id = b.transacaooriginal_id AND b.INDSTATUSBOLETO = 'E') ");
sql.append(" WHERE ");
sql.append(" (b.indreimpresion = 0 OR b.INDSTATUSBOLETO = 'E') ");
sql.append(" and m.EMPRESA_ID = :EMPRESA_ID ");
if (parametros.get("DATA_INICIAL") != null && parametros.get("DATA_FINAL") != null) {
if (parametros.get("TIPO_DATA") != null) {
if ((parametros.get("TIPO_DATA").toString().contains("DATA_VENDA"))) {
sql.append(" and b.FECHORVENTA_H >= :DATA_INICIAL ");
sql.append(" and b.FECHORVENTA_H <= :DATA_FINAL ");
} else {
sql.append(" and utilizado.FECHORVENTA >= :DATA_INICIAL ");
sql.append(" and utilizado.FECHORVENTA <= :DATA_FINAL ");
}
}
}
sql.append(" SELECT ");
sql.append(" rc.created_at as dataVenda, ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" rc.area_code as ddd, ");
sql.append(" rc.cell_phone_number as telefone, ");
sql.append(" ee.impingreso as valor, ");
sql.append(" rc.status, ");
sql.append(" tee.desctipoevento as descTipoEvento, ");
sql.append(" rc.rvhub_id as rvhubId, ");
sql.append(" u.cveusuario as usuario ");
sql.append(" FROM recarga_celular rc ");
sql.append(" left join evento_extra ee on ee.eventoextra_id = rc.eventoextra_id ");
sql.append(" left join punto_venta pv on ee.puntoventa_id = pv.puntoventa_id ");
sql.append(" left join tipo_evento_extra tee on tee.tipoeventoextra_id = ee.tipoeventoextra_id ");
sql.append(" left join usuario u on rc.usuario_id = u.usuario_id ");
sql.append(" where created_at >= :datInicial ");
sql.append(" and created_at <= :datFinal ");
sql.append(" and ee.empresa_id = :empresa_id ");
if (parametros.get("NUMPUNTOVENTA") != null && !parametros.get("NUMPUNTOVENTA").equals("-1")) {
sql.append(" and pv.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
sql.append(" and ee.puntoventa_id in ( "+parametros.get("NUMPUNTOVENTA")+" ) ");
}
if (parametros.get("MOEDA_ID") != null) {
sql.append(" and NVL(B.MONEDA_ID, 1) = "+parametros.get("MOEDA_ID") );
if (parametros.get("STATUS") != null ) {
sql.append(" and rc.status in ( "+parametros.get("STATUS")+" ) ");
}
if (parametros.get("ESTADO_ID") != null && !parametros.get("ESTADO_ID").equals("-1")) {
sql.append(" and est.estado_id = " + parametros.get("ESTADO_ID").toString() + "");
}
sql.append(" AND b.INDVIAJEREDONDO = 1 ");
}
if (parametros.get("STATUS").toString().contains("C")||parametros.get("STATUS").toString().contains("V")) {
if (parametros.get("IDAVOLTA").equals("1")) {
sql.append(" UNION ALL ");
}
sql.append(" select ");
sql.append(" u.CVEUSUARIO CVEBILHETEIRO, ");
sql.append(" uc.CVEUSUARIO CVEBILHETEIRO_CANCELADO, ");
sql.append(" B.indstatusboleto IMPRESSAO_POSTERIOR, ");
sql.append(" B.NUMFOLIOSISTEMA NUMERO_PASSAGEM, ");
sql.append(" B.NUMSERIEPREIMPRESA SERIE, ");
sql.append(" B.NUMSERIEPREIMPRESA SUB_SERIE, ");
sql.append(" B.NUMFOLIOPREIMPRESO PRE_IMPRESSO, ");
sql.append(" p_origen.PARADA_ID COD_ORIGEM, ");
sql.append(" p_origen.DESCPARADA ORIGEM, ");
sql.append(" p_destino.PARADA_ID COD_DESTINO, ");
sql.append(" p_destino.DESCPARADA DESTINO, ");
sql.append(" pv.NUMPUNTOVENTA COD_AGENCIA, ");
sql.append(" pv.NOMBPUNTOVENTA NOME_AGENCIA, ");
sql.append(" CASE WHEN B.indstatusboleto = 'E' THEN utilizado.fechorventa_h ELSE B.fechorventa_h END DATA_VENDA, ");
sql.append(" CASE WHEN b.fechorventa is null THEN utilizado.fechorventa ELSE b.fechorventa_h END DATA_EMISSAO, ");
sql.append(" B.fechorviaje DATA_VIAGEM, ");
sql.append(" B.CORRIDA_ID SERVICO, ");
sql.append(" to_char(B.fechorviaje, 'hh24:mi:ss') HORA, ");
sql.append(" B.NUMASIENTO NUMASIENTO, ");
sql.append(" ct.DESCCATEGORIA CATEGORIA, ");
sql.append(" R.INDSENTIDOIDA SENTIDO, ");
sql.append(" R.NUMRUTA COD_LINHA, ");
sql.append(" R.DESCRUTA DESC_LINHA, ");
sql.append(" CASE WHEN b.MOTIVOCANCELACION_ID IS NULL THEN 'V' ELSE 'C' END STATUS_PASSAGEM, ");
sql.append(" B.PRECIOPAGADO TARIFA, ");
sql.append(" B.IMPORTETAXAEMBARQUE TX_EMBARQUE, ");
sql.append(" B.IMPORTEPEDAGIO PEDAGIO, ");
sql.append(" B.IMPORTESEGURO SEGURO, ");
sql.append(" u.NOMBUSUARIO BILHETEIRO, ");
sql.append(" uc.NOMBUSUARIO BILHETEIRO_CANCELAMENTO, ");
sql.append(" B.NOMBPASAJERO AS PASSAGEIRO, ");
sql.append(" B.DESCNUMDOC AS DOC, ");
sql.append(" COALESCE(b.NUMOPERACION, bo.NUMOPERACION) AS LOCALIZADOR ");
sql.append(" FROM caja B ");
sql.append(" LEFT JOIN boleto bo ON (bo.boleto_id = b.transacaooriginal_id AND b.indstatusboleto = 'C') ");
sql.append(" JOIN RUTA R ON R.RUTA_ID = B.RUTA_ID ");
sql.append(" JOIN PUNTO_VENTA pv on B.PUNTOVENTA_ID = pv.PUNTOVENTA_ID ");
sql.append(" JOIN USUARIO u on u.USUARIO_ID = B.USUARIO_ID ");
sql.append(" LEFT JOIN USUARIO uc ON uc.USUARIO_ID = bo.USUARIO_ID ");
sql.append(" JOIN PARADA p_origen on p_origen.PARADA_ID = B.ORIGEN_ID ");
sql.append(" JOIN PARADA p_destino on p_destino.PARADA_ID = B.DESTINO_ID ");
sql.append(" JOIN CATEGORIA ct on ct.CATEGORIA_ID = B.CATEGORIA_ID ");
sql.append(" JOIN CLASE_SERVICIO cs on cs.CLASESERVICIO_ID = B.CLASESERVICIO_ID ");
sql.append(" JOIN MARCA m on m.marca_id = b.marca_id ");
sql.append(" left join ciudad co ON co.ciudad_id = p_origen.ciudad_id ");
sql.append(" left join estado est ON est.estado_id = co.estado_id ");
sql.append(" LEFT JOIN boleto utilizado ON (utilizado.boleto_id = b.transacaooriginal_id AND b.INDSTATUSBOLETO = 'E') ");
sql.append(" WHERE ");
sql.append(" (b.indreimpresion = 0 OR b.INDSTATUSBOLETO = 'E') ");
sql.append(" and m.EMPRESA_ID = :EMPRESA_ID ");
if (parametros.get("DATA_INICIAL") != null && parametros.get("DATA_FINAL") != null) {
if (parametros.get("TIPO_DATA") != null) {
if ((parametros.get("TIPO_DATA").toString().contains("DATA_VENDA"))) {
sql.append(" and b.FECHORVENTA_H >= :DATA_INICIAL ");
sql.append(" and b.FECHORVENTA_H <= :DATA_FINAL ");
} else {
sql.append(" and utilizado.FECHORVENTA >= :DATA_INICIAL ");
sql.append(" and utilizado.FECHORVENTA <= :DATA_FINAL ");
}
}
}
if (parametros.get("NUMPUNTOVENTA") != null && !parametros.get("NUMPUNTOVENTA").equals("-1")) {
sql.append(" and pv.PUNTOVENTA_ID IN (" + parametros.get("NUMPUNTOVENTA").toString() + ")");
}
if (parametros.get("MOEDA_ID") != null) {
sql.append(" and NVL(B.MONEDA_ID, 1) = "+parametros.get("MOEDA_ID") );
}
if (parametros.get("ESTADO_ID") != null && !parametros.get("ESTADO_ID").equals("-1")) {
sql.append(" and est.estado_id = " + parametros.get("ESTADO_ID").toString() + "");
}
if ( !(parametros.get("STATUS").toString().contains("V") && parametros.get("STATUS").toString().contains("C")) ) {
if (parametros.get("STATUS").toString().contains("C")) {
sql.append(" AND b.motivocancelacion_id is not null ");
} else if (parametros.get("STATUS").toString().contains("V")) {
sql.append(" AND b.motivocancelacion_id is null ");
}
}
sql.append(" and B.ACTIVO = 1 AND b.INDVIAJEREDONDO IS NULL ");
}
sql.append(" order by ");
if (parametros.get("IDAVOLTA").equals("1")) {
sql.append(" BILHETEIRO, ");
sql.append(" DATA_EMISSAO, ");
}else {
sql.append(" DATA_EMISSAO, ");
sql.append(" BILHETEIRO, ");
}
sql.append(" COD_AGENCIA, ");
sql.append(" NOME_AGENCIA, ");
sql.append(" NUMERO_PASSAGEM, ");
sql.append(" ORIGEM, ");
sql.append(" DESTINO, ");
sql.append(" CATEGORIA, ");
sql.append(" IMPRESSAO_POSTERIOR, ");
sql.append(" SERVICO ");
sql.append(" order by rc.created_at, ");
sql.append(" pv.nombpuntoventa, ");
sql.append(" rc.status, ");
sql.append(" rc.area_code, ");
sql.append(" rc.cell_phone_number ");
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql.toString());
stmt.setInt("EMPRESA_ID", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
if (parametros.get("DATA_INICIAL") != null && parametros.get("DATA_FINAL") != null){
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()));
stmt.setInt("empresa_id", Integer.valueOf(parametros.get("EMPRESA_ID").toString()));
stmt.setTimestamp("datInicial", new Timestamp(DateUtil.inicioFecha((Date) parametros.get("datInicial")).getTime()));
stmt.setTimestamp("datFinal", new Timestamp(DateUtil.fimFecha((Date) parametros.get("datFinal")).getTime()));
}
ResultSet rset = stmt.executeQuery();
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("NUMERO_PASSAGEM", rset.getString("NUMERO_PASSAGEM"));
if (rset.getString("SERIE") != null) {
if (rset.getString("SERIE").split("-").length == 1) {
dataResult.put("SERIE", rset.getString("SERIE"));
} else {
dataResult.put("SERIE", rset.getString("SERIE").split("-")[0]);
dataResult.put("SUB_SERIE", rset.getString("SERIE").split("-")[1]);
}
}
dataResult.put("CVEBILHETEIRO", rset.getString("CVEBILHETEIRO"));
dataResult.put("CVEBILHETEIRO_CANCELADO", rset.getString("CVEBILHETEIRO_CANCELADO"));
dataResult.put("IMPRESSAO_POSTERIOR", rset.getString("IMPRESSAO_POSTERIOR"));
dataResult.put("PRE_IMPRESSO", rset.getString("PRE_IMPRESSO"));
dataResult.put("COD_ORIGEM", rset.getString("COD_ORIGEM"));
dataResult.put("ORIGEM", rset.getString("ORIGEM"));
dataResult.put("COD_DESTINO", rset.getString("COD_DESTINO"));
dataResult.put("DESTINO", rset.getString("DESTINO"));
dataResult.put("NOME_AGENCIA", rset.getString("NOME_AGENCIA"));
dataResult.put("COD_AGENCIA", rset.getString("COD_AGENCIA"));
dataResult.put("DATA_VENDA", rset.getDate("DATA_VENDA"));
dataResult.put("DATA_EMISSAO", rset.getDate("DATA_EMISSAO"));
dataResult.put("DATA_VIAGEM", rset.getDate("DATA_VIAGEM"));
dataResult.put("SERVICO", rset.getString("SERVICO"));
dataResult.put("HORA", rset.getString("HORA"));
dataResult.put("NUMASIENTO", rset.getString("NUMASIENTO"));
dataResult.put("CATEGORIA", rset.getString("CATEGORIA"));
dataResult.put("SENTIDO", rset.getInt("SENTIDO"));
dataResult.put("COD_LINHA", rset.getString("COD_LINHA"));
dataResult.put("DESC_LINHA", rset.getString("DESC_LINHA"));
if (rset.getString("STATUS_PASSAGEM") != null) {
dataResult.put("STATUS_PASSAGEM", IndStatusBoleto.valueOf(rset.getString("STATUS_PASSAGEM")).getValue());
}
dataResult.put("TARIFA", rset.getString("TARIFA"));
dataResult.put("TX_EMBARQUE", rset.getString("TX_EMBARQUE"));
dataResult.put("PEDAGIO", rset.getString("PEDAGIO"));
dataResult.put("SEGURO", rset.getString("SEGURO"));
dataResult.put("BILHETEIRO", rset.getString("BILHETEIRO"));
dataResult.put("BILHETEIRO_CANCELAMENTO", rset.getString("BILHETEIRO_CANCELAMENTO"));
dataResult.put("PASSAGEIRO", rset.getString("PASSAGEIRO"));
dataResult.put("DOC", rset.getString("DOC"));
dataResult.put("LOCALIZADOR", rset.getString("LOCALIZADOR"));
dataResult.put("dataVenda", rset.getDate("dataVenda"));
dataResult.put("nombPuntoVenta", rset.getString("nombpuntoventa"));
dataResult.put("ddd", rset.getString("ddd"));
dataResult.put("telefone", rset.getString("telefone"));
dataResult.put("valor", rset.getBigDecimal("valor"));
dataResult.put("descTipoEvento", rset.getString("descTipoEvento"));
dataResult.put("rvhubId", rset.getString("rvhubId"));
dataResult.put("usuario", rset.getString("usuario"));
dataResult.put("status", StatusRecargaEnum.buscarPorCodigo(rset.getString("STATUS")).name());
this.dados.add(dataResult);

View File

@ -0,0 +1,32 @@
#Generated by ResourceBundle Editor (http://essiembre.github.io/eclipse-rbe/)
#geral
cabecalho.dataHora = Data/Hora:
cabecalho.de = de
cabecalho.empresa = Empresa:
cabecalho.filtros = Filtros:
cabecalho.impressorPor = Impressor por:
#Labels cabeçalho
cabecalho.nome = Relat\u00F3rio Recarga Rvhub
label.situacao=Situa\u00E7\u00E3o
cabecalho.pagina = P\u00E1gina
cabecalho.periodo = Per\u00EDodo:
cabecalho.periodoA = \u00E0
cabecalho.relatorio = Relat\u00F3rio:
cabecalho.usuario = Usu\u00E1rio:
label.usuario = Usu\u00E1rio:
label.agenciaDescricao = Nome da Ag\u00EAncia
label.data = Data
label.numero = Numero
label.numeroDocumento = Num. Documento
label.tipo = Tipo Evento
label.totalAutorizado = Total Autorizado
label.totalConfirmado = Total Confirmado
label.totalCancelado = Total Cancelado
label.valor = Valor
label.ddd=DDD
label.telefone=Telefone
label.rvhubId=Transa\u00E7\u00E3o
msg.noData = N\u00E3o foi possivel obter dados com os par\u00E2metros informados.

View File

@ -0,0 +1,299 @@
<?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="RelatorioFinanceiroReceitasDespesas" pageWidth="1136" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="1096" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4">
<property name="ireport.zoom" value="1.3636363636363638"/>
<property name="ireport.x" value="347"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.2" value="columnHeader"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.rows" value="true"/>
<property name="net.sf.jasperreports.export.xls.remove.empty.space.between.columns" value="true"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageHeader"/>
<style name="zebrado">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2==1]]></conditionExpression>
<style backcolor="#CCCCCC"/>
</conditionalStyle>
</style>
<parameter name="fecInicioFiltro" class="java.lang.String"/>
<parameter name="fecFinalFiltro" class="java.lang.String"/>
<parameter name="noDataRelatorio" class="java.lang.String"/>
<parameter name="nombEmpresa" class="java.lang.String"/>
<parameter name="USUARIO" class="java.lang.String"/>
<parameter name="FILTROS" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="dataVenda" class="java.util.Date"/>
<field name="nombPuntoVenta" class="java.lang.String"/>
<field name="tipoEventoExtraId" class="java.lang.String"/>
<field name="descTipoEvento" class="java.lang.String"/>
<field name="valor" class="java.math.BigDecimal"/>
<field name="status" class="java.lang.String"/>
<field name="ddd" class="java.lang.String"/>
<field name="telefone" class="java.lang.String"/>
<field name="usuario" class="java.lang.String"/>
<field name="rvhubId" class="java.lang.String"/>
<variable name="vTotalConfirmado" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{status}.equals( "CONFIRMADA" )?$F{valor}:BigDecimal.ZERO]]></variableExpression>
</variable>
<variable name="vTotalCancelado" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{status}.equals( "CANCELADA" )?$F{valor}:BigDecimal.ZERO]]></variableExpression>
</variable>
<variable name="vTotalAutorizado" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{status}.equals( "AUTORIZADA" )?$F{valor}:BigDecimal.ZERO]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band height="78" splitType="Stretch">
<textField>
<reportElement uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec" x="934" y="20" width="139" height="20"/>
<textElement textAlignment="Right">
<font isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER}+ " " + $R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="43b2c28d-4760-4890-b00d-25e931e79c74" x="0" y="0" width="934" height="20"/>
<textElement markup="none">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="4d1bcd65-c9a6-44b4-8dca-cc3c4c20c9a5" x="934" y="0" width="161" height="20"/>
<textElement textAlignment="Right">
<font isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="b3192d34-b55c-4a4e-9d38-227fbcd2f2bb" x="1073" y="20" width="22" height="20"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="b1cf4373-eaf7-44ea-a501-f860094844df" x="102" y="20" width="832" height="40"/>
<textElement/>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement uuid="2112e0ea-6df2-448f-8761-5c211d3012d3" mode="Transparent" x="934" y="40" width="161" height="20" forecolor="#000000" backcolor="#FFFFFF"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="718f0c7e-92f9-4204-8405-4b65faf995c6" x="0" y="20" width="102" height="40"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$R{cabecalho.filtros}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="ddc1f7ca-fd85-4698-824f-eba0fbb9e81a" x="0" y="59" width="1096" height="1"/>
</line>
</band>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="a3dea313-f2a7-4388-bd91-5c02e8612b8e" stretchType="RelativeToTallestObject" x="0" y="0" width="102" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.data}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="a228f320-6e89-45a4-aef6-d1e8e76fa7a7" stretchType="RelativeToTallestObject" x="102" y="1" width="210" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.agenciaDescricao}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="6724b194-ae32-48c6-ac74-578fe785e768" stretchType="RelativeToTallestObject" x="312" y="0" width="141" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$R{label.tipo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="6d430f80-9725-4277-8eb7-9c36b8d0496c" stretchType="RelativeToTallestObject" x="453" y="1" width="50" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$R{label.ddd}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="98852ec0-40cc-46f6-8e15-d243abbef01e" x="593" y="0" width="115" height="20"/>
<textElement textAlignment="Left" markup="none"/>
<textFieldExpression><![CDATA[$R{label.situacao}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="97964207-4388-4f8b-be2b-befe4264210c" stretchType="RelativeToTallestObject" x="798" y="0" width="77" height="20"/>
<box rightPadding="2"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="72be8326-4994-4155-b95a-bd7735d2a3c7" stretchType="RelativeToTallestObject" x="503" y="1" width="90" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$R{label.telefone}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="30ef0ac9-9128-48bd-aefc-86d8c21d90f1" stretchType="RelativeToTallestObject" x="708" y="0" width="90" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$R{label.usuario}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="563075ed-e4fc-4364-8217-40acb9920c9b" stretchType="RelativeToTallestObject" x="875" y="0" width="220" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.rvhubId}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="14" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm:ss" isBlankWhenNull="true">
<reportElement uuid="c98526c0-c36f-42df-9308-452ac671044c" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="102" height="14" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{dataVenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
<reportElement uuid="aad51f92-6577-4404-9c57-1d47c0c64c6a" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="102" y="0" width="210" height="14" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{nombPuntoVenta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
<reportElement uuid="e2841610-831d-4379-96ff-e5806f4c1ceb" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="312" y="0" width="141" height="14" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$F{descTipoEvento}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="77d7eb39-6b9d-448d-981b-01813e97d038" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="798" y="0" width="77" height="14" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="a9a0a244-8f87-4ebf-8557-dfde197b4287" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="453" y="0" width="50" height="14" isPrintWhenDetailOverflows="true"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$F{ddd}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="be7f0c15-3826-4f96-a4ce-1c869ccfeaae" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="503" y="0" width="90" height="14"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Top" markup="styled">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{telefone}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="f20aaaa9-f7af-4217-9067-3ae137dd742e" style="zebrado" mode="Opaque" x="593" y="0" width="115" height="14"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[$F{status}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="d0a920ca-cfca-4885-b85e-5c698a999cb7" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="708" y="0" width="90" height="14"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Top" markup="styled">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{usuario}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="e9a7b2ab-8339-42a1-ab27-a7d52a49a3ba" style="zebrado" stretchType="RelativeToTallestObject" mode="Opaque" x="875" y="0" width="219" height="14"/>
<box>
<bottomPen lineWidth="0.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Top" markup="styled">
<font fontName="SansSerif" size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$F{rvhubId}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<summary>
<band height="63" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="417ed1de-ce71-42fa-8108-33a37f6a0626" stretchType="RelativeToTallestObject" x="798" y="3" width="77" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalConfirmado}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="38a0f957-1b50-46f9-b79f-c631baf8937b" x="708" y="3" width="90" height="20"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.totalConfirmado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="98ddf192-0809-4c79-ba56-94461f50b574" stretchType="RelativeToTallestObject" x="798" y="23" width="77" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalCancelado}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="2d1639ce-39de-4145-9b37-e05fe2f104a9" x="708" y="23" width="90" height="20"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.totalCancelado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="c9779e11-a7cc-4860-b0d2-dbe4af4d8369" stretchType="RelativeToTallestObject" x="798" y="43" width="77" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalAutorizado}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="67e54f31-b136-4d9d-9698-1c6357d27282" x="708" y="43" width="90" height="20"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.totalAutorizado}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="7292d068-658e-4a0a-a97c-c856d8700c65" x="1" y="0" width="1096" height="1"/>
</line>
</band>
</summary>
<noData>
<band height="24">
<textField isBlankWhenNull="true">
<reportElement uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091" positionType="Float" x="0" y="0" width="1202" height="24" isPrintWhenDetailOverflows="true"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -1,9 +1,7 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -29,6 +27,7 @@ import com.rjconsultores.ventaboletos.enums.StatusRecargaEnum;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioRecargaRvhub;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -139,13 +138,12 @@ public class RelatorioRecargaRvhubController extends MyGenericForwardComposer {
Map<String, Object> parametros = new HashMap<String, Object>();
StringBuilder filtro = new StringBuilder();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
if (this.datInicial.getValue() != null) {
parametros.put("datInicial", sdf.format(this.datInicial.getValue()));
parametros.put("datInicial", this.datInicial.getValue());
}
if (this.datFinal.getValue() != null) {
parametros.put("datFinal", sdf.format(this.datFinal.getValue()));
parametros.put("datFinal", this.datFinal.getValue());
}
if (parametros.get("datInicial") == null && parametros.get("datFinal") == null) {
@ -155,20 +153,13 @@ public class RelatorioRecargaRvhubController extends MyGenericForwardComposer {
return;
}
filtro.append("Início período: ");
Calendar cal = Calendar.getInstance();
cal.setTime(datInicial.getValue());
filtro.append(cal.get(Calendar.DATE) + "/");
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
filtro.append(cal.get(Calendar.YEAR) + "; ");
filtro.append("Período: ");
filtro.append( DateUtil.getStringDate(datInicial.getValue()));
filtro.append("Fim período: ");
cal.setTime(datFinal.getValue());
filtro.append(cal.get(Calendar.DATE) + "/");
filtro.append((cal.get(Calendar.MONTH) + 1) + "/");
filtro.append(cal.get(Calendar.YEAR) + "; ");
filtro.append(" - ");
filtro.append( DateUtil.getStringDate(datFinal.getValue()));
filtro.append("Empresa: ");
filtro.append("; Empresa: ");
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
Empresa empresa = (Empresa) itemEmpresa.getValue();
@ -230,9 +221,8 @@ public class RelatorioRecargaRvhubController extends MyGenericForwardComposer {
status.deleteCharAt(status.length() - 1);
statusDesc.deleteCharAt(statusDesc.length() - 1);
filtro.append(" Status: ").append(statusDesc);
}
parametros.put("STATUS", status);
}
relatorio = new RelatorioRecargaRvhub(parametros, dataSourceRead.getConnection());
parametros.put("FILTROS", filtro.toString());