frederico 2017-09-04 18:15:12 +00:00
parent 534e9e0ec9
commit 467eede42a
12 changed files with 941 additions and 0 deletions

View File

@ -0,0 +1,170 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioSegundaViaBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioSegundaVia extends Relatorio {
private static Logger log = Logger.getLogger(RelatorioSegundaVia.class);
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
private List<RelatorioSegundaViaBean> lsDadosRelatorio;
public RelatorioSegundaVia(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Map<String, Object> parametros = this.relatorio.getParametros();
Date dataInicial = (Date) parametros.get("dataInicial");
Date dataFinal = (Date) parametros.get("dataFinal");
Integer empresaId = (Integer) parametros.get("empresaId");
Integer puntoVentaId = (Integer) parametros.get("puntoVentaId");
String sql = getSqlDados(dataInicial, dataFinal, empresaId, puntoVentaId);
ResultSet rset = null;
NamedParameterStatement stmt = null;
Connection conexao = this.relatorio.getConexao();
stmt = new NamedParameterStatement(conexao, sql);
stmt.setTimestamp("dataInicial", getDataHoraInicial(dataInicial));
stmt.setTimestamp("dataFinal", getDataHoraFinal(dataFinal));
parametros.put("dataInicial", sdf.format(dataInicial));
parametros.put("dataFinal", sdf.format(dataFinal));
try {
rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioSegundaViaBean>();
while (rset.next()) {
lsDadosRelatorio.add(criarRelatorioSegundaViaBean(rset));
}
setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
try {
if (rset != null) {
rset.close();
}
if (stmt != null) {
stmt.close();
}
} catch (SQLException e) {
log.error(e.getMessage(), e);
}
}
}
private RelatorioSegundaViaBean criarRelatorioSegundaViaBean(ResultSet rset) throws SQLException {
RelatorioSegundaViaBean r = new RelatorioSegundaViaBean();
r.setBilheteiro(rset.getString("bilheteiro"));
r.setBilhete(rset.getInt("bilhete"));
r.setCoo(rset.getInt("coo") == 0 ? null : rset.getInt("coo"));
r.setDataVenda(rset.getTimestamp("dataVenda"));
r.setDataViagem(rset.getDate("dataViagem"));
r.setDestino(rset.getInt("destino"));
r.setOrigem(rset.getInt("origem"));
r.setPedagio(rset.getBigDecimal("pedagio"));
r.setPoltrona(rset.getInt("poltrona"));
r.setPreImpresso(rset.getString("preImpresso"));
r.setPuntoVenta(rset.getInt("puntoVenta"));
r.setSeguro(rset.getBigDecimal("seguro"));
r.setSerieImpFiscal(rset.getString("serieImpFiscal"));
r.setServico(rset.getString("servico"));
r.setTaxa(rset.getBigDecimal("taxa"));
r.setTarifa(rset.getBigDecimal("tarifa"));
return r;
}
});
}
public void setLsDadosRelatorio(List<RelatorioSegundaViaBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
private String getSqlDados(Date dataInicial, Date dataFinal, Integer empresaId, Integer puntoVentaId) {
StringBuilder sql = new StringBuilder();
sql.append("SELECT boleto.CORRIDA_ID AS servico, ");
sql.append("boleto.FECHORVIAJE AS dataViagem, ");
sql.append("boleto.ORIGEN_ID AS origem, ");
sql.append("boleto.DESTINO_ID AS destino, ");
sql.append("boleto.NUMASIENTO AS poltrona, ");
sql.append("boleto.FECHORVENTA AS dataVenda, ");
sql.append("boleto.NUMFOLIOSISTEMA AS bilhete, ");
sql.append("usuario.NOMBUSUARIO AS bilheteiro, ");
sql.append("boleto.PUNTOVENTA_ID AS puntoVenta, ");
sql.append("boleto.PRECIOPAGADO AS tarifa, ");
sql.append("boleto.IMPORTETAXAEMBARQUE AS taxa, ");
sql.append("boleto.IMPORTESEGURO AS seguro, ");
sql.append("boleto.IMPORTEPEDAGIO AS pedagio, ");
sql.append("boleto.COO AS coo, ");
sql.append("boleto.NUMFOLIOPREIMPRESO AS preimpresso, ");
sql.append("boleto.NUMSERIEPREIMPRESA AS seriePreImpresso, ");
sql.append("boleto.SERIEIMPFISCAL AS serieImpFiscal ");
sql.append("FROM BOLETO boleto ");
sql.append("INNER JOIN USUARIO usuario ON boleto.USUARIO_ID = usuario.USUARIO_ID ");
sql.append("WHERE boleto.INDSEGUNDAVIAIMPRESSA = 1 ");
if (dataInicial != null && dataFinal != null) {
sql.append(" AND boleto.FECSEGUNDAVIA BETWEEN :dataInicial AND :dataFinal");
}
if (empresaId != null && empresaId != -1) {
sql.append(" AND boleto.EMPRESACORRIDA_ID = " + empresaId);
}
if (puntoVentaId != null && puntoVentaId != -1) {
sql.append(" AND boleto.PUNTOVENTA_ID = " + puntoVentaId);
}
return sql.toString();
}
@Override
protected void processaParametros() throws Exception {
}
private Timestamp getDataHoraInicial(Date dataInicial) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(dataInicial);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return new Timestamp(calendar.getTime().getTime());
}
private Timestamp getDataHoraFinal(Date dataFinal) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(dataFinal);
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
return new Timestamp(calendar.getTime().getTime());
}
}

View File

@ -0,0 +1,22 @@
cabecalho.nome=Relatório Segunda Via
cabecalho.periodo=Período
cabecalho.periodoA=à
cabecalho.puntoVenta=Agência:
cabecalho.empresa=Empresa:
label.servico=Serviço
label.dataViagem=Data Viagem
label.origem=Origem
label.destino=Destino
label.poltrona=Poltrona
label.dataVenda=Data Venda
label.bilheteiro=Bilheteiro
label.bilhete=Bilhete
label.puntoVenta=Agência
label.tarifa=Tarifa
label.taxa=Taxa
label.seguro=Seguro
label.pedagio=Pedágio
label.coo=Coo
label.preImpresso=Pre Imp.
label.serieImpFiscal=Série
msg.noData=Não foi possivel obter dados com os parâmetros informados.

View File

@ -0,0 +1,22 @@
cabecalho.nome=Relatório Segunda Via
cabecalho.periodo=Período
cabecalho.periodoA=à
cabecalho.puntoVenta=Agência:
cabecalho.empresa=Empresa:
label.servico=Serviço
label.dataViagem=Data Viagem
label.origem=Origem
label.destino=Destino
label.poltrona=Poltrona
label.dataVenda=Data Venda
label.bilheteiro=Bilheteiro
label.bilhete=Bilhete
label.puntoVenta=Agência
label.tarifa=Tarifa
label.taxa=Taxa
label.seguro=Seguro
label.pedagio=Pedágio
label.coo=Coo
label.preImpresso=Pre Imp.
label.serieImpFiscal=Série
msg.noData=Não foi possivel obter dados com os parâmetros informados.

View File

