wilian 2015-06-12 21:59:56 +00:00
parent 6a868e0973
commit a2907a7f56
25 changed files with 1131 additions and 74 deletions

View File

@ -0,0 +1,191 @@
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import org.apache.log4j.Logger;
import com.rjconsultores.ventaboletos.enums.LocalEnderecoApanhe;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPacotesDetalhadoBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
public class RelatorioVendasPacotesDetalhado extends Relatorio {
private static Logger log = Logger.getLogger(RelatorioVendasPacotesDetalhado.class);
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
private List<RelatorioVendasPacotesDetalhadoBean> lsDadosRelatorio;
private Date fecInicio;
private Date fecFinal;
private Integer empresaId;
private Integer pacoteId;
public RelatorioVendasPacotesDetalhado(Map<String, Object> parametros, Connection conexao, final String nomeSubReporte) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Map<String, Object> parametros = this.relatorio.getParametros();
fecInicio = new java.sql.Date(sdf.parse(parametros.get("fecInicio").toString()).getTime());
fecFinal = new java.sql.Date(sdf.parse(parametros.get("fecFinal").toString()).getTime());
empresaId = parametros.get("empresaId") != null && !parametros.get("empresaId").equals("null") ? Integer.valueOf(parametros.get("empresaId").toString()) : null;
pacoteId = parametros.get("pacoteId") != null && !parametros.get("pacoteId").equals("null") ? Integer.valueOf(parametros.get("pacoteId").toString()) : null;
Connection conexao = this.relatorio.getConexao();
processarVendasPacote(conexao);
setNomeSubReporte(nomeSubReporte);
setLsDadosRelatorio(lsDadosRelatorio);
}
});
}
private void processarVendasPacote(Connection conexao) {
ResultSet rset = null;
NamedParameterStatement stmt = null;
try {
String sql = getSqlPacotes();
log.info(sql);
stmt = new NamedParameterStatement(conexao, sql);
if(fecInicio != null) {
stmt.setDate("fecInicio", fecInicio);
}
if(fecFinal != null) {
stmt.setDate("fecFinal", fecFinal);
}
if (empresaId != null){
stmt.setInt("empresaId", empresaId);
}
if (pacoteId != null){
stmt.setInt("pacoteId", pacoteId);
}
rset = stmt.executeQuery();
if(lsDadosRelatorio == null) {
lsDadosRelatorio = new ArrayList<RelatorioVendasPacotesDetalhadoBean>();
}
while (rset.next()) {
RelatorioVendasPacotesDetalhadoBean relatorioVendasPacotesBean = new RelatorioVendasPacotesDetalhadoBean();
relatorioVendasPacotesBean.setPacoteId(rset.getLong("pacote_id"));
relatorioVendasPacotesBean.setNompacote(rset.getString("nompacote"));
Integer idx = null;
if(lsDadosRelatorio.contains(relatorioVendasPacotesBean)) {
idx = lsDadosRelatorio.indexOf(relatorioVendasPacotesBean);
relatorioVendasPacotesBean = lsDadosRelatorio.get(idx);
}
RelatorioVendasPacotesDetalhadoBean.RelatorioVendasPacotesDetalhadoItemBean relatorioVendasPacotesDetalhadoItemBean = new RelatorioVendasPacotesDetalhadoBean().new RelatorioVendasPacotesDetalhadoItemBean();
relatorioVendasPacotesDetalhadoItemBean.setDatapacote(rset.getDate("datapacote"));
relatorioVendasPacotesDetalhadoItemBean.setDatavenda(rset.getDate("datavenda"));
relatorioVendasPacotesDetalhadoItemBean.setDeschotel(rset.getString("deschotel"));
relatorioVendasPacotesDetalhadoItemBean.setDesconto(rset.getBigDecimal("desconto"));
relatorioVendasPacotesDetalhadoItemBean.setLocalEnderecoApanhe(LocalEnderecoApanhe.getLocalEnderecoApanhe(rset.getInt("local")));
relatorioVendasPacotesDetalhadoItemBean.setNombusuario(rset.getString("nombusuario"));
relatorioVendasPacotesDetalhadoItemBean.setNumoperacion(rset.getString("numoperacion"));
relatorioVendasPacotesDetalhadoItemBean.setQtdeTarifas(rset.getLong("qtdetarifas"));
relatorioVendasPacotesDetalhadoItemBean.setRazaoSocialCliente(rset.getString("razao_social"));
relatorioVendasPacotesDetalhadoItemBean.setSubTotal(rset.getBigDecimal("subtotal"));
relatorioVendasPacotesDetalhadoItemBean.setTotal(rset.getBigDecimal("total"));
relatorioVendasPacotesDetalhadoItemBean.setVendapacoteId(rset.getLong("vendapacote_id"));
if(relatorioVendasPacotesBean.getRelatorioVendasPacotesDetalhadoItemBeans() == null) {
relatorioVendasPacotesBean.setRelatorioVendasPacotesDetalhadoItemBeans(new ArrayList<RelatorioVendasPacotesDetalhadoBean.RelatorioVendasPacotesDetalhadoItemBean>());
}
relatorioVendasPacotesBean.getRelatorioVendasPacotesDetalhadoItemBeans().add(relatorioVendasPacotesDetalhadoItemBean);
if(idx != null) {
lsDadosRelatorio.set(idx, relatorioVendasPacotesBean);
} else {
lsDadosRelatorio.add(relatorioVendasPacotesBean);
}
}
} 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);
}
}
}
protected String getSqlPacotes() {
StringBuilder sQuery = new StringBuilder();
sQuery.append("SELECT P.PACOTE_ID, VP.VENDAPACOTE_ID, P.NOMPACOTE, VP.NUMOPERACION, VP.DATAVENDA, VP.DATAPACOTE, EA.DESCHOTEL, EA.LOCAL, CP.RAZAO_SOCIAL, U.NOMBUSUARIO, VP.SUBTOTAL, VP.DESCONTO, VP.TOTAL, COUNT(TVP.TARIFAVENDAPACOTE_ID) AS QTDETARIFAS ")
.append("FROM VENDA_PACOTE VP ")
.append("LEFT JOIN PACOTE P ON P.PACOTE_ID = VP.PACOTE_ID ")
.append("LEFT JOIN TARIFA_VENDA_PACOTE TVP ON TVP.VENDAPACOTE_ID = VP.VENDAPACOTE_ID ")
.append("LEFT JOIN BOLETO B ON B.BOLETO_ID = TVP.BOLETO_ID ")
.append("LEFT JOIN ENDERECO_APANHE EA ON EA.ENDERECOAPANHE_ID = VP.ENDERECOAPANHE_ID ")
.append("LEFT JOIN CLIENTE_PACOTE CP ON CP.CLIENTEPACOTE_ID = VP.CLIENTEPACOTE_ID ")
.append("LEFT JOIN USUARIO U ON U.USUARIO_ID = VP.USUARIO_ID ")
.append("WHERE P.ACTIVO = 1 ")
.append("AND B.ACTIVO = 1 ")
.append("AND B.INDSTATUSBOLETO = 'V' ");
if(empresaId != null) {
sQuery.append("AND P.EMPRESA_ID = :empresaId ");
}
if(pacoteId != null) {
sQuery.append("AND P.PACOTE_ID = :pacoteId ");
}
if(fecInicio != null) {
sQuery.append("AND VP.DATAPACOTE >= :fecInicio ");
}
if(fecFinal != null) {
sQuery.append("AND VP.DATAPACOTE <= :fecFinal ");
}
sQuery.append("GROUP BY P.PACOTE_ID, VP.VENDAPACOTE_ID, P.NOMPACOTE, VP.NUMOPERACION, VP.DATAVENDA, VP.DATAPACOTE, EA.DESCHOTEL, EA.LOCAL, CP.RAZAO_SOCIAL, U.NOMBUSUARIO, VP.SUBTOTAL, VP.DESCONTO, VP.TOTAL ")
.append("ORDER BY P.NOMPACOTE, VP.DATAPACOTE, VP.DATAVENDA ");
return sQuery.toString();
}
@Override
protected void processaParametros() throws Exception {
}
public List<RelatorioVendasPacotesDetalhadoBean> getLsDadosRelatorio() {
return lsDadosRelatorio;
}
public void setLsDadosRelatorio(List<RelatorioVendasPacotesDetalhadoBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
}

