frederico 2016-07-28 18:04:33 +00:00
parent 42e28a3167
commit 315eff2447
10 changed files with 1259 additions and 0 deletions

View File

@ -0,0 +1,118 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.ArrayDataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
public class RelatorioRemarcacaoDevolucao extends Relatorio {
public RelatorioRemarcacaoDevolucao(Map<String, Object> parametros, Connection conexao, ConstanteService constanteService, final Boolean isRemarcacao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new ArrayDataSource(this) {
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String sql = getSql((Integer) parametros.get("EMPRESA_ID"), (String) parametros.get("NUMPUNTOVENTA"), isRemarcacao);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
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 rset = stmt.executeQuery();
List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
while (rset.next()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("dataRemarcacaoDevolucao", rset.getTimestamp("dataRemarcacaoDevolucao"));
dataResult.put("dataVenta", rset.getTimestamp("dataVenta"));
dataResult.put("origem", rset.getString("origem"));
dataResult.put("destino", rset.getString("destino"));
dataResult.put("agencia", rset.getString("agencia"));
dataResult.put("linha", rset.getString("linha"));
dataResult.put("servico", rset.getInt("servico"));
if (isRemarcacao) {
dataResult.put("dataViagemOriginal", rset.getTimestamp("dataViagemOriginal"));
}
dataResult.put("passageiro", rset.getString("passageiro"));
dataResult.put("documento", rset.getString("documento"));
dataResult.put("preco", rset.getBigDecimal("preço"));
dataResult.put("multa", rset.getBigDecimal("multa"));
data.add(dataResult);
}
if (!data.isEmpty()) {
Map<String, Object> dataResult = new HashMap<String, Object>();
dataResult.put("temDados", true);
this.dados.add(dataResult);
parametros.put("data", data);
}
this.resultSet = rset;
}
});
}
@Override
protected void processaParametros() throws Exception {
}
private String getSql(Integer empresaId, String puntoVentasId, Boolean isRemarcacao) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT ");
sql.append("boleto.FECHORVENTA as dataRemarcacaoDevolucao, ");
sql.append("boletoOriginal.FECHORVENTA as dataVenta, ");
sql.append("origem.DESCPARADA as origem, ");
sql.append("destino.DESCPARADA as destino, ");
sql.append("agencia.NOMBPUNTOVENTA as agencia, ");
sql.append("linha.DESCRUTA as linha, ");
sql.append("servico.CORRIDA_ID as servico, ");
sql.append(isRemarcacao ? "boletoOriginal.FECHORVIAJE as dataViagemOriginal, " : " ");
sql.append("CASE WHEN cliente.CLIENTE_ID IS NULL THEN boleto.NOMBPASAJERO ELSE cliente.NOMBCLIENTE END as passageiro, ");
sql.append("CASE WHEN cliente.CLIENTE_ID IS NULL THEN boleto.DESCNUMDOC ELSE cliente.NUMIDENTIFICAUNO END as documento, ");
sql.append("boleto.PRECIOPAGADO as preço, ");
sql.append("COALESCE(eventoExtra.IMPINGRESO,0) as multa ");
sql.append("FROM BOLETO boleto ");
sql.append("INNER JOIN BOLETO boletoOriginal ON boletoOriginal.BOLETO_ID = boleto.BOLETOORIGINAL_ID ");
sql.append("INNER JOIN PARADA origem ON origem.PARADA_ID = boleto.ORIGEN_ID ");
sql.append("INNER JOIN PARADA destino ON destino.PARADA_ID = boleto.DESTINO_ID ");
sql.append("INNER JOIN RUTA linha ON linha.RUTA_ID = boleto.RUTA_ID ");
sql.append("INNER JOIN CORRIDA servico ON (servico.CORRIDA_ID = boleto.CORRIDA_ID AND servico.FECCORRIDA = boleto.FECCORRIDA) ");
sql.append("LEFT JOIN EVENTO_EXTRA eventoExtra ON eventoExtra.BOLETO_ID = boleto.BOLETO_ID ");
sql.append("INNER JOIN MARCA marca ON marca.MARCA_ID = boleto.MARCA_ID ");
sql.append("LEFT JOIN CLIENTE cliente ON cliente.CLIENTE_ID = boleto.CLIENTE_ID ");
sql.append("INNER JOIN PUNTO_VENTA agencia ON agencia.PUNTOVENTA_ID = boleto.PUNTOVENTA_ID ");
sql.append("WHERE ");
sql.append(isRemarcacao ? "boleto.MOTIVOCANCELACION_ID = 23 " : "boleto.MOTIVOCANCELACION_ID = 32 ");
sql.append(isRemarcacao ? "AND boleto.INDSTATUSBOLETO = 'T' " : " ");
sql.append("AND boleto.FECHORVENTA BETWEEN :data_inicial AND :data_final ");
sql.append("AND boleto.INDCANCELACION = 0 ");
sql.append("AND boleto.INDREIMPRESION = 0 ");
if (empresaId != null) {
sql.append("AND marca.EMPRESA_ID = ").append(empresaId);
}
if (puntoVentasId != null && !puntoVentasId.isEmpty()) {
sql.append("AND agencia.PUNTOVENTA_ID IN (").append(puntoVentasId).append(") ");
}
return sql.toString();
}
}