@ -0,0 +1,316 @@
<?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="RelatorioSegundaVia" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="832" leftMargin="5" rightMargin="5" topMargin="20" bottomMargin="20" uuid="0a7b3817-e201-4a91-8edd-6102b120e19f">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="403"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="title"/>
<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"/>
<parameter name="dataInicial" class="java.lang.String"/>
<parameter name="dataFinal" class="java.lang.String"/>
<parameter name="puntoVenta" class="java.lang.String"/>
<parameter name="empresa" class="java.lang.String"/>
<field name="bilheteiro" class="java.lang.String"/>
<field name="bilhete" class="java.lang.Integer"/>
<field name="coo" class="java.lang.Integer"/>
<field name="dataVenda" class="java.util.Date"/>
<field name="dataViagem" class="java.util.Date"/>
<field name="destino" class="java.lang.Integer"/>
<field name="origem" class="java.lang.Integer"/>
<field name="pedagio" class="java.math.BigDecimal"/>
<field name="preImpresso" class="java.lang.String"/>
<field name="puntoVenta" class="java.lang.Integer"/>
<field name="seguro" class="java.math.BigDecimal"/>
<field name="serieImpFiscal" class="java.lang.String"/>
<field name="servico" class="java.lang.String"/>
<field name="taxa" class="java.math.BigDecimal"/>
<field name="poltrona" class="java.lang.Integer"/>
<field name="tarifa" class="java.math.BigDecimal"/>
<title>
<band height="81" splitType="Stretch">
<textField>
<reportElement uuid="6d12efc3-f23b-431a-bfb1-9950e6bfe6fc" x="53" y="61" width="139" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{puntoVenta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7830e707-ce31-4907-8665-aa462d023a82" x="0" y="20" width="620" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{dataInicial} + " " + $R{cabecalho.periodoA} + " " + $P{dataFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b148e230-ff82-488a-bcdd-5ceb2ea723e3" x="0" y="0" width="620" 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="1f9eb9ba-8865-4a88-9dbb-471a1907d3c5" x="638" y="0" width="164" height="20"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="47f0b61e-1ba4-43e4-9a4a-c8e17972b943" x="0" y="61" width="53" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{cabecalho.puntoVenta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="f4c6e5b9-844d-440a-9a47-719101152087" x="0" y="41" width="53" height="20"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$R{cabecalho.empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6985a79c-5487-47e6-acf7-e94ef7c24073" x="53" y="41" width="139" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{empresa}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="20" splitType="Stretch">
<textField>
<reportElement uuid="3ed0e9b0-4cba-410c-b60a-75021ba8aaba" x="0" y="0" width="56" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.servico}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="9dfd606c-5acb-4973-b55c-9ff16699cbae" x="56" y="0" width="56" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataViagem}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="fd9f277b-fe19-442c-8e90-80c6a3ec6a42" x="112" y="0" width="49" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.origem}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="215a6ac2-7b4a-4351-93a5-be690a63294b" x="161" y="0" width="49" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="8e219835-55b3-44d4-924b-d3f90cbfe8bf" x="210" y="0" width="47" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.poltrona}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="42b9ffff-b6c6-48b7-beb2-0e664de7f058" x="257" y="0" width="75" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataVenda}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="6d81ffde-0d85-4b8c-8f3c-28a940854348" x="332" y="0" width="54" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.bilheteiro}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="1ae18e81-d143-469b-9f83-d41bc75d47c9" x="386" y="0" width="45" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.bilhete}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a56cd406-c7e8-48de-8e5d-908cdce4f315" x="431" y="0" width="50" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="630970c1-f08a-4b2d-83f5-6c8882168fde" x="481" y="0" width="52" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.tarifa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="7ccda019-1706-438d-bbce-b40a5171707f" x="533" y="0" width="35" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.taxa}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="459b8152-b3af-40e5-9b14-22214dc92fcc" x="568" y="0" width="42" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.seguro}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="b7690ce2-0872-4780-bbaa-fdb3924c98ac" x="610" y="0" width="53" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.pedagio}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="712db7b3-b00e-44fb-a0ec-286cbc03bf1e" x="663" y="0" width="54" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.coo}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="67b620b9-3720-46a1-8690-9ff642f90989" x="717" y="0" width="50" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.preImpresso}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="3ab501dc-de6e-4534-ad27-0798a00582ab" x="767" y="0" width="65" height="20"/>
<textElement markup="none">
<font size="8" isBold="true" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.serieImpFiscal}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="fa4ed1e8-85a8-44f8-8e0b-6dd8480e37e8" stretchType="RelativeToTallestObject" x="0" y="0" width="56" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="393d66f0-36ac-4111-a1cb-4c86c0ea3b39" stretchType="RelativeToTallestObject" x="56" y="0" width="56" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataViagem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="583d984f-13ec-499f-ac31-8f6672a12336" stretchType="RelativeToTallestObject" x="112" y="0" width="49" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="37e4f928-6c97-4a04-a452-b19832779cd7" stretchType="RelativeToTallestObject" x="161" y="0" width="49" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="5d77e9c4-4b6e-4030-992f-8dcddbe9ad9b" stretchType="RelativeToTallestObject" x="210" y="0" width="47" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{poltrona}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="true">
<reportElement uuid="5f2d301c-5c9d-4f13-b25b-bc121e7a888a" stretchType="RelativeToTallestObject" x="257" y="0" width="75" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataVenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="bc37d096-eb4b-4fc7-a9d2-2c68c619ce5c" stretchType="RelativeToTallestObject" x="332" y="0" width="54" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{bilheteiro}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="c7f146b9-18ea-43b2-90f9-c4535885c64b" stretchType="RelativeToTallestObject" x="386" y="0" width="45" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{bilhete}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="5b133346-bb57-44f0-9a85-b63f0d60f02a" stretchType="RelativeToTallestObject" x="431" y="0" width="50" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{puntoVenta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement uuid="660caf7d-d229-48bb-be15-56107e2187df" stretchType="RelativeToTallestObject" x="481" y="0" width="52" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{tarifa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement uuid="600c5e27-ea07-408f-bb4c-69f3692cbe87" stretchType="RelativeToTallestObject" x="533" y="0" width="35" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{taxa}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement uuid="9a20c316-fc88-45b8-9cba-8c5eac8778ef" stretchType="RelativeToTallestObject" x="568" y="0" width="42" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{seguro}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="###0.00" isBlankWhenNull="true">
<reportElement uuid="fe52b8c5-b00a-40a1-a0fc-80b222ebfbaf" stretchType="RelativeToTallestObject" x="610" y="0" width="53" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{pedagio}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="0ba9dcf2-a371-46c6-9ff1-665c3f3220c1" stretchType="RelativeToTallestObject" x="663" y="0" width="54" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{coo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="469745c1-5c80-4521-b7db-ae84e0046fd2" stretchType="RelativeToTallestObject" x="717" y="0" width="50" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{preImpresso}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="6f65a0ff-bbce-4e7c-aea3-68795952590c" stretchType="RelativeToTallestObject" x="767" y="0" width="65" height="20"/>
<textElement>
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{serieImpFiscal}]]></textFieldExpression>
</textField>
</band>
</detail>
<noData>
<band height="20">
<textField isBlankWhenNull="true">
<reportElement uuid="4236d52e-7d65-4f66-8db1-c717eff5de62" positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="true"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,162 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
import java.util.Date;
public class RelatorioSegundaViaBean {
private String servico;
private Date dataViagem;
private Integer origem;
private Integer destino;
private Integer poltrona;
private Date dataVenda;
private String bilheteiro;
private Integer bilhete;
private Integer puntoVenta;
private BigDecimal taxa;
private BigDecimal tarifa;
private BigDecimal seguro;
private BigDecimal pedagio;
private Integer coo;
private String preImpresso;
private String seriePreImpresso;
private String serieImpFiscal;
public String getServico() {
return servico;
}
public void setServico(String servico) {
this.servico = servico;
}
public Date getDataViagem() {
return dataViagem;
}
public void setDataViagem(Date dataViagem) {
this.dataViagem = dataViagem;
}
public Integer getOrigem() {
return origem;
}
public void setOrigem(Integer origem) {
this.origem = origem;
}
public Integer getDestino() {
return destino;
}
public void setDestino(Integer destino) {
this.destino = destino;
}
public Integer getPoltrona() {
return poltrona;
}
public void setPoltrona(Integer poltrona) {
this.poltrona = poltrona;
}
public Date getDataVenda() {
return dataVenda;
}
public void setDataVenda(Date dataVenda) {
this.dataVenda = dataVenda;
}
public String getBilheteiro() {
return bilheteiro;
}
public void setBilheteiro(String bilheteiro) {
this.bilheteiro = bilheteiro;
}
public Integer getBilhete() {
return bilhete;
}
public void setBilhete(Integer bilhete) {
this.bilhete = bilhete;
}
public Integer getPuntoVenta() {
return puntoVenta;
}
public void setPuntoVenta(Integer puntoVenta) {
this.puntoVenta = puntoVenta;
}
public BigDecimal getTaxa() {
return taxa;
}
public void setTaxa(BigDecimal taxa) {
this.taxa = taxa;
}
public BigDecimal getTarifa() {
return tarifa;
}
public void setTarifa(BigDecimal tarifa) {
this.tarifa = tarifa;
}
public BigDecimal getSeguro() {
return seguro;
}
public void setSeguro(BigDecimal seguro) {
this.seguro = seguro;
}
public BigDecimal getPedagio() {
return pedagio;
}
public void setPedagio(BigDecimal pedagio) {
this.pedagio = pedagio;
}
public Integer getCoo() {
return coo;
}
public void setCoo(Integer coo) {
this.coo = coo;
}
public String getPreImpresso() {
return preImpresso;
}
public void setPreImpresso(String preImpresso) {
this.preImpresso = preImpresso;
}
public String getSeriePreImpresso() {
return seriePreImpresso;
}
public void setSeriePreImpresso(String seriePreImpresso) {
this.seriePreImpresso = seriePreImpresso;
}
public String getSerieImpFiscal() {
return serieImpFiscal;
}
public void setSerieImpFiscal(String serieImpFiscal) {
this.serieImpFiscal = serieImpFiscal;
}
}

View File

@ -0,0 +1,142 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.util.Date;
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.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioSegundaVia;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.PuntoVentaService;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@Controller("relatorioSegundaViaController")
@Scope("prototype")
public class RelatorioSegundaViaController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private DataSource dataSourceRead;
@Autowired
private EmpresaService empresaService;
@Autowired
private PuntoVentaService puntoVentaService;
private List<PuntoVenta> lsPuntoVenta;
private List<Empresa> lsEmpresa;
private Datebox txtDataInicial;
private Datebox txtDataFinal;
private MyComboboxEstandar cmbEmpresa;
private MyComboboxPuntoVenta cmbPuntoVenta;
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
Map<String, Object> parametros = new HashMap<String, Object>();
Empresa empresa = (Empresa) (cmbEmpresa.getSelectedItem() != null ? cmbEmpresa.getSelectedItem().getValue() : null);
PuntoVenta puntoVenta = (PuntoVenta) (cmbPuntoVenta.getSelectedItem() != null ? cmbPuntoVenta.getSelectedItem().getValue() : null);
Date dataInicial = txtDataInicial.getValue();
Date dataFinal = txtDataFinal.getValue();
parametros.put("empresaId", empresa == null ? null : empresa.getEmpresaId());
parametros.put("empresa", empresa == null ? "Todas" : empresa.getNombempresa());
parametros.put("puntoVentaId", puntoVenta == null ? null : puntoVenta.getPuntoventaId());
parametros.put("puntoVenta", puntoVenta == null ? "Todas" : puntoVenta.getNombpuntoventa());
parametros.put("dataInicial", dataInicial);
parametros.put("dataFinal", dataFinal);
parametros.put("NOME_RELATORIO", "RelatorioSegundaVia");
Relatorio relatorio = new RelatorioSegundaVia(parametros, dataSourceRead.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioSegundaViaController.window.title"), args, MODAL);
}
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
super.doAfterCompose(comp);
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
public List<PuntoVenta> getLsPuntoVenta() {
return lsPuntoVenta;
}
public void setLsPuntoVenta(List<PuntoVenta> lsPuntoVenta) {
this.lsPuntoVenta = lsPuntoVenta;
}
public PuntoVentaService getPuntoVentaService() {
return puntoVentaService;
}
public void setPuntoVentaService(PuntoVentaService puntoVentaService) {
this.puntoVentaService = puntoVentaService;
}
public Datebox getTxtDataInicial() {
return txtDataInicial;
}
public void setTxtDataInicial(Datebox txtDataInicial) {
this.txtDataInicial = txtDataInicial;
}
public Datebox getTxtDataFinal() {
return txtDataFinal;
}
public void setTxtDataFinal(Datebox txtDataFinal) {
this.txtDataFinal = txtDataFinal;
}
public MyComboboxEstandar getCmbEmpresa() {
return cmbEmpresa;
}
public void setCmbEmpresa(MyComboboxEstandar cmbEmpresa) {
this.cmbEmpresa = cmbEmpresa;
}
public MyComboboxPuntoVenta getCmbPuntoVenta() {
return cmbPuntoVenta;
}
public void setCmbPuntoVenta(MyComboboxPuntoVenta cmbPuntoVenta) {
this.cmbPuntoVenta = cmbPuntoVenta;
}
}

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 ItemMenuRelatorioSegundaVia extends DefaultItemMenuSistema {
public ItemMenuRelatorioSegundaVia() {
super("indexController.mniRelatorioSegundaVia.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOSEGUNDAVIA";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioSegundaVia.zul",
Labels.getLabel("relatorioSegundaViaController.window.title"), getArgs(), desktop);
}
}

View File

@ -1,4 +1,5 @@
catalogos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.MenuCatalogos catalogos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.MenuCatalogos
catalogos.mensagemRecusa=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuMensagemRecusa
catalogos.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuClaseServicio catalogos.claseServicio=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuClaseServicio
catalogos.categoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCategoria catalogos.categoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuCategoria
catalogos.grupoCategoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuGrupoCategoria catalogos.grupoCategoria=com.rjconsultores.ventaboletos.web.utilerias.menu.item.catalogos.ItemMenuGrupoCategoria
@ -126,6 +127,7 @@ ingresosExtras.ingreso=com.rjconsultores.ventaboletos.web.utilerias.menu.item.in
analitico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.MenuAnalitico analitico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.MenuAnalitico
analitico.item=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.ItemMenuAnalitico analitico.item=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.ItemMenuAnalitico
analitico.gerenciais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.SubMenuGerenciais analitico.gerenciais=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.SubMenuGerenciais
analitico.gerenciais.segundaVia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioSegundaVia
analitico.gerenciais.aidfDetalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAidfDetalhado analitico.gerenciais.aidfDetalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAidfDetalhado
analitico.gerenciais.cancelamentoAutomaticoECF=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCancelamentoAutomaticoECF analitico.gerenciais.cancelamentoAutomaticoECF=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioCancelamentoAutomaticoECF
analitico.gerenciais.confFormulario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioConferenciaFormularioFisico analitico.gerenciais.confFormulario=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioConferenciaFormularioFisico

View File

@ -273,6 +273,7 @@ indexController.mniRelatorioCancelamentoTransacao.label = Cancelamento J3
indexController.mniRelatorioTabelaPreco.label = Reporte de tabla de precios indexController.mniRelatorioTabelaPreco.label = Reporte de tabla de precios
indexController.mniRelatorioAIDF.label = Reporte AIDF indexController.mniRelatorioAIDF.label = Reporte AIDF
indexController.mniRelatorioAIDFDetalhado.label = AIDF detallado indexController.mniRelatorioAIDFDetalhado.label = AIDF detallado
indexController.mniRelatorioSegundaVia.label = Segunda Via
indexController.mniPrecoApanhe.label = Precio Apanhe indexController.mniPrecoApanhe.label = Precio Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Ventas de paquetes - Resumido indexController.mniRelatorioVendasPacotesResumido.label = Ventas de paquetes - Resumido
indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de paquetes - Detallado indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de paquetes - Detallado
@ -700,6 +701,19 @@ relatorioVendasPTAController.lbEmpresa.value = Empresa
relatorioVendasPTAController.lbAgencia.value = Agencia relatorioVendasPTAController.lbAgencia.value = Agencia
relatorioVendasPTAController.lbSituacao.value = Situación relatorioVendasPTAController.lbSituacao.value = Situación
#Relatorio Segunda Via
relatorioSegundaViaController.window.title=Relatório Segunda Via
relatorioSegundaViaController.lbEmpresa.value=Empresa
relatorioSegundaViaController.lbPuntoVenta.value=Agência
relatorioSegundaViaController.lbNumero.value=Número Agência
relatorioSegundaViaController.lbDataInicial.value=Data Inicial
relatorioSegundaViaController.lbDataFinal.value=Data Final
relatorioVendasPTAController.lbSituacao.value = Situação
relatorioVendasPTAController.btnPesquisa.label = Pesquisar
relatorioVendasPTAController.btnLimpar.label = Limpar Seleção
relatorioVendasPTAController.puntoVentaSelList.codigo = Código
relatorioVendasPTAController.puntoVentaSelList.nome = Nome
#Relatório de Serviço Bloqueado na Venda Internet #Relatório de Serviço Bloqueado na Venda Internet
relatorioServicoBloqueadoVendaInternetController.window.title = Reporte corrida bgloqueada en venta internet relatorioServicoBloqueadoVendaInternetController.window.title = Reporte corrida bgloqueada en venta internet
relatorioServicoBloqueadoVendaInternetController.lbDatInicial.value = Fecha inicial relatorioServicoBloqueadoVendaInternetController.lbDatInicial.value = Fecha inicial

View File

@ -290,6 +290,7 @@ indexController.mniRelatorioCancelamentoTransacao.label = Cancelamento J3
indexController.mniRelatorioTabelaPreco.label = Tabela de Preços indexController.mniRelatorioTabelaPreco.label = Tabela de Preços
indexController.mniRelatorioAIDF.label = AIDF indexController.mniRelatorioAIDF.label = AIDF
indexController.mniRelatorioAIDFDetalhado.label = AIDF Detalhado indexController.mniRelatorioAIDFDetalhado.label = AIDF Detalhado
indexController.mniRelatorioSegundaVia.label = Segunda Via
indexController.mniPrecoApanhe.label = Preço Apanhe indexController.mniPrecoApanhe.label = Preço Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes - Resumido indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes - Resumido
indexController.mniRelatorioVendasPacotesDetalhado.label = Vendas de Pacotes - Detalhado indexController.mniRelatorioVendasPacotesDetalhado.label = Vendas de Pacotes - Detalhado
@ -787,6 +788,14 @@ relatorioVendasPTAController.lbDatInicial.value = Data Inicial
relatorioVendasPTAController.lbDatFinal.value = Data Final relatorioVendasPTAController.lbDatFinal.value = Data Final
relatorioVendasPTAController.lbEmpresa.value = Empresa relatorioVendasPTAController.lbEmpresa.value = Empresa
relatorioVendasPTAController.lbAgencia.value = Agência relatorioVendasPTAController.lbAgencia.value = Agência
#Relatorio Segunda Via
relatorioSegundaViaController.window.title=Relatório Segunda Via
relatorioSegundaViaController.lbEmpresa.value=Empresa
relatorioSegundaViaController.lbPuntoVenta.value=Agência
relatorioSegundaViaController.lbNumero.value=Número Agência
relatorioSegundaViaController.lbDataInicial.value=Data Inicial
relatorioSegundaViaController.lbDataFinal.value=Data Final
relatorioVendasPTAController.lbSituacao.value = Situação relatorioVendasPTAController.lbSituacao.value = Situação
relatorioVendasPTAController.btnPesquisa.label = Pesquisar relatorioVendasPTAController.btnPesquisa.label = Pesquisar
relatorioVendasPTAController.btnLimpar.label = Limpar Seleção relatorioVendasPTAController.btnLimpar.label = Limpar Seleção

View File

@ -0,0 +1,57 @@
<?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="winFiltroRelatorioSegundaVia"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioSegundaVia" apply="${relatorioSegundaViaController}"
contentStyle="overflow:auto"
height="150px" width="538px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="25%" />
<column width="30%" />
<column width="15%" />
<column width="30%" />
</columns>
<rows>
<row>
<label value="${c:l('relatorioSegundaViaController.lbDataInicial.value')}" />
<datebox id="txtDataInicial" width="100%" mold="rounded" format="dd/MM/yyyy"
constraint="no empty" maxlength="10" />
<label value="${c:l('relatorioSegundaViaController.lbDataFinal.value')}" />
<datebox id="txtDataFinal" width="100%" mold="rounded" format="dd/MM/yyyy"
constraint="no empty" maxlength="10" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioAidfDetalhadoController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioSegundaVia$composer.lsEmpresa}"
width="100%" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioSegundaViaController.lbPuntoVenta.value')}" />
<combobox id="cmbPuntoVenta"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"
width="100%" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>