walace 2017-08-23 13:02:27 +00:00
parent 041023331c
commit e22eaa5b7b
13 changed files with 1329 additions and 18 deletions

View File

@ -0,0 +1,245 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.enums.SituacaoBoleto;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPTABean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioVendasPTA extends Relatorio {
public RelatorioVendasPTA(Map<String, Object> parametros, Connection conexao) {
super(parametros, conexao);
}
private List<RelatorioVendasPTABean> lsDadosRelatorio;
@Override
protected void processaParametros() throws Exception {
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Connection conexao = this.relatorio.getConexao();
Map<String, Object> parametros = this.relatorio.getParametros();
String dataInicial = parametros.get("DATA_INICIAL").toString() + " 00:00:00";
String dataFinal = parametros.get("DATA_FINAL").toString() + " 23:59:59";
Empresa empresa = (Empresa) parametros.get("EMPRESA");
String agencia = (String) parametros.get("PUNTOVENTA");
SituacaoBoleto situacaoBoleto = (SituacaoBoleto) parametros.get("SITUACAO_BOLETO");
String sql = getSql(empresa, agencia, dataInicial, dataFinal, situacaoBoleto);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
stmt.setTimestamp("DATA_INICIAL", (Timestamp) parametros.get("DATA_INICIAL"));
stmt.setTimestamp("DATA_FINAL", (Timestamp) parametros.get("DATA_FINAL"));
ResultSet rset = null;
rset = stmt.executeQuery();
lsDadosRelatorio = new ArrayList<RelatorioVendasPTABean>();
lsDadosRelatorio = new ArrayList<RelatorioVendasPTABean>();
BigDecimal saldo = BigDecimal.ZERO;
BigDecimal total = BigDecimal.ZERO;
while (rset.next()) {
RelatorioVendasPTABean vendasPTABean = new RelatorioVendasPTABean();
vendasPTABean.setPreco((BigDecimal) rset.getObject("preco"));
vendasPTABean.setTaxas((BigDecimal) rset.getObject("taxas"));
vendasPTABean.setBilhete((String) rset.getObject("bilhete"));
vendasPTABean.setNomeAgenciaVenda((String) rset.getObject("nomeAgenciaVenda"));
vendasPTABean.setAgencia((String) rset.getObject("agencia"));
vendasPTABean.setStatus((String) rset.getObject("status"));
vendasPTABean.setServico((BigDecimal) rset.getObject("servico"));
vendasPTABean.setPoltrona((String) rset.getObject("poltrona"));
vendasPTABean.setDescricaoLinha((String) rset.getObject("descricaoLinha"));
vendasPTABean.setDescricaoOrigem((String) rset.getObject("descricaoOrigem"));
vendasPTABean.setDescricaoDestino((String) rset.getObject("descricaoDestino"));
vendasPTABean.setDataEmbarque((Date) rset.getObject("dataEmbarque"));
vendasPTABean.setDataEmissao((Date) rset.getObject("dataEmissao"));
if (vendasPTABean.getStatus().equals("VENDIDO")) {
vendasPTABean.setSituacaoVendido("V");
saldo = saldo.add(vendasPTABean.getPreco() != null ? vendasPTABean.getPreco() : BigDecimal.ZERO);
} else {
BigDecimal situacao = (BigDecimal) rset.getObject("situacaoCancelado");
vendasPTABean.setSituacaoCancelado(situacao.toString());
if (vendasPTABean.getSituacaoCancelado().equals("31")) {
vendasPTABean.setSituacaoCancelado("A");
} else if (vendasPTABean.getSituacaoCancelado().equals("32")) {
vendasPTABean.setSituacaoCancelado("D");
} else if (vendasPTABean.getSituacaoCancelado().equals("23")) {
vendasPTABean.setSituacaoCancelado("R");
} else if (vendasPTABean.getSituacaoCancelado().equals("10")) {
vendasPTABean.setSituacaoCancelado("TP");
}
total = total.add(vendasPTABean.getPreco() != null ? vendasPTABean.getPreco() : BigDecimal.ZERO);
}
lsDadosRelatorio.add(vendasPTABean);
}
if (lsDadosRelatorio.size() > 0) {
setLsDadosRelatorio(lsDadosRelatorio);
parametros.put("SALDO", saldo.subtract(total));
parametros.put("TOTAL", total);
}
}
});
}
public void setLsDadosRelatorio(List<RelatorioVendasPTABean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
private String getSql(Empresa empresa, String agencia, String fecInicio, String fecFinal, SituacaoBoleto situacaoBoleto) {
StringBuilder sql = new StringBuilder();
String motivoCancelacion = "";
if (situacaoBoleto.getCodigo().equals(31)) {
motivoCancelacion = "31";
} else if (situacaoBoleto.getCodigo().equals(32)) {
motivoCancelacion = "32";
} else if (situacaoBoleto.getCodigo().equals(23)) {
motivoCancelacion = "23";
} else if (situacaoBoleto.getCodigo().equals(10)) {
motivoCancelacion = "10";
} else {
motivoCancelacion = "31, 32, 23, 10";
}
if (situacaoBoleto.getCodigo().equals(1)) { // Somente Vendidos
sql.append("SELECT 'VENDIDO' as status, pv.NOMBPUNTOVENTA as nomeAgenciaVenda, pe.NOMBPUNTOVENTA as agencia, ");
sql.append(" ORIGINAL.NUMFOLIOSISTEMA as bilhete, original.CORRIDA_ID as servico, original.NUMASIENTO as poltrona, UTILIZADO.MOTIVOCANCELACION_ID AS situacaoCancelado,");
sql.append(" UTILIZADO.FECCREACION as dataEmissao, ");
sql.append(" ORIGINAL.FECHORVIAJE as dataEmbarque, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID, ");
sql.append(" ORIGINAL.PRECIOBASE as preco, ");
sql.append(" ORIGINAL.FECHORVENTA as dataVenda, ");
sql.append(" ORIGINAL.IMPORTEPEDAGIO + original.IMPORTESEGURO + original.IMPORTETAXAEMBARQUE + original.IMPORTEOUTROS AS taxas, ");
sql.append(" r.DESCRUTA AS descricaoLinha, po.DESCPARADA AS descricaoOrigem, ");
sql.append(" pd.DESCPARADA AS descricaoDestino ");
sql.append("FROM BOLETO ORIGINAL ");
sql.append("LEFT JOIN BOLETO UTILIZADO ON (ORIGINAL.CORRIDA_ID = UTILIZADO.CORRIDA_ID AND UTILIZADO.NUMASIENTO = original.NUMASIENTO ");
sql.append(" AND ORIGINAL.FECCORRIDA = UTILIZADO.FECCORRIDA AND UTILIZADO.INDSTATUSBOLETO = 'E' ");
sql.append(" AND UTILIZADO.TIPOVENTA_ID IN (5,12,18,41,49)) ");
sql.append("LEFT JOIN PUNTO_VENTA pv on(ORIGINAL.PUNTOVENTA_ID = pv.PUNTOVENTA_ID) ");
sql.append("LEFT JOIN PUNTO_VENTA pe on(UTILIZADO.PUNTOVENTA_ID = pe.PUNTOVENTA_ID) ");
sql.append("INNER JOIN RUTA r on(original.ruta_id = r.ruta_id) ");
sql.append("INNER JOIN PARADA po ON (original.ORIGEN_ID = po.PARADA_ID) ");
sql.append("INNER JOIN PARADA pd ON (original.DESTINO_ID = pd.PARADA_ID) ");
sql.append("WHERE to_date(original.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
sql.append(" AND ORIGINAL.INDSTATUSBOLETO = 'V' ");
sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49) and (original.MOTIVOCANCELACION_ID is null or original.MOTIVOCANCELACION_ID = 16 ) ");
sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND original.PUNTOVENTA_ID in (" + agencia + ") ");
sql.append("AND original.EMPRESACORRIDA_ID =" + empresa.getEmpresaId() + " ");
} else if (situacaoBoleto.getCodigo().equals(-1)) { // Todos (Vendidos e Cancelados)
sql.append("SELECT 'VENDIDO' as status, pv.NOMBPUNTOVENTA as nomeAgenciaVenda, pe.NOMBPUNTOVENTA as agencia, ");
sql.append(" original.NUMFOLIOSISTEMA as bilhete, original.CORRIDA_ID as servico, original.NUMASIENTO as poltrona, utilizado.MOTIVOCANCELACION_ID AS situacaoCancelado,");
sql.append(" UTILIZADO.FECCREACION as dataEmissao, ");
sql.append(" ORIGINAL.FECHORVIAJE as dataEmbarque, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID, ");
sql.append(" ORIGINAL.PRECIOBASE as preco, ");
sql.append(" ORIGINAL.FECHORVENTA as dataVenda, ");
sql.append(" ORIGINAL.IMPORTEPEDAGIO + original.IMPORTESEGURO + original.IMPORTETAXAEMBARQUE + original.IMPORTEOUTROS AS taxas, ");
sql.append(" r.DESCRUTA AS descricaoLinha, po.DESCPARADA AS descricaoOrigem, ");
sql.append(" pd.DESCPARADA AS descricaoDestino ");
sql.append("FROM BOLETO ORIGINAL ");
sql.append("LEFT JOIN BOLETO UTILIZADO ON (original.CORRIDA_ID = utilizado.CORRIDA_ID AND utilizado.NUMASIENTO = original.NUMASIENTO ");
sql.append(" AND original.FECCORRIDA = utilizado.FECCORRIDA AND utilizado.INDSTATUSBOLETO = 'E' ");
sql.append(" AND utilizado.TIPOVENTA_ID IN (5,12,18,41,49)) ");
sql.append("LEFT JOIN PUNTO_VENTA pv on(ORIGINAL.PUNTOVENTA_ID = pv.PUNTOVENTA_ID) ");
sql.append("LEFT JOIN PUNTO_VENTA pe on(UTILIZADO.PUNTOVENTA_ID = pe.PUNTOVENTA_ID) ");
sql.append("INNER JOIN RUTA r on(original.ruta_id = r.ruta_id) ");
sql.append("INNER JOIN PARADA po ON (ORIGINAL.ORIGEN_ID = po.PARADA_ID) ");
sql.append("INNER JOIN PARADA pd ON (ORIGINAL.DESTINO_ID = pd.PARADA_ID) ");
sql.append("WHERE to_date(ORIGINAL.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
sql.append(" AND ORIGINAL.INDSTATUSBOLETO = 'V' ");
sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49) and (ORIGINAL.MOTIVOCANCELACION_ID is null or ORIGINAL.MOTIVOCANCELACION_ID = 16 ) ");
sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND ORIGINAL.PUNTOVENTA_ID in (" + agencia + ") ");
sql.append("AND ORIGINAL.EMPRESACORRIDA_ID =" + empresa.getEmpresaId() + " ");
sql.append("UNION ALL ");
sql.append("SELECT 'CANCELADO' as status, pc.NOMBPUNTOVENTA AS nomeAgenciaVenda, pv.NOMBPUNTOVENTA as agencia, ");
sql.append(" ORIGINAL.NUMFOLIOSISTEMA as bilhete, original.CORRIDA_ID as servico, original.NUMASIENTO as poltrona, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID as situacaoCancelado, ");
sql.append(" ORIGINAL.FECHORVENTA as dataEmissao, ");
sql.append(" ORIGINAL.FECHORVIAJE as dataEmbarque, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID, ");
sql.append(" ORIGINAL.PRECIOBASE as preco, ");
sql.append(" ORIGINAL.FECHORVENTA as dataVenda, ");
sql.append(" ORIGINAL.IMPORTEPEDAGIO + original.IMPORTESEGURO + original.IMPORTETAXAEMBARQUE + original.IMPORTEOUTROS AS taxas, ");
sql.append(" r.DESCRUTA AS descricaoLinha, po.DESCPARADA AS descricaoOrigem, ");
sql.append(" pd.DESCPARADA AS descricaoDestino ");
sql.append("FROM BOLETO ORIGINAL ");
sql.append("LEFT JOIN BOLETO UTILIZADO ON (ORIGINAL.BOLETOANTERIOR_ID = UTILIZADO.BOLETO_ID ");
sql.append(" AND UTILIZADO.TIPOVENTA_ID IN (5,12,18,41,49)) ");
sql.append("LEFT JOIN PUNTO_VENTA pv on(ORIGINAL.PUNTOVENTA_ID = pv.PUNTOVENTA_ID) ");
sql.append("LEFT JOIN PUNTO_VENTA pc on(UTILIZADO.PUNTOVENTA_ID = pc.PUNTOVENTA_ID) ");
sql.append("INNER JOIN RUTA r on(original.ruta_id = r.ruta_id) ");
sql.append("INNER JOIN PARADA po ON (ORIGINAL.ORIGEN_ID = po.PARADA_ID) ");
sql.append("INNER JOIN PARADA pd ON (ORIGINAL.DESTINO_ID = pd.PARADA_ID) ");
sql.append("WHERE to_date(original.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
sql.append("AND ORIGINAL.INDSTATUSBOLETO not in('V','E') ");
sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49) ");
sql.append(" AND UTILIZADO.MOTIVOCANCELACION_ID IN (" + motivoCancelacion + ") ");
sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND ORIGINAL.PUNTOVENTA_ID in (" + agencia + ") ");
sql.append("AND ORIGINAL.EMPRESACORRIDA_ID =" + empresa.getEmpresaId() + " ");
} else { // somente cancelados
sql.append("SELECT 'CANCELADO' as status, pc.NOMBPUNTOVENTA AS nomeAgenciaVenda, pv.NOMBPUNTOVENTA as agencia, ");
sql.append(" ORIGINAL.NUMFOLIOSISTEMA as bilhete, ORIGINAL.CORRIDA_ID as servico, ORIGINAL.NUMASIENTO as poltrona, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID as situacaoCancelado, ");
sql.append(" ORIGINAL.FECHORVENTA as dataEmissao, ");
sql.append(" ORIGINAL.FECHORVIAJE as dataEmbarque, ");
sql.append(" ORIGINAL.MOTIVOCANCELACION_ID, ");
sql.append(" ORIGINAL.PRECIOBASE as preco, ");
sql.append(" ORIGINAL.FECHORVENTA as dataVenda, ");
sql.append(" ORIGINAL.IMPORTEPEDAGIO + original.IMPORTESEGURO + ORIGINAL.IMPORTETAXAEMBARQUE + ORIGINAL.IMPORTEOUTROS AS taxas, ");
sql.append(" r.DESCRUTA AS descricaoLinha, po.DESCPARADA AS descricaoOrigem, ");
sql.append(" pd.DESCPARADA AS descricaoDestino ");
sql.append("FROM BOLETO ORIGINAL ");
sql.append("LEFT JOIN BOLETO UTILIZADO ON (ORIGINAL.BOLETOANTERIOR_ID = UTILIZADO.BOLETO_ID ");
sql.append(" AND UTILIZADO.TIPOVENTA_ID IN (5,12,18,41,49)) ");
sql.append("LEFT JOIN PUNTO_VENTA pv on(ORIGINAL.PUNTOVENTA_ID = pv.PUNTOVENTA_ID) ");
sql.append("LEFT JOIN PUNTO_VENTA pc on(UTILIZADO.PUNTOVENTA_ID = pc.PUNTOVENTA_ID) ");
sql.append("INNER JOIN RUTA r on(ORIGINAL.ruta_id = r.ruta_id) ");
sql.append("INNER JOIN PARADA po ON (ORIGINAL.ORIGEN_ID = po.PARADA_ID) ");
sql.append("INNER JOIN PARADA pd ON (ORIGINAL.DESTINO_ID = pd.PARADA_ID) ");
sql.append("WHERE to_date(original.FECHORVENTA,'dd/MM/yy') BETWEEN :DATA_INICIAL AND :DATA_FINAL ");
sql.append("AND ORIGINAL.INDSTATUSBOLETO not in('V','E') ");
sql.append(" AND ORIGINAL.TIPOVENTA_ID IN (5,12,18,41,49) ");
sql.append(" AND UTILIZADO.MOTIVOCANCELACION_ID IN (" + motivoCancelacion + ") ");
sql.append(agencia.equals("-1") || agencia.equals("TODAS") ? "" : " AND original.PUNTOVENTA_ID in (" + agencia + ") ");
sql.append("AND ORIGINAL.EMPRESACORRIDA_ID =" + empresa.getEmpresaId() + " ");
}
return sql.toString();
}
}

View File

@ -0,0 +1,33 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas PTA
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
cabecalho.puntoventa=Agência:
cabecalho.empresa=Empresa:
cabecalho.usuario=Usuário:
label.nomeVendaAgencia=Agência Atendimento
label.nomeAgenciaEmissao=Agência Emissão
label.nomeAgenciaCancelamento=Agência Cancelamento
label.dataEmissao=Data Emissão
label.dataEmbarque=Data Embarque
label.bilhete=Bilhete
label.dataEmissao=Data Emissão
label.Preco=Preço
label.Taxas= Valor Taxas
label.origem= Origem
label.destino= Destino
label.servico= Servico
label.poltrona= Poltrona
label.dataCancelamento=Data Cancelamento
label.saldo=Saldo R$:
label.total=Total R$:

View File

@ -0,0 +1,36 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas PTA
cabecalho.relatorio=Relatório:
cabecalho.periodo=Período:
cabecalho.periodoA=à
cabecalho.dataHora=Data/Hora:
cabecalho.impressorPor=Impressor por:
cabecalho.pagina=Página
cabecalho.de=de
cabecalho.filtros=Filtros:
cabecalho.puntoventa=Agência:
cabecalho.usuario=Usuário:
label.nomeVendaAgencia=Agência Atendimento
label.nomeAgenciaEmissao=Agência Emissão
label.nomeAgenciaCancelamento=Agência Cancelamento
label.dataEmissao=Data Emissão
label.dataEmbarque=Data Embarque
label.bilhete=Bilhete
label.dataEmissao=Data Emissão
label.preco=Preço
label.taxas=Taxas
label.origem= Origem
label.destino=Destino
label.descricaoLinha=Linha
label.servico=Servico
label.poltrona= Poltrona
label.dataInicial=Data Inicial:
label.dataFinal=Data Final:
label.empresa=Empresa:
label.situacao=Situacao
label.saldo=Saldo R$:
label.total=Total R$:

View File

@ -0,0 +1,373 @@
<?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="Relatorio Vendas PTA" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="6d46a2d2-555e-4b7f-944f-b25c672e5feb">
<property name="ireport.zoom" value="1.3636363636363658"/>
<property name="ireport.x" value="135"/>
<property name="ireport.y" value="0"/>
<parameter name="DATA_INICIAL" class="java.util.Date"/>
<parameter name="DATA_FINAL" class="java.util.Date"/>
<parameter name="codconvenio" class="java.lang.String"/>
<parameter name="usuario" class="java.lang.String"/>
<parameter name="nomeRelatorio" class="java.lang.String"/>
<parameter name="puntoVenta" class="java.lang.String"/>
<parameter name="SALDO" class="java.math.BigDecimal"/>
<parameter name="TOTAL" class="java.math.BigDecimal"/>
<field name="nomeAgenciaVenda" class="java.lang.String"/>
<field name="dataEmissao" class="java.util.Date"/>
<field name="dataEmbarque" class="java.util.Date"/>
<field name="bilhete" class="java.lang.String"/>
<field name="status" class="java.lang.String"/>
<field name="descricaoLinha" class="java.lang.String"/>
<field name="situacaoVendido" class="java.lang.String"/>
<field name="servico" class="java.math.BigDecimal"/>
<field name="codOrigem" class="java.lang.String"/>
<field name="codDestino" class="java.lang.String"/>
<field name="descricaoOrigem" class="java.lang.String"/>
<field name="descricaoDestino" class="java.lang.String"/>
<field name="agencia" class="java.lang.String"/>
<field name="dataVenda" class="java.lang.String"/>
<field name="preco" class="java.math.BigDecimal"/>
<field name="taxas" class="java.math.BigDecimal"/>
<field name="poltrona" class="java.lang.String"/>
<field name="situacaoCancelado" class="java.lang.String"/>
<group name="status" isReprintHeaderOnEachPage="true">
<groupExpression><![CDATA[$F{status}]]></groupExpression>
<groupHeader>
<band height="21">
<textField>
<reportElement x="0" y="4" width="91" height="14" backcolor="#FFFFFF" uuid="8c56f8a7-343c-490a-8bef-5194f3b8529d"/>
<textElement textAlignment="Center">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ? "Agência Emissão" : "Agência de Venda"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="91" y="4" width="70" height="14" uuid="f0502e25-1354-4ee8-be80-c3c428600f7f"/>
<textElement textAlignment="Center">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ? "Data Emissão" : "Data Vendido"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="161" y="4" width="76" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="49ab1647-150e-479d-a1d6-1911439f9372"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataEmbarque}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="237" y="4" width="39" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="97e52452-5067-44dc-a412-0069d4966588"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.bilhete}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="276" y="4" width="33" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="36adfbd2-baef-4050-b4dd-b2c17cec1f8f"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.preco}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="309" y="4" width="25" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="dabaae73-0430-44ac-b5ca-07bb8943d1e1"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.taxas}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="456" y="4" width="101" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="73bb690b-0169-4a4b-8fb9-c97b9887eaad"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.descricaoLinha}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="334" y="4" width="53" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="38b8051e-f5af-4f54-bf70-e2fe0b7f7c9a"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.origem}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="387" y="4" width="69" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="f8b5db04-6c39-4f45-8bdb-e5a9a68c68a3"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="557" y="4" width="52" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="fb34668d-337b-4c49-9bf6-d91c2d48c9ad"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.servico}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="609" y="4" width="42" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="638d03a2-19a6-475b-8ac8-8674de628135"/>
<textElement verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.poltrona}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="651" y="5" width="32" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="44acc215-9dff-458d-a38d-d3146fbede9e"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.situacao}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement mode="Transparent" x="684" y="4" width="116" height="14" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" forecolor="#000000" backcolor="#FFFFFF" uuid="f6156f2d-7579-468f-a4ec-3e09317df7eb"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ? "Agência Atendimento" : "Data de Cancelamento"]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="19" width="800" height="1" uuid="2171ca6f-7e60-4fb0-80b5-32ba5c32ae0f"/>
</line>
<line>
<reportElement x="0" y="3" width="800" height="1" uuid="a8b2d3d9-4d61-42fb-aa14-37d82a755f3c"/>
</line>
</band>
</groupHeader>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="32">
<textField>
<reportElement x="309" y="2" width="256" height="27" uuid="766b74e4-28c9-4045-8538-343a8bc8e665"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="18" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="49">
<textField>
<reportElement x="133" y="27" width="57" height="22" uuid="c52ee81b-b6a0-44cd-b0e0-c61177419f22"/>
<textElement>
<font size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="3" y="27" width="54" height="22" uuid="1ffb28ce-353b-45c6-95a3-ba5c40faa4b5"/>
<textElement>
<font size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dataInicial}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="183" y="27" width="54" height="22" isPrintWhenDetailOverflows="true" uuid="74a3108b-f2bf-4a05-8a0e-ef3bc6e23e78"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_FINAL}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy">
<reportElement x="57" y="27" width="54" height="22" isPrintWhenDetailOverflows="true" uuid="145289a7-0f0a-4aa0-aab7-2bad8b44292e"/>
<textElement>
<font size="10" isBold="false"/>
</textElement>
<textFieldExpression><![CDATA[$P{DATA_INICIAL}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="448" y="4" width="102" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="8857ff4c-243b-4073-9466-98722a23eccf"/>
<textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER} + " " + $R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="609" y="4" width="107" height="15" uuid="d095c344-00e0-4532-8035-8b93ef192a56"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="10" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
<reportElement mode="Transparent" x="551" y="4" width="14" height="15" forecolor="#000000" backcolor="#FFFFFF" uuid="17bc8d21-5221-4757-ade1-9b3d1b4c10ce"/>
<textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false">
<reportElement mode="Transparent" x="716" y="3" width="84" height="16" forecolor="#000000" backcolor="#FFFFFF" uuid="b8a08223-0a24-43a7-8ebe-17a3db2d83fe"/>
<textElement textAlignment="Right" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="SansSerif" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band/>
</columnHeader>
<detail>
<band height="18" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="456" y="2" width="103" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="0b904fc9-5da8-42df-86e7-0749839574b6"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descricaoLinha}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement x="559" y="2" width="50" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="a2f90f64-e8eb-45b8-828b-53c01e7258a0"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{servico}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="651" y="2" width="33" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="584271a9-2bf3-4c50-a4cf-6615c17bf989"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ?$F{situacaoVendido} : $F{situacaoCancelado}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="91" y="2" width="70" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="546f445d-2263-4cdc-a1d7-681d40f311e4"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ? $F{dataEmissao} : $F{dataVenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement x="161" y="2" width="76" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="eba09120-e3ae-4119-af20-8ff20c45d935"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{dataEmbarque}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="237" y="2" width="39" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="374795a6-5fae-417c-93d9-ae0c9e12829a"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{bilhete}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="684" y="2" width="116" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="8bf03127-bc20-45ab-94cd-deeafa4b83c1"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ?$F{nomeAgenciaVenda} : $F{agencia}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="276" y="2" width="33" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="59a943b3-dc5a-49cf-92f9-1a271ba72a0e"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{preco}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="309" y="2" width="25" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="4a3859e1-2fcf-4ce3-89ca-024ab4628dcf"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{taxas}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="334" y="2" width="53" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="aac72eec-aa72-45bc-91ad-409dd211e6e3"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descricaoOrigem}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="387" y="2" width="69" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="4dee0341-1423-40ac-b025-6e162c8c3853"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descricaoDestino}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="609" y="2" width="42" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="3b5b4e26-d826-4983-bd0b-d81762314d05"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{poltrona}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="0" y="2" width="91" height="11" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="ad1ffaa8-6c48-4316-ba3c-ea68579af300"/>
<textElement textAlignment="Center">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{status}.equals("VENDIDO") ? $F{agencia} : $F{nomeAgenciaVenda}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="32" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="39" splitType="Stretch">
<textField>
<reportElement x="0" y="5" width="57" height="14" uuid="25ee1dfc-86be-4ed3-a15b-1b88311553d3"/>
<textElement textAlignment="Center">
<font size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="19" width="57" height="14" uuid="77ae1865-5196-4f91-ab72-716ce1d52a74"/>
<textElement textAlignment="Center">
<font size="10" isBold="false" pdfFontName="Helvetica-Bold"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.saldo}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="57" y="19" width="54" height="14" uuid="36e218b6-49e0-4b1b-a473-ec3f2e79fde3"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$P{SALDO}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="57" y="5" width="54" height="14" uuid="f4ce69ee-521c-4f17-9b7f-d7028d2f355a"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$P{TOTAL}]]></textFieldExpression>
</textField>
<line>
<reportElement x="0" y="3" width="800" height="1" uuid="6dc831c6-bfb2-4350-aa40-edc3dacd8b2c"/>
</line>
<line>
<reportElement x="0" y="35" width="802" height="1" uuid="5ab0d28f-17af-469c-a9da-9aab6e0b4b50"/>
</line>
</band>
</summary>
<noData>
<band height="25">
<textField>
<reportElement x="0" y="0" width="802" height="25" uuid="8971a82a-4eed-47d8-a07a-da902b442824"/>
<textElement textAlignment="Center" markup="none">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,198 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
import java.util.Date;
public class RelatorioVendasPTABean {
private BigDecimal preco;
private BigDecimal taxas;
private String bilhete;
private String codLinha;
private String descricaoLinha;
private String codOrigem;
private String descricaoOrigem;
private String codDestino;
private String descricaoDestino;
private Date dataInicial;
private Date dataFinal;
private BigDecimal servico;
private String poltrona;
private String situacaoVendido;
private String nomeAgenciaVenda;
private String agencia;
private String status;
private Date dataEmissao;
private Date dataEmbarque;
private Date dataVenda;
private String situacaoCancelado;
public BigDecimal getPreco() {
return preco;
}
public void setPreco(BigDecimal preco) {
this.preco = preco;
}
public BigDecimal getTaxas() {
return taxas;
}
public void setTaxas(BigDecimal taxas) {
this.taxas = taxas;
}
public String getBilhete() {
return bilhete;
}
public void setBilhete(String bilhete) {
this.bilhete = bilhete;
}
public String getDescricaoLinha() {
return descricaoLinha;
}
public void setDescricaoLinha(String descricaoLinha) {
this.descricaoLinha = descricaoLinha;
}
public Date getDataInicial() {
return dataInicial;
}
public void setDataInicial(Date dataInicial) {
this.dataInicial = dataInicial;
}
public Date getDataFinal() {
return dataFinal;
}
public void setDataFinal(Date dataFinal) {
this.dataFinal = dataFinal;
}
public String getCodOrigem() {
return codOrigem;
}
public void setCodOrigem(String codOrigem) {
this.codOrigem = codOrigem;
}
public String getDescricaoOrigem() {
return descricaoOrigem;
}
public void setDescricaoOrigem(String descricaoOrigem) {
this.descricaoOrigem = descricaoOrigem;
}
public String getCodDestino() {
return codDestino;
}
public void setCodDestino(String codDestino) {
this.codDestino = codDestino;
}
public String getDescricaoDestino() {
return descricaoDestino;
}
public void setDescricaoDestino(String descricaoDestino) {
this.descricaoDestino = descricaoDestino;
}
public String getCodLinha() {
return codLinha;
}
public void setCodLinha(String codLinha) {
this.codLinha = codLinha;
}
public BigDecimal getServico() {
return servico;
}
public void setServico(BigDecimal servico) {
this.servico = servico;
}
public String getPoltrona() {
return poltrona;
}
public void setPoltrona(String poltrona) {
this.poltrona = poltrona;
}
public String getSituacaoVendido() {
return situacaoVendido;
}
public void setSituacaoVendido(String situacaoVendido) {
this.situacaoVendido = situacaoVendido;
}
public String getSituacaoCancelado() {
return situacaoCancelado;
}
public void setSituacaoCancelado(String situacaoCancelado) {
this.situacaoCancelado = situacaoCancelado;
}
public String getNomeAgenciaVenda() {
return nomeAgenciaVenda;
}
public void setNomeAgenciaVenda(String nomeAgenciaVenda) {
this.nomeAgenciaVenda = nomeAgenciaVenda;
}
public String getAgencia() {
return agencia;
}
public void setAgencia(String agencia) {
this.agencia = agencia;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Date getDataEmissao() {
return dataEmissao;
}
public void setDataEmissao(Date dataEmissao) {
this.dataEmissao = dataEmissao;
}
public Date getDataVenda() {
return dataVenda;
}
public void setDataVenda(Date dataVenda) {
this.dataVenda = dataVenda;
}
public Date getDataEmbarque() {
return dataEmbarque;
}
public void setDataEmbarque(Date dataEmbarque) {
this.dataEmbarque = dataEmbarque;
}
}

View File

@ -0,0 +1,242 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
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.Bandbox;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Paging;
import org.zkoss.zul.Textbox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.enums.SituacaoBoleto;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasPTA;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVentaSimple;
import com.trg.search.Filter;
@Controller("relatorioVendasPTAController")
@Scope("prototype")
public class RelatorioVendasPTAController extends MyGenericForwardComposer {
/**
*
*/
private static final long serialVersionUID = 1L;
private static final String TODOS_VALUE = new Integer(-1).toString();
private static final String TODOS = "TODAS";
@Autowired
private EmpresaService empresaService;
private List<Empresa> lsEmpresa;
private List<SituacaoBoleto> lsSituacao;
private MyComboboxEstandar cmbEmpresa;
private MyComboboxPuntoVenta cmbAgencia;
private MyComboboxEstandar cmbSituacao;
private Datebox datInicial;
private Datebox datFinal;
@Autowired
private DataSource dataSourceRead;
private MyListbox puntoVentaList;;
private MyListbox puntoVentaSelList;
private Paging pagingPuntoVenta;
private Bandbox bbPesquisaPuntoVenta;
@Autowired
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
private ArrayList<PuntoVenta> lsNumPuntoVenta = new ArrayList<PuntoVenta>();
private Textbox txtPalavraPesquisa;
@Override
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);
lsEmpresa = empresaService.obtenerTodos();
lsSituacao = Arrays.asList(SituacaoBoleto.values());
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
puntoVentaSelList.setItemRenderer(new RenderPuntoVentaSimple());
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private void executarRelatorio() throws Exception {
Relatorio relatorio;
Map<String, Object> parametros = new HashMap<String, Object>();
Timestamp dataInicio = new Timestamp((DateUtil.inicioFecha((java.util.Date) this.datInicial.getValue()).getTime()));
Timestamp dataFinal = new Timestamp((DateUtil.fimFecha((java.util.Date) this.datFinal.getValue()).getTime()));
parametros.put("DATA_INICIAL", dataInicio);
parametros.put("DATA_FINAL", dataFinal);
Empresa empresa = (Empresa) cmbEmpresa.getSelectedItem().getValue();
SituacaoBoleto situacaoBoleto = (SituacaoBoleto) cmbSituacao.getSelectedItem().getValue();
lsNumPuntoVenta = new ArrayList(Arrays.asList(puntoVentaSelList.getData()));
if (lsNumPuntoVenta.size() > 0) {
String puntoVentaExpression = null;
for (PuntoVenta p : lsNumPuntoVenta) {
if (lsNumPuntoVenta.indexOf(p) == 0) {
puntoVentaExpression = p.getPuntoventaId().toString();
} else {
puntoVentaExpression += ", " + p.getPuntoventaId().toString();
}
}
parametros.put("PUNTOVENTA_ID", puntoVentaExpression);
parametros.put("PUNTOVENTA", puntoVentaExpression);
} else {
parametros.put("PUNTOVENTA_ID", TODOS_VALUE);
parametros.put("PUNTOVENTA", TODOS);
}
parametros.put("EMPRESA", empresa);
parametros.put("SITUACAO_BOLETO", situacaoBoleto);
parametros.put("NOME_EMPRESA", empresa.getNombempresa());
parametros.put("TITULO", Labels.getLabel("relatorioVendasPTAController.window.title"));
relatorio = new RelatorioVendasPTA(parametros, dataSourceRead.getConnection());
Map args = new HashMap();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioVendasPTAController.window.title"), args, MODAL);
}
public void onSelect$puntoVentaList(Event ev) {
}
public void onClick$btnLimpar(Event ev) {
limparPesquisaAgencia();
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
private void executarPesquisa() {
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda = new HibernateSearchObject<PuntoVenta>(PuntoVenta.class,
pagingPuntoVenta.getPageSize());
puntoVentaBusqueda.addFilterOr(Filter.like("nombpuntoventa", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%")), Filter.like("numPuntoVenta", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%")));
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("relatorioReceitaDiariaAgenciaController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
} catch (InterruptedException ex) {
}
}
}
private void limparPesquisaAgencia() {
puntoVentaList.clearSelection();
lsNumPuntoVenta.clear();
this.bbPesquisaPuntoVenta.setValue("");
}
public void onDoubleClick$puntoVentaList(Event ev) {
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaList.getSelected();
puntoVentaSelList.addItemNovo(puntoVentaSel);
}
public void onDoubleClick$puntoVentaSelList(Event ev) {
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaSelList.getSelected();
puntoVentaSelList.removeItem(puntoVentaSel);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
executarRelatorio();
}
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
public List<SituacaoBoleto> getLsSituacao() {
return lsSituacao;
}
public void setLsSituacao(List<SituacaoBoleto> lsSituacao) {
this.lsSituacao = lsSituacao;
}
public MyListbox getPuntoVentaList() {
return puntoVentaList;
}
public void setPuntoVentaList(MyListbox puntoVentaList) {
this.puntoVentaList = puntoVentaList;
}
public Paging getPagingPuntoVenta() {
return pagingPuntoVenta;
}
public void setPagingPuntoVenta(Paging pagingPuntoVenta) {
this.pagingPuntoVenta = pagingPuntoVenta;
}
public Textbox getTxtPalavraPesquisa() {
return txtPalavraPesquisa;
}
public void setTxtPalavraPesquisa(Textbox txtPalavraPesquisa) {
this.txtPalavraPesquisa = txtPalavraPesquisa;
}
public Bandbox getBbPesquisaPuntoVenta() {
return bbPesquisaPuntoVenta;
}
public void setBbPesquisaPuntoVenta(Bandbox bbPesquisaPuntoVenta) {
this.bbPesquisaPuntoVenta = bbPesquisaPuntoVenta;
}
public MyListbox getPuntoVentaSelList() {
return puntoVentaSelList;
}
public void setPuntoVentaSelList(MyListbox puntoVentaSelList) {
this.puntoVentaSelList = puntoVentaSelList;
}
}

View File

@ -3,14 +3,12 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.tarifas;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.ext.SysUpTimeResolver;
import org.zkoss.util.resource.Labels;
public enum EnumTipoCancelVendaPacote {
CANCELAMENTO_VENDA(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhCancelacionVenta.label")),
NOTA_CREDITO(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhNotaCredito.label")),
REEMBOLSO(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhReembolso.label")),
CANCELAMENTO_RESERVA(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhCancelacionReserva.label"));
CANCELAMENTO_VENDA(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhCancelacionVenta.label")), NOTA_CREDITO(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhNotaCredito.label")), REEMBOLSO(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhReembolso.label")), CANCELAMENTO_RESERVA(Labels.getLabel("busquedaMotivoCancelVendaPacoteController.lhCancelacionReserva.label"));
private String descricao;
@ -50,4 +48,5 @@ public enum EnumTipoCancelVendaPacote {
}
return null;
}
}

View File

@ -0,0 +1,30 @@
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;
/**
* @author Wallace
*
*/
public class ItemMenuRelatorioVendasPTA extends DefaultItemMenuSistema {
public ItemMenuRelatorioVendasPTA() {
super("indexController.mniRelatorioVendasPTA.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPTA";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioVendasPTA.zul",
Labels.getLabel("relatorioVendasPTAController.window.title"), getArgs(), desktop);
}
}

View File

@ -175,6 +175,8 @@ analitico.gerenciais.financeiro.relatorioDepositosDetalhados=com.rjconsultores.v
analitico.gerenciais.financeiro.relatorioPosicaoCaixaAnalitico=com.rjconsultores.ventaboletos.web.utilerias.menu.item.contacorrente.ItemMenuRelatorioPosicaoCaixaAnalitico
analitico.gerenciais.financeiro.relatorioFormaPagamentoAgencia=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioFormaPagamentoAgencia
analitico.gerenciais.financeiro.relatorioFinanceiroGrupoLinhas=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioFinanceiroGrupoLinhas
analitico.gerenciais.financeiro.relatorioVendasPTA=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPTA
analitico.gerenciais.financeiro.relatorioServicoBloqueadoVendaInternet=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioServicoBloqueadoVendaInternet
analitico.gerenciais.pacote=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.pacote.SubMenuRelatorioPacote
analitico.gerenciais.pacote.boletos=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesBoletos
analitico.gerenciais.pacote.detalhado=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioVendasPacotesDetalhado

View File

@ -286,6 +286,8 @@ indexController.mniRelatorioObservacaoEventosFinanceiros.label = Observación Ev
indexController.mniRecebimentoMalote.label = Recebimento Malote
indexController.mniRelatorioObservacaoConferenciaMovimento.label = Observación Conferencia Movimientos
indexController.mniRelatorioErrosIntegracaoBGMController.label = Listar Erros BGM
indexController.mniRelatorioVendasPTAController.label = Ventas PTA
indexController.mniRelatorioServicoBloqueadoVendaInternet.label = Corrida Bloqueada en Venta Internet
indexController.mnSubMenuImpressaoFiscal.label=Impresión Fiscal
indexController.mnSubMenuRelatorioImpressaoFiscal.label=Importação Fiscal
@ -689,6 +691,21 @@ relatorioAidfDetalhadoController.lbAidf.value = AIDF
relatorioAidfDetalhadoController.lbFormInicial.value = Form. Inicial
relatorioAidfDetalhadoController.lbFormFinal.value = Form. Final
#Relatório de Vendas PTA
relatorioVendasPTAController.window.title = Reporte de Ventas PTA
relatorioVendasPTAController.lbDatInicial.value = Fecha Inicial
relatorioVendasPTAController.lbDatFinal.value = Fecha Final
relatorioVendasPTAController.lbEmpresa.value = Empresa
relatorioVendasPTAController.lbAgencia.value = Agencia
relatorioVendasPTAController.lbSituacao.value = Situación
#Relatório de Serviço Bloqueado na Venda Internet
relatorioServicoBloqueadoVendaInternetController.window.title = Reporte Corrida Bloqueada en Venta Internet
relatorioServicoBloqueadoVendaInternetController.lbDatInicial.value = Fecha Inicial
relatorioServicoBloqueadoVendaInternetController.lbDatFinal.value = Fecha Final
relatorioServicoBloqueadoVendaInternetController.lbEmpresa.value = Empresa
relatorioServicoBloqueadoVendaInternetController.lbAgencia.value = Agencia
#Relatorio Tripulacao
relatorioTripulacao.label=Informe Tripulación
relatorioTripulacaoController.lbDataInicial=Fecha Inicial

View File

@ -302,6 +302,8 @@ indexController.mniRelatorioObservacaoEventosFinanceiros.label = Observação Ev
indexController.mniRecebimentoMalote.label = Recebimento Malote
indexController.mniRelatorioObservacaoConferenciaMovimento.label = Movimentos com Observação
indexController.mniRelatorioErrosIntegracaoBGMController.label = Listar Erros BGM
indexController.mniRelatorioVendasPTA.label = Vendas PTA
indexController.mniRelatorioServicoBloqueadoVendaInternet.label = Serviço Bloqueado na Venda Internet
indexController.mnSubMenuImpressaoFiscal.label=Impressão Fiscal
indexController.mnSubMenuRelatorioImpressaoFiscal.label=Importação Fiscal
@ -777,6 +779,26 @@ relatorioAidfDetalhadoController.lbFormInicial.value = Form. Inicial
relatorioAidfDetalhadoController.lbFormFinal.value = Form. Final
relatorioAidfDetalhadoController.msg.agencia.obrigatorio = Uma Agência deve ser selecionada
#Relatório de Vendas PTA
relatorioVendasPTAController.window.title = Relatório de Vendas PTA
relatorioVendasPTAController.lbDatInicial.value = Data Inicial
relatorioVendasPTAController.lbDatFinal.value = Data Final
relatorioVendasPTAController.lbEmpresa.value = Empresa
relatorioVendasPTAController.lbAgencia.value = Agência
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
relatorioServicoBloqueadoVendaInternetController.window.title = Relatório de Serviço Bloqueado na Venda Internet
relatorioServicoBloqueadoVendaInternetController.lbDatInicial.value = Data Inicial
relatorioServicoBloqueadoVendaInternetController.lbDatFinal.value = Data Final
relatorioServicoBloqueadoVendaInternetController.lbEmpresa.value = Empresa
relatorioServicoBloqueadoVendaInternetController.lbAgencia.value = Agência
# Pantalla Editar Classe
editarClaseServicioController.window.title = Tipo de Classe
editarClaseServicioController.btnApagar.tooltiptext = Eliminar

View File

@ -0,0 +1,114 @@
<?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="winFiltroRelatorioVendasPTA"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioVendasPTA"
apply="${relatorioVendasPTAController}" contentStyle="overflow:auto"
height="237px" width="550px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="20%" />
<column width="30%" />
<column width="20%" />
<column width="30%" />
</columns>
<rows>
<row>
<label
value="${c:l('relatorioVendasPTAController.lbDatInicial.value')}" />
<datebox id="datInicial" width="90%"
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
<label
value="${c:l('relatorioVendasPTAController.lbDatFinal.value')}" />
<datebox id="datFinal" width="90%"
format="dd/MM/yyyy" constraint="no empty" maxlength="10" />
</row>
<row>
<label
value="${c:l('relatorioVendasPTAController.lbAgencia.value')}" />
<bandbox id="bbPesquisaPuntoVenta" width="90%" constraint="no empty"
mold="rounded" readonly="true">
<bandpopup height="150px">
<vbox>
<hbox>
<textbox id="txtPalavraPesquisa" />
<button id="btnPesquisa"
image="/gui/img/find.png"
label="${c:l('relatorioVendasPTAController.btnPesquisa.label')}" />
<button id="btnLimpar"
image="/gui/img/eraser.png"
label="${c:l('relatorioVendasPTAController.btnLimpar.label')}" />
</hbox>
<listbox id="puntoVentaList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="false" height="100%" width="360px">
<listhead>
<listheader
label="${c:l('relatorioVendasPTAController.puntoVentaSelList.codigo')}" />
<listheader
label="${c:l('relatorioVendasPTAController.puntoVentaSelList.nome')}" />
</listhead>
</listbox>
<paging id="pagingPuntoVenta"
pageSize="10" />
</vbox>
</bandpopup>
</bandbox>
<label
value="${c:l('relatorioVendasPTAController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa" buttonVisible="true"
constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioVendasPTA$composer.lsEmpresa}"
width="100%" />
</row>
<row>
<cell colspan="2" rowspan="2">
<borderlayout height="100px">
<center border="0">
<listbox id="puntoVentaSelList"
mold="paging"
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
vflex="true" multiple="true" height="60%" width="100%">
<listhead>
<listheader
label="${c:l('relatorioVendasPTAController.puntoVentaSelList.codigo')}" />
<listheader
label="${c:l('relatorioVendasPTAController.puntoVentaSelList.nome')}" />
<listheader width="35px" />
</listhead>
</listbox>
</center>
</borderlayout>
</cell>
<label
value="${c:l('relatorioVendasPTAController.lbSituacao.value')}" />
<combobox id="cmbSituacao" width="100%" constraint="no empty"
maxlength="60" mold="rounded" buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioVendasPTA$composer.lsSituacao}" />
</row>
<row>
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>