View File

@ -0,0 +1,24 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
#Labels detail
detail.dataRemarcacao=Data Remarcação
detail.dataDevolucao=Data Devolucação
detail.dataVenta=Data Venda
detail.origem=Origem
detail.destino=Destino
detail.agencia=Agência
detail.linha=Linha
detail.servico=Serviço
detail.dataViagemOriginal=Data Viagem Original
detail.passageiro=Passageiro
detail.documento=Doc
detail.preco=Preço
detail.multa=Multa

View File

@ -0,0 +1,24 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
msg.a=à
#Labels header
header.periodo=Período:
header.data.hora=Data/Hora\:
header.pagina=Página\:
header.filtro=Filtro\:
#Labels detail
detail.dataRemarcacao=Data Remarcação
detail.dataDevolucao=Data Devolucação
detail.dataVenta=Data Venda
detail.origem=Origem
detail.destino=Destino
detail.agencia=Agência
detail.linha=Linha
detail.servico=Serviço
detail.dataViagemOriginal=Data Viagem Original
detail.passageiro=Passageiro
detail.documento=Doc
detail.preco=Preço
detail.multa=Multa

View File

@ -0,0 +1,701 @@
<?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="RelatorioRemarcacaoDevolucao" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="832" leftMargin="5" rightMargin="5" topMargin="20" bottomMargin="20" uuid="8aea274b-8721-4a52-9161-42afeb6b49c9">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="pageHeader"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageFooter"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.3" value="title"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 2_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 3">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 3_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 4">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 4_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 4_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 4_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="New Dataset 1" uuid="13332cb4-bf49-48a7-bafa-9b033764a01e">
<field name="dataRemarcacaoDevolucao" class="java.util.Date"/>
<field name="dataVenta" class="java.util.Date"/>
<field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/>
<field name="agencia" class="java.lang.String"/>
<field name="linha" class="java.lang.String"/>
<field name="servico" class="java.lang.Integer"/>
<field name="dataViagemOriginal" class="java.util.Date"/>
<field name="passageiro" class="java.lang.String"/>
<field name="preco" class="java.math.BigDecimal"/>
<field name="multa" class="java.math.BigDecimal"/>
<field name="documento" class="java.lang.String"/>
</subDataset>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="IS_REMARCACAO" class="java.lang.Boolean"/>
<parameter name="TITULO" class="java.lang.String"/>
<parameter name="teste" class="java.lang.Boolean"/>
<parameter name="data" class="java.util.List"/>
<parameter name="FILTROS" class="java.lang.String"/>
<parameter name="formato" class="java.lang.String"/>
<field name="dataRemarcacaoDevolucao" class="java.util.Date"/>
<field name="dataVenta" class="java.util.Date"/>
<field name="origem" class="java.lang.String"/>
<field name="destino" class="java.lang.String"/>
<field name="agencia" class="java.lang.String"/>
<field name="linha" class="java.lang.String"/>
<field name="servico" class="java.lang.Integer"/>
<field name="dataViagemOriginal" class="java.util.Date"/>
<field name="passageiro" class="java.lang.String"/>
<field name="preco" class="java.math.BigDecimal"/>
<field name="multa" class="java.math.BigDecimal"/>
<field name="documento" class="java.lang.String"/>
<title>
<band height="94" splitType="Stretch">
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="1d25eae5-3bdd-4191-b928-a22eaf7e5a03" x="732" y="0" width="98" height="20"/>
<textElement textAlignment="Left"/>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="be5f7ffc-da87-44a0-bfcc-84cd0f66f36a" x="676" y="0" width="56" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d4b4816b-da66-4d25-9c22-d30bd55dc34c" x="781" y="20" width="27" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}+" de"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="5f47e34e-efae-4d91-b7ca-04aecfc909f5" x="808" y="20" width="22" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement uuid="3329905a-f0cd-4788-8a38-722dc6d4f9a7" x="49" y="20" width="77" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="11d7e7d5-9128-40a8-ae73-406b86f9bee8" x="744" y="20" width="37" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.pagina}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d0939e91-23cf-4ecf-9dce-272002419d19" x="0" y="0" width="231" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="201503fc-95d2-4d13-a2f4-39e0a786fc57" x="0" y="20" width="49" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.periodo}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="false">
<reportElement uuid="8ba1afc9-cc5f-4947-ab31-cb7273ad8123" x="164" y="20" width="78" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="9edd4bc8-ce45-47d4-90f5-59f0def26e72" x="126" y="20" width="38" height="20"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$R{msg.a}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1340c66f-18a6-421d-905a-aa5c863b6192" x="49" y="74" width="742" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="4c4004ee-7bb0-4438-81f8-86d8c7d2fefe" x="0" y="74" width="49" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{header.filtro}]]></textFieldExpression>
</textField>
</band>
</title>
<detail>
<band height="220" splitType="Stretch">
<componentElement>
<reportElement uuid="58f96b74-fd09-491b-8c94-36ea8b90b501" key="table 4" style="table 4" positionType="Float" x="0" y="0" width="830" height="110" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$P{IS_REMARCACAO}]]></printWhenExpression>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="New Dataset 1" uuid="7ca3ac0c-e1ef-4128-876f-b3e7d8f3b6b5">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{data})]]></dataSourceExpression>
</datasetRun>
<jr:column width="90" uuid="7c52851d-9ca3-466e-9a9a-9edbf5cb7722">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="137da473-f682-4209-8fc7-bbc60a9851bb" x="0" y="0" width="90" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataVenta}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="3d1182a7-215f-4092-9896-0df2836dbd8c" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dataVenta}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="73369793-0d88-43ab-9f2b-a7d82aea6557">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="287869c0-3b83-4be5-9a77-3a838e165e6b" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.origem}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="9e73afe1-281c-4dec-88fb-f3bd3f8acb55" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="31cc66ac-de74-4b6b-afc0-6c8446e70ec9">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="bcf47ee4-dde6-472e-a8ba-9dcb95ead828" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="bb88ab68-033d-4355-91aa-bac368ed2739" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="46fa6332-955c-49ad-a298-af0efdfb0521">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="b494236c-76c4-479b-b5b4-f2e99bf5e636" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.agencia}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="f378c398-6530-4044-b63d-7f64dc60b036" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{agencia}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="f0564294-2879-457d-be66-2c65118f4805">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="63be6b99-a4b3-4820-8e03-4a91932fcd6f" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.linha}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="d9917c4c-5572-4492-a71f-d3a98d38528a" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{linha}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="84967c49-db8f-4cb5-bfd6-e191775555b8">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="943b0707-f849-42d5-afee-4f4523d5361a" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.servico}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="d33b7ccf-55da-4715-b2b1-3ff3f0927b3b" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="a8cb0e77-2b52-4cf8-967a-e707e33102e7">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="3dcb6050-c6e1-4eb7-835d-5ef21e11c1ad" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.passageiro}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="9cf2d41b-269b-44ea-a099-d57274ecd906" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{passageiro}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="c016b561-84f8-4004-b14c-f93e028b9a4e">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="54614ac3-b675-4f4b-b16e-a093c0938165" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.documento}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="faf32da2-2f6d-424a-8c2a-456987dd017e" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{documento}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="b218d2fe-8df1-4c72-8bb1-e810f674d5d9">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="aa475f49-13f6-4101-859f-3d2f3402a260" x="0" y="0" width="90" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataViagemOriginal}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="577766d9-e68c-4553-a389-b31dcc441d84" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dataViagemOriginal}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="d5e189c1-875b-402b-940e-20d8e254e085">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="dec4d559-0a21-4a7c-a854-f1a55a2c3f31" x="0" y="0" width="90" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataRemarcacao}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="3b7e0e6d-e79a-48a1-a54d-da6fce1b358b" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dataRemarcacaoDevolucao}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="f1ebd3b7-4c66-42b7-903a-6bf62cb2d34b">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="bc0152ce-9ebc-42cd-95de-88fd7679457f" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.preco}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="#,##0.00">
<reportElement uuid="34593c44-8428-4180-826a-5f52eda10e4f" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{preco}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="7a53b7d4-3bbc-494b-9f5f-8451efa5a158">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement uuid="a24dc6d8-906a-4549-a372-2fb8c9f5cb49" x="0" y="0" width="61" height="30" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
</reportElement>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.multa}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="#,##0.00">
<reportElement uuid="46175e6d-7ab4-475e-b5e1-885c87f5c565" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{multa}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
<componentElement>
<reportElement uuid="c740ab37-04eb-40a9-80a1-e3a3dd5c7ed7" key="table 4" style="table 4" positionType="Float" x="0" y="110" width="832" height="110" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[!$P{IS_REMARCACAO}]]></printWhenExpression>
</reportElement>
<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
<datasetRun subDataset="New Dataset 1" uuid="be1789c4-996b-4444-973a-a981c4a559ee">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{data})]]></dataSourceExpression>
</datasetRun>
<jr:column width="90" uuid="f9ac65cb-5f28-42ab-ba30-9a36833f0b66">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="e85eadd5-58fd-4a3a-acdc-981a8ad74785" x="0" y="0" width="90" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataVenta}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="8aa31f3e-3bfa-4e68-b43d-1d2a278bf3fd" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dataVenta}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="cf9c12ab-2e1b-4f80-af3b-58e805f07c17">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="2d02763a-7550-4bbb-b444-b6a8bb1bb8c5" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.origem}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="25b7a795-497d-4d2c-a2b2-259e3eb8e9e5" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="b4498f40-4a3d-47f1-811c-a8dfbe3eb3ff">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="9d02e5bd-0c77-4de8-937e-83683d1a24f4" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="85e7fa41-21bf-4045-9a06-446ce1be0f43" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="325894dd-a30b-47bf-b704-86ed6f53821c">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="36b379f4-8509-4ac1-b06c-2ef4230fe869" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.agencia}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="c94d985a-8512-4490-987c-028c5f8a4c35" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{agencia}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="bd26312a-c242-4726-9588-12306d5cab07">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="a098eece-64a6-4535-9444-7044510d4891" x="0" y="0" width="90" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.linha}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="3f21db36-3758-4d82-81e7-3b60ee415d4c" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{linha}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="646acd43-a90c-4db2-98be-b5030af74b22">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="3abefbba-f547-4679-b46d-033069bfa3f0" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.servico}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="02d0dc39-895c-473c-acc2-d9043510bb04" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="c5f20838-c6d2-4939-bffe-c4c4fb925150">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="e20c9100-2224-48ce-a7c4-8b93f71932b8" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.passageiro}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="73cd59c9-2ef1-491e-9146-86fc2b6af605" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{passageiro}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="61" uuid="7f35ff8d-ef6c-416b-b4e5-3c4368a4f7e8">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="8afd26a3-f97b-4097-ae84-dfa21b313dd1" x="0" y="0" width="61" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.documento}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true">
<reportElement uuid="7dadc24c-24f3-4cfa-890f-fdb07b15bf02" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="61" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{documento}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="90" uuid="44267c11-d4a4-422f-9ecb-ced2bd605986">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="1446b64b-5f3e-4c41-9b84-8165a008908f" x="0" y="0" width="90" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.dataDevolucao}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm">
<reportElement uuid="868e81e9-c0fa-46fa-a055-c412d5698739" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="90" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{dataRemarcacaoDevolucao}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="62" uuid="eb283198-934b-4c96-aaf4-792b99aa7377">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="619e0051-d9bc-4e09-9fa3-4982466a19e1" x="0" y="0" width="62" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.preco}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="#,##0.00">
<reportElement uuid="459899cc-95ba-4102-a684-5b2d0994f2d1" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="62" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{preco}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="62" uuid="80c7a7d7-012f-4afb-851d-7d903edffe14">
<jr:tableHeader style="table 4_TH" height="0" rowSpan="1"/>
<jr:columnHeader style="table 4_CH" height="30" rowSpan="1">
<textField>
<reportElement uuid="19b6d697-6adb-49a4-8be2-9c4d813c169c" x="0" y="0" width="62" height="30"/>
<textElement markup="none">
<font isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{detail.multa}]]></textFieldExpression>
</textField>
</jr:columnHeader>
<jr:detailCell style="table 4_TD" height="20" rowSpan="1">
<textField isStretchWithOverflow="true" pattern="#,##0.00">
<reportElement uuid="efbac3b3-dbc2-40d0-8563-17367148f8c1" positionType="Float" stretchType="RelativeToBandHeight" x="0" y="0" width="62" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{multa}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
<noData>
<band height="20">
<textField>
<reportElement uuid="df5ce216-9162-49e8-a571-cac4ede62096" x="0" y="0" width="832" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,241 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zhtml.Messagebox;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Radio;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioRemarcacaoDevolucao;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.ConstanteService;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiro;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderRelatorioVendasBilheteiroSelecionados;
@Controller("relatorioRemarcacaoDevolucaoController")
@Scope("prototype")
public class RelatorioRemarcacaoDevolucaoController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
private Datebox datInicial;
private Datebox datFinal;
private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresa;
private Paging pagingPuntoVenta;
private MyTextbox txtNombrePuntoVenta;
private MyListbox puntoVentaList;
private MyListbox puntoVentaSelList;
private Radio rdbTipoRemarcao;
@Autowired
private EmpresaService empresaService;
@Autowired
private ConstanteService constanteService;
@Autowired
private DataSource dataSourceRead;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
super.doAfterCompose(comp);
puntoVentaList.setItemRenderer(new RenderRelatorioVendasBilheteiro());
puntoVentaSelList.setItemRenderer(new RenderRelatorioVendasBilheteiroSelecionados());
rdbTipoRemarcao.setSelected(true);
}
/**
* @throws Exception
*
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
{
if (datInicial != null && datFinal != null && datFinal.getValue().compareTo(datInicial.getValue()) < 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioCancelamentoVendaCartaoController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
} else
{
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
String titulo = rdbTipoRemarcao.isSelected() ?
Labels.getLabel("relatorioRemarcacaoDevolucao.relatorioRemarcacao.title")
: Labels.getLabel("relatorioRemarcacaoDevolucao.relatorioDevolução.title");
StringBuilder filtro = new StringBuilder();
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("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) + "; ");
parametros.put("DATA_INICIAL", (java.util.Date) datInicial.getValue());
parametros.put("DATA_FINAL", (java.util.Date) datFinal.getValue());
parametros.put("TITULO", titulo);
parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString());
parametros.put("USUARIO_NOME", UsuarioLogado.getUsuarioLogado().getNombusuario());
filtro.append("Empresa: ");
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
Empresa empresa = (Empresa) itemEmpresa.getValue();
parametros.put("EMPRESA_ID", empresa.getEmpresaId());
filtro.append(empresa.getNombempresa() + ";");
} else {
filtro.append(" Todas;");
}
filtro.append("Agência: ");
String puntoVentas = "";
List<PuntoVenta> lsPuntoVentaSelecionados = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsPuntoVentaSelecionados.isEmpty()) {
puntoVentas = "Todas";
} else {
StringBuilder puntoVentaIds = new StringBuilder();
for (int i = 0; i < lsPuntoVentaSelecionados.size(); i++) {
PuntoVenta puntoVenta = lsPuntoVentaSelecionados.get(i);
puntoVentas = puntoVentas + puntoVenta.getNombpuntoventa() + ",";
if (puntoVentaIds.length() > 0) {
puntoVentaIds.append(",");
}
puntoVentaIds.append(puntoVenta.getPuntoventaId());
}
parametros.put("NUMPUNTOVENTA", puntoVentaIds.toString());
}
filtro.append(puntoVentas).append(";");
parametros.put("FILTROS", filtro.toString());
parametros.put("IS_REMARCACAO", rdbTipoRemarcao.isSelected());
relatorio = new RelatorioRemarcacaoDevolucao(parametros, dataSourceRead.getConnection(), constanteService, rdbTipoRemarcao.isSelected());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul", titulo, args, MODAL);
}
}
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
private void executarPesquisa() {
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
puntoVentaBusqueda.addSortAsc("nombpuntoventa");
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
if (puntoVentaList.getData().length == 0) {
try {
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
Labels.getLabel("relatorioVendasBilheteiroController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
public void onClick$btnLimpar(Event ev) {
puntoVentaList.setData(new ArrayList<PuntoVenta>());
txtNombrePuntoVenta.setText("");
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVenta);
}
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVenta);
}
public Datebox getDatInicial() {
return datInicial;
}
public void setDatInicial(Datebox datInicial) {
this.datInicial = datInicial;
}
public Datebox getDatFinal() {
return datFinal;
}
public void setDatFinal(Datebox datFinal) {
this.datFinal = datFinal;
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
public MyComboboxEstandar getCmbEmpresa() {
return cmbEmpresa;
}
public void setCmbEmpresa(MyComboboxEstandar cmbEmpresa) {
this.cmbEmpresa = cmbEmpresa;
}
}

View File

@ -0,0 +1,25 @@
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios;
import org.zkoss.util.resource.Labels;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
public class ItemMenuRelatorioRemarcacaoDevolucao extends DefaultItemMenuSistema {
public ItemMenuRelatorioRemarcacaoDevolucao() {
super("indexController.mniRelatorioRemarcacaoDevolucao.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOREMARCACAODEVOLUCAO";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioRemarcacaoDevolucao.zul",
Labels.getLabel("relatorioRemarcacaoDevolucao.window.title"), getArgs(), desktop);
}
}

View File

@ -6560,3 +6560,11 @@ relatorioErrosIntegracaoBGMController.btnPesquisa.label = Buscar
relatorioErrosIntegracaoBGMController.btnLimpar.label = Limpar relatorioErrosIntegracaoBGMController.btnLimpar.label = Limpar
relatorioErrosIntegracaoBGMController.lbNumero.value = Número Agência relatorioErrosIntegracaoBGMController.lbNumero.value = Número Agência
# Relatorio Remarcacao Devolucao
indexController.mniRelatorioRemarcacaoDevolucao.label = Relatório Remarcação/Devolução
relatorioRemarcacaoDevolucao.window.title = Relatório Remarcação/Devolução
relatorioRemarcacaoDevolucao.relatorioRemarcacao.title = Relatório de Remarcação
relatorioRemarcacaoDevolucao.relatorioDevolução.title = Relatório de Devolução
relatorioRemarcacaoDevolucao.remarcacao.value = Remarcação
relatorioRemarcacaoDevolucao.devolucao.value = Devolucação
relatorioRemarcacaoDevolucao.tipo.label = Tipo

View File

@ -6699,4 +6699,12 @@ relatorioErrosIntegracaoBGMController.btnLimpar.label = Limpar
relatorioErrosIntegracaoBGMController.lbNumero.value = Número Agência relatorioErrosIntegracaoBGMController.lbNumero.value = Número Agência
# Relatorio Remarcacao Devolucao
indexController.mniRelatorioRemarcacaoDevolucao.label = Relatório Remarcação/Devolução
relatorioRemarcacaoDevolucao.window.title = Relatório Remarcação/Devolução
relatorioRemarcacaoDevolucao.relatorioRemarcacao.title = Relatório de Remarcação
relatorioRemarcacaoDevolucao.relatorioDevolução.title = Relatório de Devolução
relatorioRemarcacaoDevolucao.remarcacao.value = Remarcação
relatorioRemarcacaoDevolucao.devolucao.value = Devolucação
relatorioRemarcacaoDevolucao.tipo.label = Tipo

View File

@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<?page contentType="text/html;charset=UTF-8"?>
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioRemarcacaoDevolucao"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioRemarcacaoDevolucao"
apply="${relatorioRemarcacaoDevolucaoController}" contentStyle="overflow:auto"
height="310px" width="550px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="25%" />
<column width="30%" />
<column width="15%" />
<column width="30%" />
</columns>
<rows>
<row spans="1,3">
<label value="${c:l('relatorioRemarcacaoDevolucao.tipo.label')}" />
<radiogroup Id="groupTipo" >
<radio id="rdbTipoRemarcao" label="${c:l('relatorioRemarcacaoDevolucao.remarcacao.value')}" />
<radio id="rdbTipoDevolucao" label="${c:l('relatorioRemarcacaoDevolucao.devolucao.value')}" />
</radiogroup>
</row>
<row>
<label
value="${c:l('relatorioCancelamentoVendaCartaoController.datainicial.value')}" />
<datebox id="datInicial" format="dd/MM/yyyy"
width="90%" lenient="true" constraint="no empty"
maxlength="10" />
<label
value="${c:l('relatorioCancelamentoVendaCartaoController.dataFinal.value')}" />
<datebox id="datFinal" format="dd/MM/yyyy"
width="90%" lenient="true" constraint="no empty"
maxlength="10" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioCancelamentoVendaCartaoController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioRemarcacaoDevolucao$composer.lsEmpresa}"
width="100%" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioCancelamentoVendaCartaoController.lbPuntoVenta.value')}"/>
<bandbox id="bbPesquisaPuntoVenta" width="100%"
mold="rounded" readonly="true">
<bandpopup>
<vbox>
<hbox>
<label
value="${c:l('relatorioCancelamentoVendaCartaoController.lbPuntoVenta.value')}" />
<textbox id="txtNombrePuntoVenta"
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
width="300px" mold="rounded" />
<button id="btnPesquisa"
image="/gui/img/find.png"
label="${c:l('relatorioCancelamentoVendaCartaoController.btnPesquisa.label')}" />
<button id="btnLimpar"
image="/gui/img/eraser.png"
label="${c:l('relatorioCancelamentoVendaCartaoController.btnLimpar.label')}" />
</hbox>
<paging id="pagingPuntoVenta" pageSize="10" />
<listbox id="puntoVentaList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100%" width="700px">
<listhead>
<listheader
label="${c:l('relatorioCancelamentoVendaCartaoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioCancelamentoVendaCartaoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioCancelamentoVendaCartaoController.lbNumero.value')}" />
</listhead>
</listbox>
</vbox>
</bandpopup>
</bandbox>
</row>
<row spans="4">
<listbox id="puntoVentaSelList" mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" height="100px" width="100%">
<listhead>
<listheader
label="${c:l('relatorioCancelamentoVendaCartaoController.lbPuntoVenta.value')}" />
<listheader width="35%"
label="${c:l('relatorioCancelamentoVendaCartaoController.lbEmpresa.value')}" />
<listheader width="20%"
label="${c:l('relatorioCancelamentoVendaCartaoController.lbNumero.value')}" />
<listheader width="8%" />
</listhead>
</listbox>
<paging id="pagingSelPuntoVenta" pageSize="10" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>