View File

@ -15,17 +15,16 @@ 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.RelatorioAproveitamentoBean;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPacotesBean;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPacotesResumidoBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
public class RelatorioVendasPacotesResumido extends Relatorio {
private static Logger log = Logger.getLogger(RelatorioVendasPacotesBean.class);
private static Logger log = Logger.getLogger(RelatorioVendasPacotesResumido.class);
private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
private List<RelatorioVendasPacotesBean> lsDadosRelatorio;
private List<RelatorioVendasPacotesResumidoBean> lsDadosRelatorio;
private Date fecInicio;
private Date fecFinal;
@ -75,16 +74,16 @@ public class RelatorioVendasPacotesResumido extends Relatorio {
rset = stmt.executeQuery();
if(lsDadosRelatorio == null) {
lsDadosRelatorio = new ArrayList<RelatorioVendasPacotesBean>();
lsDadosRelatorio = new ArrayList<RelatorioVendasPacotesResumidoBean>();
}
while (rset.next()) {
RelatorioVendasPacotesBean relatorioVendasPacotesBean = new RelatorioVendasPacotesBean();
relatorioVendasPacotesBean.setPacoteId(rset.getLong("pacote_id"));
relatorioVendasPacotesBean.setNompacote(rset.getString("nompacote"));
relatorioVendasPacotesBean.setTotalPacotes(rset.getBigDecimal("totalpacote"));
relatorioVendasPacotesBean.setQtdePacotes(rset.getLong("qtdepacote"));
lsDadosRelatorio.add(relatorioVendasPacotesBean);
RelatorioVendasPacotesResumidoBean relatorioVendasPacotesResumidoBean = new RelatorioVendasPacotesResumidoBean();
relatorioVendasPacotesResumidoBean.setPacoteId(rset.getLong("pacote_id"));
relatorioVendasPacotesResumidoBean.setNompacote(rset.getString("nompacote"));
relatorioVendasPacotesResumidoBean.setTotalPacotes(rset.getBigDecimal("totalpacote"));
relatorioVendasPacotesResumidoBean.setQtdePacotes(rset.getLong("qtdepacote"));
lsDadosRelatorio.add(relatorioVendasPacotesResumidoBean);
}
} catch (Exception e) {
@ -128,20 +127,21 @@ public class RelatorioVendasPacotesResumido extends Relatorio {
rset = stmt.executeQuery();
if(lsDadosRelatorio == null) {
lsDadosRelatorio = new ArrayList<RelatorioVendasPacotesBean>();
lsDadosRelatorio = new ArrayList<RelatorioVendasPacotesResumidoBean>();
}
while (rset.next()) {
RelatorioVendasPacotesBean relatorioVendasPacotesBean = new RelatorioVendasPacotesBean();
relatorioVendasPacotesBean.setPacoteId(rset.getLong("pacote_id"));
relatorioVendasPacotesBean.setNompacote(rset.getString("nompacote"));
relatorioVendasPacotesBean.setTotalBoletos(rset.getBigDecimal("totalboletos"));
RelatorioVendasPacotesResumidoBean relatorioVendasPacotesResumidoBean = new RelatorioVendasPacotesResumidoBean();
relatorioVendasPacotesResumidoBean.setPacoteId(rset.getLong("pacote_id"));
relatorioVendasPacotesResumidoBean.setNompacote(rset.getString("nompacote"));
relatorioVendasPacotesResumidoBean.setTotalBoletos(rset.getBigDecimal("totalboletos"));
if(lsDadosRelatorio.contains(relatorioVendasPacotesBean)) {
RelatorioVendasPacotesBean relatorioVendasPacotesBeanAux = lsDadosRelatorio.get(lsDadosRelatorio.indexOf(relatorioVendasPacotesBean));
relatorioVendasPacotesBeanAux.setTotalBoletos(relatorioVendasPacotesBean.getTotalBoletos());
if(lsDadosRelatorio.contains(relatorioVendasPacotesResumidoBean)) {
RelatorioVendasPacotesResumidoBean relatorioVendasPacotesBeanAux = lsDadosRelatorio.get(lsDadosRelatorio.indexOf(relatorioVendasPacotesResumidoBean));
relatorioVendasPacotesBeanAux.setTotalBoletos(relatorioVendasPacotesResumidoBean.getTotalBoletos());
relatorioVendasPacotesBeanAux.setTotalPacotes(relatorioVendasPacotesBeanAux.getTotalPacotes().subtract(relatorioVendasPacotesBeanAux.getTotalBoletos()));
} else {
lsDadosRelatorio.add(relatorioVendasPacotesBean);
lsDadosRelatorio.add(relatorioVendasPacotesResumidoBean);
}
}
@ -220,11 +220,11 @@ public class RelatorioVendasPacotesResumido extends Relatorio {
protected void processaParametros() throws Exception {
}
public List<RelatorioVendasPacotesBean> getLsDadosRelatorio() {
public List<RelatorioVendasPacotesResumidoBean> getLsDadosRelatorio() {
return lsDadosRelatorio;
}
public void setLsDadosRelatorio(List<RelatorioVendasPacotesBean> lsDadosRelatorio) {
public void setLsDadosRelatorio(List<RelatorioVendasPacotesResumidoBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}

View File

@ -0,0 +1,11 @@
#Labels
label.qtde=Qtde
label.localizador=Localizador
label.usuario=Usuário
label.cliente=Cliente
label.apanhe=Apanhe
label.dtPacote=DT Pacote
label.dtVenda=DT Venda
label.subTotal=SubTotal
label.desconto=Desconto
label.total=Total

View File

@ -0,0 +1,11 @@
#Labels
label.qtde=Qtde
label.localizador=Localizador
label.usuario=Usuário
label.cliente=Cliente
label.apanhe=Apanhe
label.dtPacote=DT Pacote
label.dtVenda=DT Venda
label.subTotal=SubTotal
label.desconto=Desconto
label.total=Total

View File

@ -0,0 +1,15 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas de Pacotes - Detalhado
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:
label.empresa=Empresa:
label.pacote=Pacote:

View File

@ -0,0 +1,15 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas de Pacotes - Detalhado
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:
label.empresa=Empresa:
label.pacote=Pacote:

View File

@ -0,0 +1,15 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas de Pacotes - Resumido
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:
label.empresa=Empresa:
label.pacote=Pacote:

View File

@ -0,0 +1,19 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Vendas de Pacotes - Resumido
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:
label.empresa=Empresa:
label.pacote=Pacote
label.quantidade=Quantidade
label.totalBoletos=Total Bilhetes
label.totalPacotes=Total Pacotes
label.total=Total

View File

@ -15,6 +15,8 @@ import net.sf.jasperreports.engine.export.JExcelApiExporterParameter;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.SaidaRelatorio;
import org.apache.commons.lang.StringUtils;
import org.zkoss.util.Locales;
/**
@ -56,14 +58,17 @@ public class RenderRelatorioJasper {
ResourceBundle resource = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao." + this.relatorio.getNome(), locale);
this.relatorio.getParametros().put(JRParameter.REPORT_RESOURCE_BUNDLE, resource);
if(StringUtils.isNotBlank(this.relatorio.getNomeSubReporte())) {
ResourceBundle resourceSubReporte = ResourceBundle.getBundle("com.rjconsultores.ventaboletos.relatorios.internacionalizacao." + this.relatorio.getNomeSubReporte(), locale);
this.relatorio.getParametros().put("SUBREPORT_RESOURCE_BUNDLE", resourceSubReporte);
}
} catch (Exception e) {
}
}
private void initLocale() {
// TODO Alterar para injeção de acordo com usuário logado ou outro meio para obter o Locale correto
Locale locale = new Locale("pt", "BR");
this.relatorio.getParametros().put(JRParameter.REPORT_LOCALE, locale);
this.relatorio.getParametros().put(JRParameter.REPORT_LOCALE, Locales.getCurrent());
}
protected InputStream getTemplateInputStream() throws Exception {

View File

@ -0,0 +1,117 @@
<?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="RelatorioVendasPacotesDetalhado" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="empresa" class="java.lang.String"/>
<parameter name="fecInicio" class="java.lang.String"/>
<parameter name="fecFinal" class="java.lang.String"/>
<parameter name="noDataRelatorio" class="java.lang.String"/>
<parameter name="subreporte" class="net.sf.jasperreports.engine.JasperReport"/>
<parameter name="SUBREPORT_RESOURCE_BUNDLE" class="java.util.ResourceBundle"/>
<parameter name="nompacote" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="nompacote" class="java.lang.String"/>
<field name="relatorioVendasPacotesDetalhadoItemBeans" class="java.util.List"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="84" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="301" height="20" uuid="43b2c28d-4760-4890-b00d-25e931e79c74"/>
<textElement markup="none">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy HH:mm">
<reportElement x="391" y="0" width="164" height="20" uuid="4d1bcd65-c9a6-44b4-8dca-cc3c4c20c9a5"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="20" width="301" height="20" uuid="a16eb33b-78ca-4fb4-80c2-f5c85a0d09c3"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.empresa} + " " + $P{empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="40" width="301" height="20" uuid="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="60" width="301" height="20" uuid="66f394e2-0568-447d-9f46-c358a05628c5"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.pacote} + " " + $P{nompacote}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="21" splitType="Stretch">
<line>
<reportElement x="0" y="19" width="555" height="1" uuid="4f39b5b4-849a-4fe2-9365-06930866fbaa"/>
</line>
<textField>
<reportElement x="391" y="0" width="164" height="20" uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER}+ " " + $R{cabecalho.de} + " " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band splitType="Stretch"/>
</columnHeader>
<detail>
<band height="76" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="1" width="555" height="20" isPrintWhenDetailOverflows="true" uuid="752263b1-e76b-41c5-a728-c17367094dab"/>
<textElement verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.pacote} + " " + $F{nompacote}]]></textFieldExpression>
</textField>
<subreport isUsingCache="true">
<reportElement positionType="Float" x="0" y="27" width="555" height="38" uuid="75fad27f-9275-4535-844a-316ac8365073"/>
<subreportParameter name="REPORT_RESOURCE_BUNDLE">
<subreportParameterExpression><![CDATA[$P{SUBREPORT_RESOURCE_BUNDLE}]]></subreportParameterExpression>
</subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{relatorioVendasPacotesDetalhadoItemBeans})]]></dataSourceExpression>
<subreportExpression><![CDATA[$P{subreporte}]]></subreportExpression>
</subreport>
<line>
<reportElement positionType="Float" x="0" y="68" width="555" height="1" uuid="29b89cc0-dcf8-4bdd-a667-7341d74330ea"/>
</line>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
<noData>
<band height="35">
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="true" uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -0,0 +1,226 @@
<?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="RelatorioVendasPacotesDetalhadoItem" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="f17327a0-45d8-4ec1-8350-688df66785dc">
<property name="ireport.zoom" value="0.75"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<field name="numoperacion" class="java.lang.String"/>
<field name="nombusuario" class="java.lang.String"/>
<field name="razaoSocialCliente" class="java.lang.String"/>
<field name="descLocalEnderecoApanhe" class="java.lang.String"/>
<field name="datavenda" class="java.util.Date"/>
<field name="datapacote" class="java.util.Date"/>
<field name="qtdeTarifas" class="java.lang.Long"/>
<field name="subTotal" class="java.math.BigDecimal"/>
<field name="desconto" class="java.math.BigDecimal"/>
<field name="total" class="java.math.BigDecimal"/>
<variable name="vTotalSubTotal" class="java.math.BigDecimal" resetType="Column" calculation="Sum">
<variableExpression><![CDATA[$F{subTotal}]]></variableExpression>
</variable>
<variable name="vTotalDesconto" class="java.math.BigDecimal" resetType="Column" calculation="Sum">
<variableExpression><![CDATA[$F{desconto}]]></variableExpression>
</variable>
<variable name="vTotalTotal" class="java.math.BigDecimal" resetType="Column" calculation="Sum">
<variableExpression><![CDATA[$F{total}]]></variableExpression>
</variable>
<variable name="vTotalQtdeTarifa" class="java.lang.Long" resetType="Column" calculation="Sum">
<variableExpression><![CDATA[$F{qtdeTarifas}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<textField>
<reportElement x="0" y="1" width="27" height="20" uuid="479d9abe-f3fa-4903-922f-74be005b310c"/>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.qtde}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="27" y="1" width="69" height="20" uuid="2fcabefe-3c9b-46f4-9885-e37a5ffbed9a"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.localizador}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="96" y="1" width="57" height="20" uuid="333e8016-8fb3-4652-b7f9-1ff10a0b024e"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.usuario}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="153" y="1" width="78" height="20" uuid="eb1aa96a-0759-41b0-bf15-7e4b1b0dc21b"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.cliente}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="231" y="1" width="72" height="20" uuid="0cf46847-6160-450a-ad67-6b33fac921cc"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.apanhe}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="303" y="1" width="54" height="20" uuid="dc54766b-3e8a-4683-84a0-b50cf8275681"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dtPacote}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="357" y="1" width="54" height="20" uuid="521c1958-56a8-4bc9-b304-5a8e7ad8941c"/>
<textElement verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.dtVenda}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="411" y="1" width="44" height="20" uuid="eab1b822-2fe4-4d62-87ec-c07e1320950a"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.subTotal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="455" y="1" width="48" height="20" uuid="ea742d2b-6cd4-4fd8-aba8-1cd9d23e802a"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.desconto}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="503" y="1" width="52" height="20" uuid="199f8b66-2e55-45ee-95e1-f44d55a7a716"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="21" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="1" width="27" height="20" isPrintWhenDetailOverflows="true" uuid="d2d86d45-734c-43d7-b85c-fec792408d05"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{qtdeTarifas}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="27" y="1" width="69" height="20" isPrintWhenDetailOverflows="true" uuid="351af802-2856-4c9e-918f-06bafc5ef390"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{numoperacion}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="96" y="1" width="57" height="20" isPrintWhenDetailOverflows="true" uuid="6964a19b-c6bb-48ed-a061-eed217b33b9b"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{nombusuario}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="153" y="1" width="78" height="20" isPrintWhenDetailOverflows="true" uuid="c9813245-6a43-4011-bb01-c6e45c0d6d36"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{razaoSocialCliente}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="231" y="1" width="72" height="20" isPrintWhenDetailOverflows="true" uuid="f5632358-41df-437d-821f-fa878a857d5c"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{descLocalEnderecoApanhe}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="303" y="1" width="54" height="20" isPrintWhenDetailOverflows="true" uuid="ecb1f133-dfd6-46a1-9d3d-3dc84b199c39"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{datapacote}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="357" y="1" width="54" height="20" isPrintWhenDetailOverflows="true" uuid="78842239-ee2e-45ac-aaa2-ec561feea088"/>
<textElement verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{datavenda}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="411" y="1" width="44" height="20" isPrintWhenDetailOverflows="true" uuid="0be25395-a20f-4e4f-95da-163c13698708"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{subTotal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="455" y="1" width="48" height="20" isPrintWhenDetailOverflows="true" uuid="43d71d65-26a3-49dc-b94e-30525147a1d0"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{desconto}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement stretchType="RelativeToTallestObject" x="503" y="1" width="52" height="20" isPrintWhenDetailOverflows="true" uuid="55433141-fa8f-42b5-b4f7-2a504bec5ceb"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{total}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="28" splitType="Stretch">
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="411" y="6" width="44" height="20" uuid="c143a4c0-043f-4742-911d-b543c971e26d"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalSubTotal}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="455" y="6" width="48" height="20" uuid="533968db-d01a-48e9-a273-f4388c10bc0c"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalDesconto}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="503" y="6" width="52" height="20" uuid="7d9be2b0-855e-442e-b96c-24d0b8ab47dd"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalTotal}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="6" width="27" height="20" uuid="c44ae1ed-6f37-4a3c-aaad-19b89fc86abb"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$V{vTotalQtdeTarifa}]]></textFieldExpression>
</textField>
<line>
<reportElement positionType="Float" x="0" y="3" width="555" height="1" uuid="2c1bf6b9-f6f3-442b-a6ca-2c668a8e603a"/>
</line>
</band>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>

View File

@ -47,14 +47,14 @@
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Empresa: " + $P{empresa}]]></textFieldExpression>
<textFieldExpression><![CDATA[$R{label.empresa} + " " + $P{empresa}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="40" width="301" height="20" uuid="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Período: " + $P{fecInicio} + " a " + $P{fecFinal}]]></textFieldExpression>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression>
</textField>
</band>
</title>
@ -68,40 +68,40 @@
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Página " + $V{PAGE_NUMBER}+ " de " + $V{PAGE_NUMBER}]]></textFieldExpression>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER} + " " + $R{cabecalho.de} + " " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<staticText>
<reportElement x="0" y="1" width="255" height="20" uuid="7e956f7e-4695-4ff8-8f89-b090996e764a"/>
<textElement verticalAlignment="Middle">
<textField>
<reportElement x="0" y="1" width="255" height="20" uuid="d1e8ab32-c6d2-4622-82d9-d0681647fa14"/>
<textElement verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<text><![CDATA[Pacote]]></text>
</staticText>
<staticText>
<reportElement x="255" y="1" width="100" height="20" uuid="48a03698-b397-4b02-82c2-dbee7b2bca24"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<textFieldExpression><![CDATA[$R{label.pacote}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="255" y="1" width="100" height="20" uuid="c98a5bfb-8f19-482f-bc61-50f9f8c2661b"/>
<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<text><![CDATA[Quantidade]]></text>
</staticText>
<staticText>
<reportElement x="355" y="1" width="100" height="20" uuid="43c84fe9-c50e-464d-875d-6c181ce522cd"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<textFieldExpression><![CDATA[$R{label.quantidade}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="355" y="1" width="100" height="20" uuid="c09202ea-b74e-4355-b068-a9dab46961b7"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Bilhetes]]></text>
</staticText>
<staticText>
<reportElement x="455" y="1" width="100" height="20" uuid="aff4b650-74dc-4613-ba06-d13532986c77"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<textFieldExpression><![CDATA[$R{label.totalBoletos}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="455" y="1" width="100" height="20" uuid="43e703a6-e2a7-4342-ba8e-858d989cd7d3"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<text><![CDATA[Total Pacotes]]></text>
</staticText>
<textFieldExpression><![CDATA[$R{label.totalPacotes}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
@ -136,13 +136,13 @@
</pageFooter>
<summary>
<band height="24" splitType="Stretch">
<staticText>
<reportElement x="0" y="3" width="255" height="20" uuid="65160df0-a209-4c01-9c49-4de2a1ea7ea0"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<textField>
<reportElement x="0" y="3" width="255" height="20" uuid="867715f2-c3dd-49b4-87ec-502ab8ea8598"/>
<textElement textAlignment="Right" verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<text><![CDATA[Total]]></text>
</staticText>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="255" y="3" width="100" height="20" uuid="d2d44ea4-14ce-497c-91e5-e4ddca94794a"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
@ -170,6 +170,14 @@
</band>
</summary>
<noData>
<band height="31"/>
<band height="31">
<textField>
<reportElement x="0" y="6" width="255" height="20" uuid="e8628cb6-21d8-4ea1-aec8-39f983fb8c7d"/>
<textElement verticalAlignment="Middle" markup="none">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -27,6 +27,7 @@ public abstract class Relatorio {
private IParametros processadorParametros;
private Set<String> infoMsg;
private JRBeanCollectionDataSource collectionDataSource;
private String nomeSubReporte;
protected Relatorio(Map<String, Object> parametros, Connection conexao) {
this.parametros = parametros;
@ -137,4 +138,12 @@ public abstract class Relatorio {
this.infoMsg.add(msg);
}
public String getNomeSubReporte() {
return nomeSubReporte;
}
public void setNomeSubReporte(String nomeSubReporte) {
this.nomeSubReporte = nomeSubReporte;
}
}

View File

@ -0,0 +1,208 @@
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import com.rjconsultores.ventaboletos.enums.LocalEnderecoApanhe;
public class RelatorioVendasPacotesDetalhadoBean {
private Long pacoteId;
private String nompacote;
private List<RelatorioVendasPacotesDetalhadoItemBean> relatorioVendasPacotesDetalhadoItemBeans;
public Long getPacoteId() {
return pacoteId;
}
public void setPacoteId(Long pacoteId) {
this.pacoteId = pacoteId;
}
public String getNompacote() {
return nompacote;
}
public void setNompacote(String nompacote) {
this.nompacote = nompacote;
}
public List<RelatorioVendasPacotesDetalhadoItemBean> getRelatorioVendasPacotesDetalhadoItemBeans() {
return relatorioVendasPacotesDetalhadoItemBeans;
}
public void setRelatorioVendasPacotesDetalhadoItemBeans(List<RelatorioVendasPacotesDetalhadoItemBean> relatorioVendasPacotesDetalhadoItemBeans) {
this.relatorioVendasPacotesDetalhadoItemBeans = relatorioVendasPacotesDetalhadoItemBeans;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((pacoteId == null) ? 0 : pacoteId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RelatorioVendasPacotesDetalhadoBean other = (RelatorioVendasPacotesDetalhadoBean) obj;
if (pacoteId == null) {
if (other.pacoteId != null)
return false;
} else if (!pacoteId.equals(other.pacoteId))
return false;
return true;
}
public class RelatorioVendasPacotesDetalhadoItemBean {
private Long vendapacoteId;
private String numoperacion;
private String deschotel;
private LocalEnderecoApanhe localEnderecoApanhe;
private Date datavenda;
private Date datapacote;
private Long qtdeTarifas;
private BigDecimal subTotal;
private BigDecimal desconto;
private BigDecimal total;
private String nombusuario;
private String razaoSocialCliente;
public Long getVendapacoteId() {
return vendapacoteId;
}
public void setVendapacoteId(Long vendapacoteId) {
this.vendapacoteId = vendapacoteId;
}
public String getNumoperacion() {
return numoperacion;
}
public void setNumoperacion(String numoperacion) {
this.numoperacion = numoperacion;
}
public String getDeschotel() {
return deschotel;
}
public void setDeschotel(String deschotel) {
this.deschotel = deschotel;
}
public LocalEnderecoApanhe getLocalEnderecoApanhe() {
return localEnderecoApanhe;
}
public void setLocalEnderecoApanhe(LocalEnderecoApanhe localEnderecoApanhe) {
this.localEnderecoApanhe = localEnderecoApanhe;
}
public Date getDatavenda() {
return datavenda;
}
public void setDatavenda(Date datavenda) {
this.datavenda = datavenda;
}
public Date getDatapacote() {
return datapacote;
}
public void setDatapacote(Date datapacote) {
this.datapacote = datapacote;
}
public Long getQtdeTarifas() {
return qtdeTarifas;
}
public void setQtdeTarifas(Long qtdeTarifas) {
this.qtdeTarifas = qtdeTarifas;
}
public BigDecimal getSubTotal() {
return subTotal;
}
public void setSubTotal(BigDecimal subTotal) {
this.subTotal = subTotal;
}
public BigDecimal getDesconto() {
return desconto;
}
public void setDesconto(BigDecimal desconto) {
this.desconto = desconto;
}
public BigDecimal getTotal() {
return total;
}
public void setTotal(BigDecimal total) {
this.total = total;
}
public String getNombusuario() {
return nombusuario;
}
public void setNombusuario(String nombusuario) {
this.nombusuario = nombusuario;
}
public String getRazaoSocialCliente() {
return razaoSocialCliente;
}
public void setRazaoSocialCliente(String razaoSocialCliente) {
this.razaoSocialCliente = razaoSocialCliente;
}
public String getDescLocalEnderecoApanhe() {
return StringUtils.isNotBlank(deschotel) ? deschotel : localEnderecoApanhe != null ? localEnderecoApanhe.toString() : "";
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((vendapacoteId == null) ? 0 : vendapacoteId.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RelatorioVendasPacotesDetalhadoItemBean other = (RelatorioVendasPacotesDetalhadoItemBean) obj;
if (vendapacoteId == null) {
if (other.vendapacoteId != null)
return false;
} else if (!vendapacoteId.equals(other.vendapacoteId))
return false;
return true;
}
}
}

View File

@ -2,7 +2,7 @@ package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
public class RelatorioVendasPacotesBean {
public class RelatorioVendasPacotesResumidoBean {
private Long pacoteId;
private String nompacote;
@ -58,7 +58,7 @@ public class RelatorioVendasPacotesBean {
return false;
if (getClass() != obj.getClass())
return false;
RelatorioVendasPacotesBean other = (RelatorioVendasPacotesBean) obj;
RelatorioVendasPacotesResumidoBean other = (RelatorioVendasPacotesResumidoBean) obj;
if (pacoteId == null) {
if (other.pacoteId != null)
return false;

View File

@ -0,0 +1,118 @@
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import net.sf.jasperreports.engine.JasperReport;
import net.sf.jasperreports.engine.util.JRLoader;
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.Comboitem;
import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.entidad.Pacote;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasPacotesDetalhado;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.service.PacoteService;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@Controller("relatorioVendasPacotesDetalhadoController")
@Scope("prototype")
public class RelatorioVendasPacotesDetalhadoController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private DataSource dataSourceRead;
@Autowired
private EmpresaService empresaService;
@Autowired
private PacoteService pacoteService;
private List<Empresa> lsEmpresa;
private List<Pacote> lsPacote;
private Datebox dataInicial;
private Datebox dataFinal;
private MyComboboxEstandar cmbEmpresa;
private MyComboboxEstandar cmbPacote;
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
@Override
public void doAfterCompose(Component comp) throws Exception {
lsEmpresa = empresaService.obtenerTodos();
lsPacote = pacoteService.obtenerTodos();
super.doAfterCompose(comp);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date dataDe = dataInicial.getValue();
Date dataAte = dataFinal.getValue();
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("fecInicio", sdf.format(dataDe));
parametros.put("fecFinal", sdf.format(dataAte));
Comboitem cbiEmpresa = cmbEmpresa.getSelectedItem();
String empresaId = null;
parametros.put("empresa", "");
if (cbiEmpresa != null) {
Empresa empresa = (Empresa) cbiEmpresa.getValue();
empresaId = empresa.getEmpresaId().toString();
parametros.put("empresa", empresa.getNombempresa());
}
parametros.put("empresaId", empresaId);
Comboitem cbiPacote = cmbPacote.getSelectedItem();
String pacoteId = null;
parametros.put("nompacote", "");
if (cbiPacote != null) {
Pacote pacote = (Pacote) cbiPacote.getValue();
pacoteId = pacote.getPacoteId().toString();
parametros.put("nompacote", pacote.getNompacote());
}
parametros.put("pacoteId", pacoteId);
JasperReport subRelatorioVendasPacotesResumidoItens = (JasperReport) JRLoader.loadObject(this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesDetalhadoItem.jasper"));
parametros.put("subreporte", subRelatorioVendasPacotesResumidoItens);
Relatorio relatorio = new RelatorioVendasPacotesDetalhado(parametros, dataSourceRead.getConnection(), "RelatorioVendasPacotesDetalhadoItem");
Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("relatorioVendasPacotesDetalhadoController.window.title"), args, MODAL);
}
public List<Pacote> getLsPacote() {
return lsPacote;
}
public void setLsPacote(List<Pacote> lsPacote) {
this.lsPacote = lsPacote;
}
}

View File

@ -55,16 +55,6 @@ public class RelatorioVendasPacotesResumidoController extends MyGenericForwardCo
super.doAfterCompose(comp);
}
private void executarPesquisa() {
}
public void onClick$btnLimpar(Event ev) {
}
public void onClick$btnPesquisa(Event ev) {
executarPesquisa();
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date dataDe = dataInicial.getValue();

View File

@ -0,0 +1,29 @@
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 Wilian Domingues
*
*/
public class ItemMenuRelatorioVendasPacotesDetalhado extends DefaultItemMenuSistema {
public ItemMenuRelatorioVendasPacotesDetalhado() {
super("indexController.mniRelatorioVendasPacotesDetalhado.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPACOTESDETALHADO";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioVendasPacotesDetalhado.zul",
Labels.getLabel("relatorioVendasPacotesDetalhadoController.window.title"), getArgs() ,desktop);
}
}

View File

@ -1,6 +1,3 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios;
import org.zkoss.util.resource.Labels;

View File

@ -242,6 +242,7 @@ indexController.mniRelatorioCorridas.label = Reporte de Corridas
indexController.mniRelatorioDemandas.label = Reporte de Demandas
indexController.mniPrecoApanhe.label = Preço Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Ventas de Paquetes Resumido
indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Paquetes Detalhado
indexController.mniSubMenuClientePacote.label=Pacote
indexController.mniAlterarEnderecoApanhe.label=Alterar Endereço Apanhe
@ -5271,3 +5272,10 @@ relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pac
relatorioVendasPacotesResumidoController.lbDataIni.value = Fecha Inicio
relatorioVendasPacotesResumidoController.lbDataFin.value = Fecha Final
relatorioVendasPacotesResumidoController.lblEmpresa.value = Empresa
# Relatorio Vendas Pacotes Detalhado
relatorioVendasPacotesDetalhadoController.window.title = Relatório Vendas de Pacotes Detalhado
relatorioVendasPacotesDetalhadoController.lbDataIni.value = Fecha Inicio
relatorioVendasPacotesDetalhadoController.lbDataFin.value = Fecha Final
relatorioVendasPacotesDetalhadoController.lblEmpresa.value = Empresa
relatorioVendasPacotesDetalhadoController.lblPacote.value = Pacote

View File

@ -247,6 +247,7 @@ indexController.mniRelatorioCorridas.label = Relatório de Serviços
indexController.mniRelatorioDemandas.label = Relatório de Demandas
indexController.mniPrecoApanhe.label = Preço Apanhe
indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes Resumido
indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Pacotes Detalhado
indexController.mnSubMenuImpressaoFiscal.label=Impressão Fiscal
indexController.mniTotnaofiscalEmpresa.label=Totalizadoes Não-fiscais
@ -5398,3 +5399,10 @@ relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pac
relatorioVendasPacotesResumidoController.lbDataIni.value = Data Inicial
relatorioVendasPacotesResumidoController.lbDataFin.value = Data Final
relatorioVendasPacotesResumidoController.lblEmpresa.value = Empresa
# Relatorio Vendas Pacotes Detalhado
relatorioVendasPacotesDetalhadoController.window.title = Relatório Vendas de Pacotes Detalhado
relatorioVendasPacotesDetalhadoController.lbDataIni.value = Data Inicial
relatorioVendasPacotesDetalhadoController.lbDataFin.value = Data Final
relatorioVendasPacotesDetalhadoController.lblEmpresa.value = Empresa
relatorioVendasPacotesDetalhadoController.lblPacote.value = Pacote

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="winFiltroRelatorioVendasPacotesDetalhado"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioVendasPacotesDetalhado"
apply="${relatorioVendasPacotesDetalhadoController}"
contentStyle="overflow:auto" width="700px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="20%" />
<column width="30%" />
<column width="20%" />
<column width="30%" />
</columns>
<rows>
<row spans="1,3">
<label
value="${c:l('relatorioVendasPacotesDetalhadoController.lblEmpresa.value')}" />
<combobox id="cmbEmpresa" constraint="no empty"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded" buttonVisible="true" width="80%"
model="@{winFiltroRelatorioVendasPacotesDetalhado$composer.lsEmpresa}" />
</row>
<row spans="1,3">
<label
value="${c:l('relatorioVendasPacotesDetalhadoController.lblPacote.value')}" />
<combobox id="cmbPacote"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
mold="rounded" buttonVisible="true" width="80%"
model="@{winFiltroRelatorioVendasPacotesDetalhado$composer.lsPacote}" />
</row>
<row>
<label
value="${c:l('relatorioVendasPacotesDetalhadoController.lbDataIni.value')}" />
<datebox id="dataInicial" width="100%" mold="rounded"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
<label
value="${c:l('relatorioVendasPacotesDetalhadoController.lbDataFin.value')}" />
<datebox id="dataFinal" width="100%" mold="rounded"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>