diff --git a/pom.xml b/pom.xml index f4e3d5e1e..568121b5c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,12 +4,12 @@ 4.0.0 br.com.rjconsultores ventaboletosadm - 1.104.0 + 1.105.0 war 1.79.0 - 1.64.0 + 1.71.0 UTF-8 diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoCupom.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoCupom.java new file mode 100644 index 000000000..7f4f8bc01 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoCupom.java @@ -0,0 +1,137 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +public class RelatorioDescontoCupom extends Relatorio { + + private List lsDadosRelatorioDescontoPorCupom; + + public RelatorioDescontoCupom(Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new DataSource(this) { + @Override + public void initDados() throws Exception { + + lsDadosRelatorioDescontoPorCupom = new ArrayList(); + + Connection conexao = this.relatorio.getConexao(); + Map parametros = this.relatorio.getParametros(); + + String sql = getSql(); + + NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql); + + ResultSet rset = null; + + java.sql.Date dataInicial = new java.sql.Date( + DateUtil.normalizarToFecha((Date) parametros.get("DATA_INICIAL")).getTime()); + java.sql.Date dataFinal = new java.sql.Date( + DateUtil.normalizarToFecha((Date) parametros.get("DATA_FINAL")).getTime()); + + java.sql.Date dateResgateInicial = new java.sql.Date( + DateUtil.normalizarToFecha((Date) parametros.get("DATA_RESGATEINICIAL")).getTime()); + java.sql.Date dateResgateFinal = new java.sql.Date( + DateUtil.normalizarToFecha((Date) parametros.get("DATA_RESGATEFINAL")).getTime()); + + stmt.setDate("DATA_INICIAL", dataInicial); + stmt.setDate("DATA_FINAL", dataFinal); + + stmt.setDate("DATA_RESGATEINICIAL", dateResgateInicial); + stmt.setDate("DATA_RESGATEFINAL", dateResgateFinal); + + if (parametros.get("EMPRESA_ID") != null) + stmt.setInt("EMPRESA_ID", (Integer) parametros.get("EMPRESA_ID")); + else + stmt.setNull("EMPRESA_ID", java.sql.Types.INTEGER); + + if (parametros.get("PUNTOVENTA_ID") != null) + stmt.setInt("PUNTOVENTA_ID", (Integer) parametros.get("PUNTOVENTA_ID")); + else + stmt.setNull("PUNTOVENTA_ID", java.sql.Types.INTEGER); + + rset = stmt.executeQuery(); + + RelatorioDescontoPorCupomBean relatorioDescontoPorCupom = null; + while (rset.next()) { + relatorioDescontoPorCupom = new RelatorioDescontoPorCupomBean(); + relatorioDescontoPorCupom.setDescConvenio(rset.getString("descConvenio")); + relatorioDescontoPorCupom.setCodigoCupom(rset.getString("codigoCupom")); + relatorioDescontoPorCupom.setCliente(rset.getString("cliente")); + relatorioDescontoPorCupom.setDataEntrega(rset.getDate("dataEntrega")); + relatorioDescontoPorCupom.setPuntoVentaEntrega(rset.getString("puntoVentaEntrega")); + relatorioDescontoPorCupom.setDataResgate(rset.getDate("dataResgate")); + relatorioDescontoPorCupom.setPuntoVentaResgate(rset.getString("puntoVentaResgate")); + + relatorioDescontoPorCupom.setNumeroTicket(rset.getLong("numeroTicket")); + relatorioDescontoPorCupom.setValorTicket(rset.getBigDecimal("valorTicket")); + relatorioDescontoPorCupom.setValorDescuento(rset.getBigDecimal("valorDescuento")); + lsDadosRelatorioDescontoPorCupom.add(relatorioDescontoPorCupom); + } + + if (lsDadosRelatorioDescontoPorCupom.size() > 0) { + + setLsDadosRelatorio(lsDadosRelatorioDescontoPorCupom); + } + } + + }); + + } + + private String getSql() { + StringBuilder sql = new StringBuilder(); + sql.append("SELECT "); + sql.append("C.DESCCONVENIO descConvenio, "); + sql.append("CS.CODIGOCUPOM codigoCupom, "); + sql.append("BOLETOSORTEADO.NOMBPASAJERO cliente, "); + sql.append("BOLETOSORTEADO.fechorventa dataEntrega, "); + sql.append("PUNTOVENTASORTEADO.NOMBPUNTOVENTA puntoVentaEntrega, "); + sql.append("BOLETOCUPOM.fechorventa dataResgate, "); + sql.append("PUNTOVENTACUPOM.NOMBPUNTOVENTA puntoVentaResgate, "); + sql.append("CS.BOLETOSORTEADO_ID numeroTicket, "); + sql.append("BOLETOCUPOM.precioPagado valorTicket, "); + sql.append("BOLETOCUPOM.descuentoamparado valorDescuento "); + sql.append("FROM CAMPANHACUPOMSORTEADO CS "); + sql.append("INNER JOIN CONVENIO C ON C.CONVENIO_ID=CS.CONVENIO_ID "); + sql.append("INNER JOIN BOLETO BOLETOSORTEADO ON BOLETOSORTEADO.BOLETO_ID=CS.BOLETOSORTEADO_ID "); + sql.append( + "INNER JOIN PUNTO_VENTA PUNTOVENTASORTEADO ON PUNTOVENTASORTEADO.PUNTOVENTA_ID = BOLETOSORTEADO.PUNTOVENTA_ID "); + sql.append("INNER JOIN BOLETO BOLETOCUPOM ON BOLETOCUPOM.BOLETO_ID=CS.BOLETOCUPOM_ID "); + sql.append( + "INNER JOIN PUNTO_VENTA PUNTOVENTACUPOM ON PUNTOVENTACUPOM.PUNTOVENTA_ID = BOLETOCUPOM.PUNTOVENTA_ID "); + sql.append("WHERE "); + sql.append(" C.FECVENTAINI <=:DATA_INICIAL "); + sql.append("AND C.FECVENTAFIN >=:DATA_FINAL "); + sql.append("AND C.FECVIAJEINI <=:DATA_RESGATEINICIAL "); + sql.append("AND C.FECVIAJEFIN >=:DATA_RESGATEFINAL "); + sql.append("AND CS.EMPRESA_ID=COALESCE(:EMPRESA_ID,CS.EMPRESA_ID) "); + sql.append("AND CS.PUNTOVENTA_ID=COALESCE(:PUNTOVENTA_ID,CS.PUNTOVENTA_ID) "); + + return sql.toString(); + } + + @Override + protected void processaParametros() throws Exception { + // TODO Auto-generated method stub + + } + + public void setLsDadosRelatorio(List lsDadosRelatorio) { + this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); + this.lsDadosRelatorioDescontoPorCupom = lsDadosRelatorio; + } + +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoPorCupomBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoPorCupomBean.java new file mode 100644 index 000000000..2483bf3cb --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDescontoPorCupomBean.java @@ -0,0 +1,81 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.math.BigDecimal; +import java.util.Date; + +public class RelatorioDescontoPorCupomBean { + + private String descConvenio; + private String codigoCupom ; + private String cliente; + private Date dataEntrega; + private String puntoVentaEntrega; + private Date dataResgate; + private String puntoVentaResgate; + private Long numeroTicket; + private BigDecimal valorTicket; + private BigDecimal valorDescuento; + public String getDescConvenio() { + return descConvenio; + } + public void setDescConvenio(String descConvenio) { + this.descConvenio = descConvenio; + } + public String getCodigoCupom() { + return codigoCupom; + } + public void setCodigoCupom(String codigoCupom) { + this.codigoCupom = codigoCupom; + } + public String getCliente() { + return cliente; + } + public void setCliente(String cliente) { + this.cliente = cliente; + } + public Date getDataEntrega() { + return dataEntrega; + } + public void setDataEntrega(Date dataEntrega) { + this.dataEntrega = dataEntrega; + } + public String getPuntoVentaEntrega() { + return puntoVentaEntrega; + } + public void setPuntoVentaEntrega(String puntoVentaEntrega) { + this.puntoVentaEntrega = puntoVentaEntrega; + } + public Date getDataResgate() { + return dataResgate; + } + public void setDataResgate(Date dataResgate) { + this.dataResgate = dataResgate; + } + public String getPuntoVentaResgate() { + return puntoVentaResgate; + } + public void setPuntoVentaResgate(String puntoVentaResgate) { + this.puntoVentaResgate = puntoVentaResgate; + } + public Long getNumeroTicket() { + return numeroTicket; + } + public void setNumeroTicket(Long numeroTicket) { + this.numeroTicket = numeroTicket; + } + public BigDecimal getValorTicket() { + return valorTicket; + } + public void setValorTicket(BigDecimal valorTicket) { + this.valorTicket = valorTicket; + } + public BigDecimal getValorDescuento() { + return valorDescuento; + } + public void setValorDescuento(BigDecimal valorDescuento) { + this.valorDescuento = valorDescuento; + } + + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_es.properties new file mode 100644 index 000000000..377fabb46 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_es.properties @@ -0,0 +1,25 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +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.dataDaVenda=Data da Venda +cabecalho.dataDoResgate=Data do Resgate + +label.descConvenio=Nome do Convêncio +label.codigoCupom=Código Cupom +label.cliente=Nome Passageiro +label.dataEntrega=Data Entrega +label.puntoVentaEntrega=Agência da Entrega +label.dataResgate=Data Resgate +label.puntoVentaResgate=Agência do Resgate +label.numeroTicket=Ticket Ganhador +label.valorTicket=Valor Ticket +label.valorDescuento=Valor do Desconto diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_pt_BR.properties new file mode 100644 index 000000000..fa68e2423 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDescontoCupom_pt_BR.properties @@ -0,0 +1,25 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +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.dataDaVenda=Data da Venda +cabecalho.dataDoResgate=Data do Resgate + +label.descConvenio=Nome do Convênio +label.codigoCupom=Código Cupom +label.cliente=Nome Passageiro +label.dataEntrega=Data Entrega +label.puntoVentaEntrega=Agência da Entrega +label.dataResgate=Data Resgate +label.puntoVentaResgate=Agência do Resgate +label.numeroTicket=Ticket Ganhador +label.valorTicket=Valor Ticket +label.valorDescuento=Valor do Desconto diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jasper new file mode 100644 index 000000000..530367f37 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jrxml new file mode 100644 index 000000000..86e868d9b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDescontoCupom.jrxml @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="81" splitType="Stretch"> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="eb2d73d0-40a6-4b6d-9e8a-76806f943e47" mode="Transparent" x="0" y="0" width="394" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="14" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{NOME_RELATORIO}]]></textFieldExpression> + </textField> + <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> + <reportElement uuid="8751af1a-64e8-41dc-a423-8ffd9686e093" mode="Transparent" x="811" y="25" width="21" height="16" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Center" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" 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="" isBlankWhenNull="false"> + <reportElement uuid="66239550-5098-4a3a-ad99-ab9f1a420d1e" mode="Transparent" x="728" y="42" width="104" height="15" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.impressorPor}+" "+$P{USUARIO}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy HH:mm" isBlankWhenNull="false"> + <reportElement uuid="ce2d33f4-cfa1-48fe-9a70-5847e9ddd122" mode="Transparent" x="728" y="0" width="104" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfEncoding="Cp1252" isPdfEmbedded="false"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="012dd1aa-b31e-4df4-b879-c3fc9785e27c" mode="Transparent" x="543" y="25" width="267" height="16" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" markup="none"> + <font fontName="SansSerif" size="9" 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 uuid="49b24665-8942-4812-b7b4-7aac56812b46" x="543" y="0" width="185" height="25"/> + <textElement textAlignment="Right"> + <font size="9" isBold="true"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$R{cabecalho.dataHora}]]></textFieldExpression> + </textField> + <line> + <reportElement uuid="0b20a6e5-3ba4-495b-912f-ae8d87eda713" x="-1" y="58" width="832" height="1"/> + </line> + <textField isStretchWithOverflow="true"> + <reportElement uuid="8e18add1-0582-4bed-8896-5948d588cfa0" x="-1" y="59" width="833" height="15"/> + <textElement verticalAlignment="Middle"> + <font size="10"/> + <paragraph lineSpacing="Single"/> + </textElement> + <textFieldExpression><![CDATA[$P{FILTROS}]]></textFieldExpression> + </textField> + <line> + <reportElement uuid="1381bb9d-c239-4937-8f02-70fb99a20ddd" positionType="Float" x="-1" y="78" width="832" height="1"/> + </line> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="7dab3ec0-f044-41df-bdb7-8014567ea89b" mode="Transparent" x="1" y="25" width="100" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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.dataDaVenda}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="1a3b14ee-760a-4576-acdc-adeb9453bee6" mode="Transparent" x="376" y="25" width="70" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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[$P{DATA_RESGATEINICIAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="2a540086-2a16-4860-b4c7-9167dcedc637" mode="Transparent" x="446" y="25" width="20" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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{cabecalho.periodoA}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy " isBlankWhenNull="false"> + <reportElement uuid="4b218deb-bdf8-4f40-ad37-75a9e90582eb" mode="Transparent" x="192" y="25" width="67" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" 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[$P{DATA_FINAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="b290552a-a04c-46ea-a864-7262661a19be" mode="Transparent" x="276" y="25" width="100" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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.dataDoResgate}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="d2e9b85f-5ac2-49d0-81c4-b35fef7c7c64" mode="Transparent" x="101" y="25" width="70" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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[$P{DATA_INICIAL}]]></textFieldExpression> + </textField> + <textField pattern="" isBlankWhenNull="false"> + <reportElement uuid="61eaab9e-3880-4e3a-8b30-aa4bc96c300c" mode="Transparent" x="172" y="25" width="20" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <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{cabecalho.periodoA}]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy" isBlankWhenNull="false"> + <reportElement uuid="292720be-a240-41a3-8d11-937d4bef11cb" mode="Transparent" x="466" y="25" width="67" height="25" forecolor="#000000" backcolor="#FFFFFF"/> + <textElement textAlignment="Left" 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[$P{DATA_RESGATEFINAL}]]></textFieldExpression> + </textField> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java index 606990cb2..b65994b38 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/configuracioneccomerciales/EditarConvenioController.java @@ -670,6 +670,7 @@ public class EditarConvenioController extends MyGenericForwardComposer { convenio.setIndDescuentoNormal(null); convenio.setIndGeral((short) 2); convenio.setCliente(null); + convenio.setImprimeprecio((short) 1 ); ConvenioCampanha convenioCampanha= convenio.getConvenioCampanha(); convenioCampanha.setTermoECondicao(txtTermoCondicao.getValue()); diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDescontoPorCupomController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDescontoPorCupomController.java new file mode 100644 index 000000000..f9bd29bd4 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDescontoPorCupomController.java @@ -0,0 +1,146 @@ +package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios; + +import java.sql.Connection; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.sql.DataSource; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Controller; +import org.zkoss.util.resource.Labels; +import org.zkoss.zk.ui.Component; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zul.Comboitem; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDescontoCupom; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.PuntoVentaService; +import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; +import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; +import com.rjconsultores.ventaboletos.web.utilerias.MyDatebox; +import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; +import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper; + +@Controller("relatorioDescontoPorCupomController") +@Scope("prototype") + +public class RelatorioDescontoPorCupomController extends MyGenericForwardComposer { + + /** + * + */ + private static final long serialVersionUID = 1L; + + @Autowired + private transient PagedListWrapper plwPuntoVenta; + @Autowired + private DataSource dataSourceRead; + + @Autowired + private EmpresaService empresaService; + private MyComboboxEstandar cmbEmpresa; + private List lsEmpresa; + + @Autowired + private PuntoVentaService puntoVentaService; + private MyComboboxEstandar cmbPuntoVenta; + private List lsPuntoVenta; + + private MyDatebox datInicial; + private MyDatebox datFinal; + private MyDatebox datResgateInicial; + private MyDatebox datResgateFinal; + + @Override + public void doAfterCompose(Component comp) throws Exception { + + lsEmpresa = empresaService.obtenerTodos(); + lsPuntoVenta = puntoVentaService.obtenerTodos(); + + + + super.doAfterCompose(comp); + } + + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { + executarRelatorio(); + } + + @SuppressWarnings({ "rawtypes", "unchecked" }) + private void executarRelatorio() throws Exception { + Relatorio relatorio; + Map parametros = new HashMap(); + StringBuilder filtro = new StringBuilder(); + + parametros.put("DATA_INICIAL", (java.util.Date) this.datInicial.getValue()); + parametros.put("DATA_FINAL", (java.util.Date) this.datFinal.getValue()); + parametros.put("DATA_RESGATEINICIAL", (java.util.Date) this.datResgateInicial.getValue()); + parametros.put("DATA_RESGATEFINAL", (java.util.Date) this.datResgateFinal.getValue()); + parametros.put("NOME_RELATORIO", Labels.getLabel("relatorioDescontoPorCupomController.window.title")); + parametros.put("USUARIO", UsuarioLogado.getUsuarioLogado().getUsuarioId().toString()); + + filtro.append(" Empresa: "); + + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + Empresa empresa = (Empresa) itemEmpresa.getValue(); + parametros.put("EMPRESA_ID", empresa.getEmpresaId()); + parametros.put("EMPRESA", empresa.getNombempresa()); + filtro.append(empresa.getNombempresa() + ";"); + } else { + filtro.append("Todas;"); + } + + filtro.append(" Empresa: "); + + Comboitem itemPuntoVenta = cmbPuntoVenta.getSelectedItem(); + if (itemPuntoVenta != null) { + PuntoVenta puntoVenta = (PuntoVenta) itemPuntoVenta.getValue(); + parametros.put("PUNTOVENTA_ID", puntoVenta.getPuntoventaId()); + parametros.put("PUNTOVENTA", puntoVenta.getNombpuntoventa()); + filtro.append(puntoVenta.getNombpuntoventa() + ";"); + } else { + filtro.append("Todas;"); + } + + parametros.put("FILTROS", filtro.toString()); + + Connection connection = dataSourceRead.getConnection(); + try { + relatorio = new RelatorioDescontoCupom(parametros, connection); + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", Labels.getLabel("relatorioW2IController.window.title"), args, + MODAL); + } finally { + if ((connection != null) && !connection.isClosed()) { + connection.close(); + } + } + } + + public List getLsEmpresa() { + return lsEmpresa; + } + + public void setLsEmpresa(List lsEmpresa) { + this.lsEmpresa = lsEmpresa; + } + + public List getLsPuntoVenta() { + return lsPuntoVenta; + } + + public void setLsPuntoVenta(List lsPuntoVenta) { + this.lsPuntoVenta = lsPuntoVenta; + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioDescontoPorCupom.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioDescontoPorCupom.java new file mode 100644 index 000000000..0214495c2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/ItemMenuRelatorioDescontoPorCupom.java @@ -0,0 +1,27 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class ItemMenuRelatorioDescontoPorCupom extends DefaultItemMenuSistema { + + public ItemMenuRelatorioDescontoPorCupom() { + super("indexController.mniRelatorioDescontoPorCupom.label"); + + + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIODESCONTOPORCUPOM"; + } + + @Override + public void ejecutar() { + PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioDescontoPorCupom.zul", + Labels.getLabel("relatorioDescontoPorCupomController.window.title"), getArgs(), desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties index fda945f8b..0db6a2ce3 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/menu_original.properties @@ -219,6 +219,7 @@ analitico.gerenciais.estatisticos.relatorioVendaEmbarcada=com.rjconsultores.vent analitico.gerenciais.estatisticos.movimentacaobilhete=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioMovimentacaoBilhete analitico.gerenciais.estatisticos.encerramentocheckin=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioEncerramentoCheckin analitico.gerenciais.estatisticos.mmphDERPR=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioMmphDer +analitico.gerenciais.estatisticos.relatorioDescontoPorCupom=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioDescontoPorCupom #------------------------------RELATORIOS FINANCEIROS----------------------------------------------------------------------------------------------------------------------------------------------- analitico.gerenciais.financeiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.analitico.gerenciais.financeiro.SubMenuRelatorioFinanceiro analitico.gerenciais.financeiro.aproveitamentoFinanceiro=com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.ItemMenuRelatorioAproveitamentoFinanceiro diff --git a/web/WEB-INF/i3-label_en.label b/web/WEB-INF/i3-label_en.label index d4397b103..ab6f9fbe3 100644 --- a/web/WEB-INF/i3-label_en.label +++ b/web/WEB-INF/i3-label_en.label @@ -10037,3 +10037,14 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série winMovimentacionBilhetesPuntoVenta.origem.label = Origem winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag. winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Natureza + + + +indexController.mniRelatorioDescontoPorCupom.label = Relatório Desconto Por Cupom +relatorioDescontoPorCupomController.window.title = RELATÓRIO DESCONTO POR CUPOM +relatorioDescontoPorCupomController.lbDatInicial.value=Data Inicial da Venda +relatorioDescontoPorCupomController.lbDatFinal.value=Data Final da Venda +relatorioDescontoPorCupomController.lbDatResgateInicial.value=Data Inicial do Resgate +relatorioDescontoPorCupomController.lbDatResgateFinal.value=Data Final do Resgate +winFiltroRelatorioDescontoPorCupom.lbEmpresa.value=Empresa +winFiltroRelatorioDescontoPorCupom.lbPuntoVenta.value=Agência diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index c15e9fa0d..383ae80e2 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -10163,3 +10163,13 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série winMovimentacionBilhetesPuntoVenta.origem.label = Origen winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag. winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Naturaleza + + +indexController.mniRelatorioDescontoPorCupom.label = Relatório Desconto Por Cupom +relatorioDescontoPorCupomController.window.title = RELATÓRIO DESCONTO POR CUPOM +relatorioDescontoPorCupomController.lbDatInicial.value=Data Inicial da Venda +relatorioDescontoPorCupomController.lbDatFinal.value=Data Final da Venda +relatorioDescontoPorCupomController.lbDatResgateInicial.value=Data Inicial do Resgate +relatorioDescontoPorCupomController.lbDatResgateFinal.value=Data Final do Resgate +winFiltroRelatorioDescontoPorCupom.lbEmpresa.value=Empresa +winFiltroRelatorioDescontoPorCupom.lbPuntoVenta.value=Agência diff --git a/web/WEB-INF/i3-label_fr_FR.label b/web/WEB-INF/i3-label_fr_FR.label index a726c2b2a..b0cc1a8f5 100644 --- a/web/WEB-INF/i3-label_fr_FR.label +++ b/web/WEB-INF/i3-label_fr_FR.label @@ -10144,3 +10144,13 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série winMovimentacionBilhetesPuntoVenta.origem.label = Origine winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag. winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Nature + + +indexController.mniRelatorioDescontoPorCupom.label = Relatório Desconto Por Cupom +relatorioDescontoPorCupomController.window.title = RELATÓRIO DESCONTO POR CUPOM +relatorioDescontoPorCupomController.lbDatInicial.value=Data Inicial da Venda +relatorioDescontoPorCupomController.lbDatFinal.value=Data Final da Venda +relatorioDescontoPorCupomController.lbDatResgateInicial.value=Data Inicial do Resgate +relatorioDescontoPorCupomController.lbDatResgateFinal.value=Data Final do Resgate +winFiltroRelatorioDescontoPorCupom.lbEmpresa.value=Empresa +winFiltroRelatorioDescontoPorCupom.lbPuntoVenta.value=Agência diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 9f620f413..b307a09f3 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -10147,3 +10147,13 @@ winMovimentacionBilhetesPuntoVenta.numSerie.label = Série winMovimentacionBilhetesPuntoVenta.origem.label = Origem winMovimentacionBilhetesPuntoVenta.puntoventa.label = Ag. winMovimentacionBilhetesPuntoVenta.tipoMovimentacion.label = Natureza + + +indexController.mniRelatorioDescontoPorCupom.label = Relatório Desconto Por Cupom +relatorioDescontoPorCupomController.window.title = RELATÓRIO DESCONTO POR CUPOM +relatorioDescontoPorCupomController.lbDatInicial.value=Data Inicial da Venda +relatorioDescontoPorCupomController.lbDatFinal.value=Data Final da Venda +relatorioDescontoPorCupomController.lbDatResgateInicial.value=Data Inicial do Resgate +relatorioDescontoPorCupomController.lbDatResgateFinal.value=Data Final do Resgate +winFiltroRelatorioDescontoPorCupom.lbEmpresa.value=Empresa +winFiltroRelatorioDescontoPorCupom.lbPuntoVenta.value=Agência diff --git a/web/gui/relatorios/filtroRelatorioDescontoPorCupom.zul b/web/gui/relatorios/filtroRelatorioDescontoPorCupom.zul new file mode 100644 index 000000000..f22d93e19 --- /dev/null +++ b/web/gui/relatorios/filtroRelatorioDescontoPorCupom.zul @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +