diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesBoletos.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesBoletos.java new file mode 100644 index 000000000..1960b5449 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesBoletos.java @@ -0,0 +1,183 @@ +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.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPacotesBoletosBean; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +public class RelatorioVendasPacotesBoletos extends Relatorio { + + private static Logger log = Logger.getLogger(RelatorioVendasPacotesBoletos.class); + + private SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); + + private List lsDadosRelatorio; + + private Date fecInicio; + private Date fecFinal; + private Integer empresaId; + + public RelatorioVendasPacotesBoletos(Map parametros, Connection conexao, final String nomeSubReporte) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new DataSource(this) { + @Override + public void initDados() throws Exception { + Map 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; + + 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); + } + + rset = stmt.executeQuery(); + + if(lsDadosRelatorio == null) { + lsDadosRelatorio = new ArrayList(); + } + + while (rset.next()) { + RelatorioVendasPacotesBoletosBean relatorioVendasBoletosBean = new RelatorioVendasPacotesBoletosBean(); + relatorioVendasBoletosBean.setDescdestino(rset.getString("destino")); + relatorioVendasBoletosBean.setDescorigen(rset.getString("origem")); + + Integer idx = null; + if(lsDadosRelatorio.contains(relatorioVendasBoletosBean)) { + idx = lsDadosRelatorio.indexOf(relatorioVendasBoletosBean); + relatorioVendasBoletosBean = lsDadosRelatorio.get(idx); + } + + RelatorioVendasPacotesBoletosBean.RelatorioVendasPacotesBoletosItemBean relatorioVendasPacotesBoletosItemBean = new RelatorioVendasPacotesBoletosBean().new RelatorioVendasPacotesBoletosItemBean(); + relatorioVendasPacotesBoletosItemBean.setNomconvenio(rset.getString("nomconvenio")); + relatorioVendasPacotesBoletosItemBean.setDesctipotarifa(rset.getString("desctipotarifa")); + relatorioVendasPacotesBoletosItemBean.setQtde(rset.getLong("qtde")); + relatorioVendasPacotesBoletosItemBean.setSimportetaxaembarque(rset.getBigDecimal("simportetaxaembarque")); + relatorioVendasPacotesBoletosItemBean.setSimportepedagio(rset.getBigDecimal("simportepedagio")); + relatorioVendasPacotesBoletosItemBean.setSimporteoutros(rset.getBigDecimal("simporteoutros")); + relatorioVendasPacotesBoletosItemBean.setSimporteseguro(rset.getBigDecimal("simporteseguro")); + relatorioVendasPacotesBoletosItemBean.setSpreciopagado(rset.getBigDecimal("spreciopagado")); + relatorioVendasPacotesBoletosItemBean.setSpreciobase(rset.getBigDecimal("spreciobase")); + relatorioVendasPacotesBoletosItemBean.setDesconto(rset.getBigDecimal("desconto")); + + if(relatorioVendasBoletosBean.getRelatorioVendasPacotesBoletosItemBeans() == null) { + relatorioVendasBoletosBean.setRelatorioVendasPacotesBoletosItemBeans(new ArrayList()); + } + relatorioVendasBoletosBean.getRelatorioVendasPacotesBoletosItemBeans().add(relatorioVendasPacotesBoletosItemBean); + + if(idx != null) { + lsDadosRelatorio.set(idx, relatorioVendasBoletosBean); + } else { + lsDadosRelatorio.add(relatorioVendasBoletosBean); + } + } + + } 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 ORI.DESCPARADA AS ORIGEM, DES.DESCPARADA AS DESTINO, TVP.NOMCONVENIO, TTP.DESCTIPOTARIFA, ") + .append("COUNT(TVP.TARIFAVENDAPACOTE_ID) AS QTDE, SUM(B.IMPORTETAXAEMBARQUE) AS SIMPORTETAXAEMBARQUE, SUM(B.IMPORTEPEDAGIO) AS SIMPORTEPEDAGIO, ") + .append("SUM(B.IMPORTEOUTROS) AS SIMPORTEOUTROS, SUM(B.IMPORTESEGURO) AS SIMPORTESEGURO, SUM(B.PRECIOBASE) AS SPRECIOBASE, SUM(B.PRECIOBASE - B.PRECIOPAGADO) AS DESCONTO, ") + .append("SUM(B.PRECIOPAGADO) AS SPRECIOPAGADO ") + .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 PACOTE_TARIFA PT ON PT.PACOTETARIFA_ID = TVP.PACOTETARIFA_ID ") + .append("LEFT JOIN TIPO_TARIFA_PACOTE TTP ON TTP.TIPOTARIFAPACOTE_ID = PT.TIPOTARIFAPACOTE_ID ") + .append("LEFT JOIN PARADA ORI ON ORI.PARADA_ID = B.ORIGEN_ID ") + .append("LEFT JOIN PARADA DES ON DES.PARADA_ID = B.DESTINO_ID ") + .append("WHERE P.ACTIVO = 1 ") + .append("AND B.ACTIVO = 1 ") + .append("AND B.INDSTATUSBOLETO = 'V' ") + .append("AND B.MOTIVOCANCELACION_ID IS NULL "); + + if(empresaId != null) { + sQuery.append("AND P.EMPRESA_ID = :empresaId "); + } + + if(fecInicio != null) { + sQuery.append("AND VP.DATAVENDA >= :fecInicio "); + } + + if(fecFinal != null) { + sQuery.append("AND VP.DATAVENDA <= :fecFinal "); + } + + sQuery.append("GROUP BY ORI.DESCPARADA,DES.DESCPARADA,TVP.NOMCONVENIO,TTP.DESCTIPOTARIFA ") + .append("ORDER BY ORI.DESCPARADA,DES.DESCPARADA,TVP.NOMCONVENIO,TTP.DESCTIPOTARIFA "); + + return sQuery.toString(); + } + + @Override + protected void processaParametros() throws Exception { + } + + public List getLsDadosRelatorio() { + return lsDadosRelatorio; + } + + public void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorio = lsDadosRelatorio; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesDetalhado.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesDetalhado.java index 59a41d9f0..bf3c21a2e 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesDetalhado.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesDetalhado.java @@ -151,7 +151,8 @@ public class RelatorioVendasPacotesDetalhado extends Relatorio { .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' "); + .append("AND B.INDSTATUSBOLETO = 'V' ") + .append("AND B.MOTIVOCANCELACION_ID IS NULL ");; if(empresaId != null) { sQuery.append("AND P.EMPRESA_ID = :empresaId "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesResumido.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesResumido.java index ba8214533..84a75da5a 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesResumido.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioVendasPacotesResumido.java @@ -197,7 +197,8 @@ public class RelatorioVendasPacotesResumido extends Relatorio { .append("LEFT JOIN BOLETO B ON B.BOLETO_ID = TVP.BOLETO_ID ") .append("WHERE P.ACTIVO = 1 ") .append("AND B.ACTIVO = 1 ") - .append("AND B.INDSTATUSBOLETO = 'V' "); + .append("AND B.INDSTATUSBOLETO = 'V' ") + .append("AND B.MOTIVOCANCELACION_ID IS NULL ");; if(empresaId != null) { sQuery.append("AND P.EMPRESA_ID = :empresaId "); diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_es.properties new file mode 100644 index 000000000..ca5622f37 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_es.properties @@ -0,0 +1,11 @@ +#Labels +label.qtde=Qtde +label.desctipotarifa=Tipo Tarifa +label.nomconvenio=Convênio +label.spreciobase=Valor Tarifário +label.simporteseguro=Valor Seguro +label.simportetaxaembarque=Taxa Embarque +label.simporteoutros=Valor Serviço +label.spreciopagado=Total c/ Desconto +label.desconto=Desconto +label.spreciototal=Valor Total \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_pt_BR.properties new file mode 100644 index 000000000..ca5622f37 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletosItem_pt_BR.properties @@ -0,0 +1,11 @@ +#Labels +label.qtde=Qtde +label.desctipotarifa=Tipo Tarifa +label.nomconvenio=Convênio +label.spreciobase=Valor Tarifário +label.simporteseguro=Valor Seguro +label.simportetaxaembarque=Taxa Embarque +label.simporteoutros=Valor Serviço +label.spreciopagado=Total c/ Desconto +label.desconto=Desconto +label.spreciototal=Valor Total \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_es.properties new file mode 100644 index 000000000..7828250ea --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_es.properties @@ -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 - Boletos +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.trecho=Trecho: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_pt_BR.properties new file mode 100644 index 000000000..7828250ea --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioVendasPacotesBoletos_pt_BR.properties @@ -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 - Boletos +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.trecho=Trecho: \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jasper new file mode 100644 index 000000000..71415185b Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jrxml new file mode 100644 index 000000000..ed556dd3f --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletos.jrxml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + <band height="62" splitType="Stretch"> + <textField> + <reportElement x="0" y="0" width="620" 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="638" 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="620" 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="620" 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> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jasper new file mode 100644 index 000000000..f8ddfc97d Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jrxml new file mode 100644 index 000000000..5b9b1fc90 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jrxml @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band splitType="Stretch"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioVendasPacotesBoletosBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioVendasPacotesBoletosBean.java new file mode 100644 index 000000000..918bca7dd --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioVendasPacotesBoletosBean.java @@ -0,0 +1,206 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.math.BigDecimal; +import java.util.List; + +public class RelatorioVendasPacotesBoletosBean { + + private String descorigen; + private String descdestino; + + private List relatorioVendasPacotesBoletosItemBeans; + + public String getDescorigen() { + return descorigen; + } + + public void setDescorigen(String descorigen) { + this.descorigen = descorigen; + } + + public String getDescdestino() { + return descdestino; + } + + public void setDescdestino(String descdestino) { + this.descdestino = descdestino; + } + + public List getRelatorioVendasPacotesBoletosItemBeans() { + return relatorioVendasPacotesBoletosItemBeans; + } + + public void setRelatorioVendasPacotesBoletosItemBeans(List relatorioVendasPacotesBoletosItemBeans) { + this.relatorioVendasPacotesBoletosItemBeans = relatorioVendasPacotesBoletosItemBeans; + } + + public class RelatorioVendasPacotesBoletosItemBean { + + private String nomconvenio; + private String desctipotarifa; + private Long qtde; + private BigDecimal simportetaxaembarque; + private BigDecimal simportepedagio; + private BigDecimal simporteoutros; + private BigDecimal simporteseguro; + private BigDecimal desconto; + private BigDecimal spreciopagado; + private BigDecimal spreciobase; + + public String getNomconvenio() { + return nomconvenio; + } + + public void setNomconvenio(String nomconvenio) { + this.nomconvenio = nomconvenio; + } + + public String getDesctipotarifa() { + return desctipotarifa; + } + + public void setDesctipotarifa(String desctipotarifa) { + this.desctipotarifa = desctipotarifa; + } + + public Long getQtde() { + return qtde; + } + + public void setQtde(Long qtde) { + this.qtde = qtde; + } + + public BigDecimal getSimportetaxaembarque() { + return simportetaxaembarque; + } + + public void setSimportetaxaembarque(BigDecimal simportetaxaembarque) { + this.simportetaxaembarque = simportetaxaembarque; + } + + public BigDecimal getSimportepedagio() { + return simportepedagio; + } + + public void setSimportepedagio(BigDecimal simportepedagio) { + this.simportepedagio = simportepedagio; + } + + public BigDecimal getSimporteoutros() { + return simporteoutros; + } + + public void setSimporteoutros(BigDecimal simporteoutros) { + this.simporteoutros = simporteoutros; + } + + public BigDecimal getSimporteseguro() { + return simporteseguro; + } + + public void setSimporteseguro(BigDecimal simporteseguro) { + this.simporteseguro = simporteseguro; + } + + public BigDecimal getDesconto() { + return desconto; + } + + public void setDesconto(BigDecimal desconto) { + this.desconto = desconto; + } + + public BigDecimal getSpreciopagado() { + return spreciopagado; + } + + public void setSpreciopagado(BigDecimal spreciopagado) { + this.spreciopagado = spreciopagado; + } + + public BigDecimal getSpreciototal() { + BigDecimal spreciototal = BigDecimal.ZERO; + + spreciototal = simportetaxaembarque != null ? spreciototal.add(simportetaxaembarque) : spreciototal; + spreciototal = simportepedagio != null ? spreciototal.add(simportepedagio) : spreciototal; + spreciototal = simporteoutros != null ? spreciototal.add(simporteoutros) : spreciototal; + spreciototal = simporteseguro != null ? spreciototal.add(simporteseguro) : spreciototal; + spreciototal = spreciobase != null ? spreciototal.add(spreciobase) : spreciototal; + + return spreciototal; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((desctipotarifa == null) ? 0 : desctipotarifa.hashCode()); + result = prime * result + ((nomconvenio == null) ? 0 : nomconvenio.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; + RelatorioVendasPacotesBoletosItemBean other = (RelatorioVendasPacotesBoletosItemBean) obj; + if (desctipotarifa == null) { + if (other.desctipotarifa != null) + return false; + } else if (!desctipotarifa.equals(other.desctipotarifa)) + return false; + if (nomconvenio == null) { + if (other.nomconvenio != null) + return false; + } else if (!nomconvenio.equals(other.nomconvenio)) + return false; + return true; + } + + public BigDecimal getSpreciobase() { + return spreciobase; + } + + public void setSpreciobase(BigDecimal spreciobase) { + this.spreciobase = spreciobase; + } + + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((descdestino == null) ? 0 : descdestino.hashCode()); + result = prime * result + ((descorigen == null) ? 0 : descorigen.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; + RelatorioVendasPacotesBoletosBean other = (RelatorioVendasPacotesBoletosBean) obj; + if (descdestino == null) { + if (other.descdestino != null) + return false; + } else if (!descdestino.equals(other.descdestino)) + return false; + if (descorigen == null) { + if (other.descorigen != null) + return false; + } else if (!descorigen.equals(other.descorigen)) + return false; + return true; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesBoletosController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesBoletosController.java new file mode 100644 index 000000000..81a2b85a4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesBoletosController.java @@ -0,0 +1,94 @@ +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.RelatorioVendasPacotesBoletos; +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("relatorioVendasPacotesBoletosController") +@Scope("prototype") +public class RelatorioVendasPacotesBoletosController extends MyGenericForwardComposer { + + private static final long serialVersionUID = 1L; + + @Autowired + private DataSource dataSourceRead; + + @Autowired + private EmpresaService empresaService; + + private List lsEmpresa; + private Datebox dataInicial; + private Datebox dataFinal; + private MyComboboxEstandar cmbEmpresa; + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + @Override + public void doAfterCompose(Component comp) throws Exception { + lsEmpresa = empresaService.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 parametros = new HashMap(); + 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); + + JasperReport subRelatorioVendasPacotesBoletosItens = (JasperReport) JRLoader.loadObject(this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesBoletosItem.jasper")); + parametros.put("subreporte", subRelatorioVendasPacotesBoletosItens); + + Relatorio relatorio = new RelatorioVendasPacotesBoletos(parametros, dataSourceRead.getConnection(), "RelatorioVendasPacotesBoletosItem"); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioVendasPacotesBoletosController.window.title"), args, MODAL); + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesDetalhadoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesDetalhadoController.java index 09f1ce448..8794f0d71 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesDetalhadoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioVendasPacotesDetalhadoController.java @@ -95,8 +95,8 @@ public class RelatorioVendasPacotesDetalhadoController extends MyGenericForwardC } parametros.put("pacoteId", pacoteId); - JasperReport subRelatorioVendasPacotesResumidoItens = (JasperReport) JRLoader.loadObject(this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesDetalhadoItem.jasper")); - parametros.put("subreporte", subRelatorioVendasPacotesResumidoItens); + JasperReport subRelatorioVendasPacotesDetalhadoItens = (JasperReport) JRLoader.loadObject(this.getClass().getResourceAsStream("/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioVendasPacotesDetalhadoItem.jasper")); + parametros.put("subreporte", subRelatorioVendasPacotesDetalhadoItens); Relatorio relatorio = new RelatorioVendasPacotesDetalhado(parametros, dataSourceRead.getConnection(), "RelatorioVendasPacotesDetalhadoItem"); diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioVendasPacotesBoletos.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioVendasPacotesBoletos.java new file mode 100644 index 000000000..6815a8f48 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioVendasPacotesBoletos.java @@ -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 ItemMenuRelatorioVendasPacotesBoletos extends DefaultItemMenuSistema { + + public ItemMenuRelatorioVendasPacotesBoletos() { + super("indexController.mniRelatorioVendasPacotesBoletos.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPACOTESBOLETOS"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioVendasPacotesBoletos.zul", + Labels.getLabel("relatorioVendasPacotesBoletosController.window.title"), getArgs() ,desktop); + } + +} diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 5dc6c008d..94db8748b 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -242,8 +242,9 @@ indexController.mniRelatorioCorridas.label = Reporte de Corridas indexController.mniRelatorioDemandas.label = Reporte de Demandas indexController.mniRelatorioReceitaServico.label = Relatório de Receita por Serviço indexController.mniPrecoApanhe.label = Preço Apanhe -indexController.mniRelatorioVendasPacotesResumido.label = Ventas de Paquetes Resumido -indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Paquetes Detalhado +indexController.mniRelatorioVendasPacotesResumido.label = Ventas de Paquetes - Resumido +indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Paquetes - Detalhado +indexController.mniRelatorioVendasPacotesBoletos.label = Ventas de Pacotes - Boletos indexController.mniSubMenuClientePacote.label=Pacote indexController.mniAlterarEnderecoApanhe.label=Alterar Endereço Apanhe @@ -5278,14 +5279,21 @@ editarAlterarEnderecoApanheController.lhNumoperacion.label = Num Operacion editarAlterarEnderecoApanheController.lhDataPacote.label = Fecha Pacote # Relatorio Vendas Pacotes Resumido -relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pacotes Resumido +relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pacotes - Resumido 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.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 \ No newline at end of file +relatorioVendasPacotesDetalhadoController.lblPacote.value = Pacote + +# Relatorio Vendas Pacotes Boletos +relatorioVendasPacotesBoletosController.window.title = Relatório Vendas de Pacotes - Boletos +relatorioVendasPacotesBoletosController.lbDataIni.value = Fecha Inicio +relatorioVendasPacotesBoletosController.lbDataFin.value = Fecha Final +relatorioVendasPacotesBoletosController.lblEmpresa.value = Empresa +relatorioVendasPacotesBoletosController.lblPacote.value = Pacote \ No newline at end of file diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 0706fa306..76bf5e1fb 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -247,8 +247,9 @@ indexController.mniRelatorioCorridas.label = Relatório de Serviços indexController.mniRelatorioDemandas.label = Relatório de Demandas indexController.mniRelatorioReceitaServico.label = Relatório de Receita por Serviço indexController.mniPrecoApanhe.label = Preço Apanhe -indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes Resumido -indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Pacotes Detalhado +indexController.mniRelatorioVendasPacotesResumido.label = Vendas de Pacotes - Resumido +indexController.mniRelatorioVendasPacotesDetalhado.label = Ventas de Pacotes - Detalhado +indexController.mniRelatorioVendasPacotesBoletos.label = Ventas de Pacotes - Boletos indexController.mnSubMenuImpressaoFiscal.label=Impressão Fiscal indexController.mniTotnaofiscalEmpresa.label=Totalizadoes Não-fiscais @@ -5405,14 +5406,21 @@ editarAlterarEnderecoApanheController.lhNumoperacion.label = Localizador editarAlterarEnderecoApanheController.lhDataPacote.label = Data Pacote # Relatorio Vendas Pacotes Resumido -relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pacotes Resumido +relatorioVendasPacotesResumidoController.window.title = Relatório Vendas de Pacotes - Resumido 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.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 \ No newline at end of file +relatorioVendasPacotesDetalhadoController.lblPacote.value = Pacote + +# Relatorio Vendas Pacotes Boletos +relatorioVendasPacotesBoletosController.window.title = Relatório Vendas de Pacotes - Boletos +relatorioVendasPacotesBoletosController.lbDataIni.value = Data Inicial +relatorioVendasPacotesBoletosController.lbDataFin.value = Data Final +relatorioVendasPacotesBoletosController.lblEmpresa.value = Empresa +relatorioVendasPacotesBoletosController.lblPacote.value = Pacote \ No newline at end of file diff --git a/web/gui/relatorios/filtroRelatorioVendasPacotesBoletos.zul b/web/gui/relatorios/filtroRelatorioVendasPacotesBoletos.zul new file mode 100644 index 000000000..b1e8fafc0 --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioVendasPacotesBoletos.zul @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + +