diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternet.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternet.java index 4a36ff0aa..271ae09aa 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternet.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternet.java @@ -17,7 +17,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; public class RelatorioBaixasVendasInternet extends Relatorio { - + private Date fecInicio; private Date fecFinal; private PuntoVenta puntoVenta; @@ -33,22 +33,24 @@ public class RelatorioBaixasVendasInternet extends Relatorio { protected void processaParametros() throws Exception { NamedParameterStatement namedParameterStatement = new NamedParameterStatement(getConexao(), getSql()); - - namedParameterStatement.setInt("puntoVentaId", puntoVenta.getPuntoventaId()); - this.parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa()); - + + if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) { + namedParameterStatement.setInt("puntoVentaId", puntoVenta.getPuntoventaId()); + this.parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa()); + } + SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); this.parametros.put("fecInicio", dateFormat.format(fecInicio)); this.parametros.put("fecFinal", dateFormat.format(fecFinal)); namedParameterStatement.setDate("fecInicio", new java.sql.Date(fecInicio.getTime())); namedParameterStatement.setDate("fecFinal", new java.sql.Date(fecFinal.getTime())); - + ResultSet resultSet = namedParameterStatement.executeQuery(); List resultBean = transformResultSet(resultSet); setCollectionDataSource(new JRBeanCollectionDataSource(resultBean)); - + } - + private List transformResultSet(ResultSet resultSet) throws SQLException { List resultBean = new ArrayList(); while (resultSet.next()) { @@ -60,27 +62,45 @@ public class RelatorioBaixasVendasInternet extends Relatorio { bean.setValor(resultSet.getBigDecimal("VALOR")); bean.setUsuarioId(resultSet.getInt("USUARIO_ID")); bean.setNombUsuario(resultSet.getString("NOMBUSUARIO")); + bean.setValorPago(resultSet.getBigDecimal("VALOR_PAGO")); resultBean.add(bean); } return resultBean; } private String getSql() { - - String sql = "SELECT DISTINCT B.FECCREACION, B.NUMFOLIOSISTEMA, " - + "U.USUARIO_ID, U.NOMBUSUARIO, O.DESCPARADA ORIGEN, D.DESCPARADA DESTINO, " - + "COALESCE((B.PRECIOPAGADO + B.IMPORTETAXAEMBARQUE + B.IMPORTESEGURO + B.IMPORTEPEDAGIO + B.IMPORTEOUTROS), 0) AS VALOR " - + "FROM BOLETO B " - + "JOIN PARADA O ON B.ORIGEN_ID = O.PARADA_ID " - + "JOIN PARADA D ON B.DESTINO_ID = D.PARADA_ID " - + "JOIN USUARIO U ON B.USUARIO_ID = U.USUARIO_ID " - + "WHERE B.INDSTATUSBOLETO = 'E' " - + "AND B.FECCREACION BETWEEN :fecInicio AND :fecFinal " - + "AND PUNTOVENTA_ID = :puntoVentaId " - + "ORDER BY U.USUARIO_ID "; + + String sql = ""; + + if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) { + sql = "SELECT DISTINCT B.FECCREACION, B.NUMFOLIOSISTEMA, " + + "U.USUARIO_ID, U.NOMBUSUARIO, O.DESCPARADA ORIGEN, D.DESCPARADA DESTINO, " + + "COALESCE(COALESCE(B.PRECIOPAGADO, 0) + COALESCE(B.IMPORTETAXAEMBARQUE, 0) + COALESCE(B.IMPORTESEGURO, 0) + COALESCE(B.IMPORTEPEDAGIO, 0) + COALESCE(B.IMPORTEOUTROS, 0), 0) AS VALOR, " + + "B.PRECIOPAGADO as VALOR_PAGO " + + "FROM BOLETO B " + + "JOIN PARADA O ON B.ORIGEN_ID = O.PARADA_ID " + + "JOIN PARADA D ON B.DESTINO_ID = D.PARADA_ID " + + "JOIN USUARIO U ON B.USUARIO_ID = U.USUARIO_ID " + + "WHERE B.INDSTATUSBOLETO = 'E' " + + "AND B.FECCREACION BETWEEN :fecInicio AND :fecFinal " + + "AND PUNTOVENTA_ID = :puntoVentaId " + + "ORDER BY U.USUARIO_ID "; + } else { + sql = "SELECT DISTINCT B.FECCREACION, B.NUMFOLIOSISTEMA, " + + "U.USUARIO_ID, U.NOMBUSUARIO, O.DESCPARADA ORIGEN, D.DESCPARADA DESTINO, " + + "COALESCE(COALESCE(B.PRECIOPAGADO, 0) + COALESCE(B.IMPORTETAXAEMBARQUE, 0) + COALESCE(B.IMPORTESEGURO, 0) + COALESCE(B.IMPORTEPEDAGIO, 0) + COALESCE(B.IMPORTEOUTROS, 0), 0) AS VALOR, " + + "B.PRECIOPAGADO as VALOR_PAGO " + + "FROM BOLETO B " + + "JOIN PARADA O ON B.ORIGEN_ID = O.PARADA_ID " + + "JOIN PARADA D ON B.DESTINO_ID = D.PARADA_ID " + + "JOIN USUARIO U ON B.USUARIO_ID = U.USUARIO_ID " + + "WHERE B.INDSTATUSBOLETO = 'E' " + + "AND B.FECCREACION BETWEEN :fecInicio AND :fecFinal " + + "ORDER BY U.USUARIO_ID "; + } return sql; - + } } \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternetSintetico.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternetSintetico.java new file mode 100644 index 000000000..bb8c9ee3b --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioBaixasVendasInternetSintetico.java @@ -0,0 +1,85 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; + +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioBaixasVendasInternetSinteticoBean; +import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +public class RelatorioBaixasVendasInternetSintetico extends Relatorio { + + private Date fecInicio; + private Date fecFinal; + + public RelatorioBaixasVendasInternetSintetico(Connection conexao, Date fecInicio, Date fecFinal) { + super(new HashMap(), conexao); + this.fecInicio = fecInicio; + this.fecFinal = fecFinal; + } + + @Override + protected void processaParametros() throws Exception { + + NamedParameterStatement namedParameterStatement = new NamedParameterStatement(getConexao(), getSql()); + + SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); + this.parametros.put("fecInicio", dateFormat.format(fecInicio)); + this.parametros.put("fecFinal", dateFormat.format(fecFinal)); + namedParameterStatement.setDate("fecInicio", new java.sql.Date(fecInicio.getTime())); + namedParameterStatement.setDate("fecFinal", new java.sql.Date(fecFinal.getTime())); + + ResultSet resultSet = namedParameterStatement.executeQuery(); + List resultBean = transformResultSet(resultSet); + setCollectionDataSource(new JRBeanCollectionDataSource(resultBean)); + + } + + private List transformResultSet(ResultSet resultSet) throws SQLException { + List resultBean = new ArrayList(); + while (resultSet.next()) { + RelatorioBaixasVendasInternetSinteticoBean bean = new RelatorioBaixasVendasInternetSinteticoBean(); + bean.setPuntoventaId(resultSet.getInt("PUNTOVENTA_ID")); + bean.setQtdPassagens(resultSet.getInt("QTD_PASSAGENS")); + bean.setNombPuntoventa(resultSet.getString("NOMBPUNTOVENTA")); + bean.setValor(resultSet.getBigDecimal("VALOR")); + bean.setValorPago(resultSet.getBigDecimal("VALOR_PAGO")); + resultBean.add(bean); + } + return resultBean; + } + + private String getSql() { + + String sql = ""; + + sql = "SELECT DISTINCT B.PUNTOVENTA_ID, PV.NOMBPUNTOVENTA, " + + "COUNT(*) as QTD_PASSAGENS, " + + "SUM(B.PRECIOPAGADO) AS VALOR_PAGO, " + + "SUM(COALESCE((COALESCE(B.PRECIOPAGADO, 0) + COALESCE(B.IMPORTETAXAEMBARQUE, 0) + COALESCE(B.IMPORTESEGURO, 0) + COALESCE(B.IMPORTEPEDAGIO, 0) + COALESCE(B.IMPORTEOUTROS, 0)), 0)) AS VALOR " + + "FROM BOLETO B " + + "JOIN PARADA O " + + "ON B.ORIGEN_ID = O.PARADA_ID " + + "JOIN PARADA D " + + "ON B.DESTINO_ID = D.PARADA_ID " + + "JOIN USUARIO U " + + "ON B.USUARIO_ID = U.USUARIO_ID " + + "JOIN PUNTO_VENTA PV " + + "ON B.PUNTOVENTA_ID = PV.PUNTOVENTA_ID " + + "WHERE B.INDSTATUSBOLETO = 'E' " + + "AND B.FECCREACION BETWEEN :fecInicio AND :fecFinal " + + "GROUP BY B.PUNTOVENTA_ID, PV.NOMBPUNTOVENTA "; + + return sql; + + } + +} \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_es.properties new file mode 100644 index 000000000..134963e75 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_es.properties @@ -0,0 +1,24 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +cabecalho.nome=Relatório Vendas para Comissão +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.usuario=Usuário: + +label.nombPuntoVenta=Punto Venta +label.fecImpresion=Data da Impressão +label.numFolioSistema=Número Folio +label.origen=Origen +label.destino=Destino +label.valor=Valor del Folio +label.total=Total +label.valorPago=Precios +label.totalPassagens=Total Pasajes \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_pt_BR.properties new file mode 100644 index 000000000..00b980e2c --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternetSintetico_pt_BR.properties @@ -0,0 +1,26 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. + +#Labels cabeçalho +cabecalho.nome=Relatório de Baixas Vendas Internet Sintético +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.nombPuntoventa=Ponto de Venda: + +label.puntoventaId=ID +label.nombPuntoVenta=Nome Ponto de Venda +label.fecImpresion=Data da Impressão +label.numFolioSistema=Número da Passagem +label.origen=Origem +label.destino=Destino +label.valor=Valor da Passagem +label.total=Total +label.valorPago=Valor Tarifa +label.totalPassagens=Total Passagens +label.qtdPassagens=Quantidade Passagens \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_es.properties index 51bff3371..134963e75 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_es.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_es.properties @@ -19,4 +19,6 @@ label.numFolioSistema=N label.origen=Origen label.destino=Destino label.valor=Valor del Folio -label.total=Total \ No newline at end of file +label.total=Total +label.valorPago=Precios +label.totalPassagens=Total Pasajes \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_pt_BR.properties index c14d9b1ea..431b5999e 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioBaixasVendasInternet_pt_BR.properties @@ -19,4 +19,6 @@ label.numFolioSistema=N label.origen=Origem label.destino=Destino label.valor=Valor da Passagem -label.total=Total \ No newline at end of file +label.total=Total +label.valorPago=Valor Tarifa +label.totalPassagens=Total Passagens \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jasper index cb5724907..743751773 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jrxml index 3c0687792..48f014f68 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternet.jrxml @@ -1,8 +1,8 @@ - + - + @@ -18,63 +18,90 @@ + + + + + + + - + - - + - - + - - + - - + - + - - + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + @@ -84,29 +111,28 @@ <band height="81" splitType="Stretch"> <textField> - <reportElement uuid="43b2c28d-4760-4890-b00d-25e931e79c74" x="0" y="0" width="620" height="20"/> + <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 uuid="4d1bcd65-c9a6-44b4-8dca-cc3c4c20c9a5" x="638" y="0" width="164" height="20"/> + <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 uuid="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b" x="0" y="20" width="620" height="20"/> + <reportElement x="0" y="20" 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> <textField> - <reportElement uuid="a91f6081-4740-4e36-8965-41b6cde4cc20" x="0" y="41" width="263" height="20"/> - <textElement/> + <reportElement x="0" y="41" width="263" height="20" uuid="a91f6081-4740-4e36-8965-41b6cde4cc20"/> <textFieldExpression><![CDATA[$R{label.nombPuntoVenta} + ": " + $P{nombPuntoVenta}]]></textFieldExpression> </textField> </band> @@ -114,7 +140,7 @@ <pageHeader> <band height="21" splitType="Stretch"> <textField> - <reportElement uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec" x="607" y="0" width="195" height="20"/> + <reportElement x="607" y="0" width="195" height="20" uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec"/> <textElement textAlignment="Right"> <font isBold="true"/> </textElement> @@ -125,30 +151,30 @@ <detail> <band height="20" splitType="Stretch"> <textField> - <reportElement uuid="c6e24c5c-058d-4eab-8ceb-2ab9bd155da1" x="0" y="0" width="160" height="20"/> - <textElement/> + <reportElement x="0" y="0" width="140" height="20" uuid="c6e24c5c-058d-4eab-8ceb-2ab9bd155da1"/> <textFieldExpression><![CDATA[$F{fecImpresion}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="eb9db181-e228-40df-ada1-10098ca99bfe" x="160" y="0" width="160" height="20"/> - <textElement/> + <reportElement x="140" y="0" width="120" height="20" uuid="eb9db181-e228-40df-ada1-10098ca99bfe"/> <textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="cc3db7ec-afda-474d-8e7e-5fb1ba1d499e" x="354" y="0" width="140" height="20"/> - <textElement/> + <reportElement x="394" y="0" width="120" height="20" uuid="cc3db7ec-afda-474d-8e7e-5fb1ba1d499e"/> <textFieldExpression><![CDATA[$F{origen}]]></textFieldExpression> </textField> <textField> - <reportElement uuid="1d2ad720-6a25-43fa-9e41-9a9b6436c036" x="498" y="0" width="140" height="20"/> - <textElement/> + <reportElement x="516" y="0" width="120" height="20" uuid="1d2ad720-6a25-43fa-9e41-9a9b6436c036"/> <textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression> </textField> <textField pattern="¤ #,##0.00"> - <reportElement uuid="a6133da6-d69f-4fca-863c-d71c870c8575" x="642" y="0" width="160" height="20"/> + <reportElement x="642" y="0" width="160" height="20" uuid="a6133da6-d69f-4fca-863c-d71c870c8575"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression> </textField> + <textField pattern="¤ #,##0.00"> + <reportElement x="263" y="0" width="130" height="20" uuid="9ee0da34-ddc9-4698-829a-4ea072b659a2"/> + <textFieldExpression><![CDATA[$F{valorPago}]]></textFieldExpression> + </textField> </band> </detail> <pageFooter> @@ -157,7 +183,7 @@ <noData> <band height="24"> <textField isBlankWhenNull="true"> - <reportElement uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091" positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="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> diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jasper new file mode 100644 index 000000000..1fa14fdf8 Binary files /dev/null and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jrxml new file mode 100644 index 000000000..708196ccc --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioBaixasVendasInternetSintetico.jrxml @@ -0,0 +1,152 @@ +<?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="RelatorioBaixasVendasInternetSintetico" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4"> + <property name="ireport.zoom" value="1.5"/> + <property name="ireport.x" value="0"/> + <property name="ireport.y" value="0"/> + <parameter name="fecInicio" class="java.lang.String"/> + <parameter name="fecFinal" class="java.lang.String"/> + <parameter name="noDataRelatorio" class="java.lang.String"/> + <parameter name="empresa" class="java.lang.String"/> + <parameter name="nombPuntoVenta" class="java.lang.String"/> + <queryString> + <![CDATA[]]> + </queryString> + <field name="valor" class="java.math.BigDecimal"/> + <field name="nombPuntoventa" class="java.lang.String"/> + <field name="valorPago" class="java.math.BigDecimal"/> + <field name="puntoventaId" class="java.lang.Integer"/> + <field name="qtdPassagens" class="java.lang.Integer"/> + <variable name="sumValor" class="java.math.BigDecimal" resetType="Group" resetGroup="group_usuario" calculation="Sum"> + <variableExpression><![CDATA[$F{valor}]]></variableExpression> + </variable> + <variable name="sumValorPago" class="java.math.BigDecimal" resetType="Group" resetGroup="group_usuario" calculation="Sum"> + <variableExpression><![CDATA[$F{valorPago}]]></variableExpression> + </variable> + <group name="group_usuario"> + <groupExpression><![CDATA[]]></groupExpression> + <groupHeader> + <band height="46"> + <line> + <reportElement positionType="Float" x="0" y="43" width="802" height="1" uuid="811af238-a027-48e9-bd6f-eee885474929"/> + </line> + <textField> + <reportElement x="0" y="22" width="98" height="20" uuid="5af379ca-85ae-4850-a804-75d512d7cc9d"/> + <textFieldExpression><![CDATA[$R{label.puntoventaId}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="98" y="22" width="135" height="20" uuid="0349258f-e494-4dff-9ac7-f7d70aa0132c"/> + <textFieldExpression><![CDATA[$R{label.nombPuntoVenta}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="492" y="22" width="160" height="20" uuid="2f0a3804-fefe-46fd-827d-e777bb23412b"/> + <textElement textAlignment="Right"/> + <textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="381" y="22" width="130" height="20" uuid="0a47fb6b-bf37-4e7d-9997-6c6549634ba8"/> + <textElement markup="none"/> + <textFieldExpression><![CDATA[$R{label.valorPago}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="233" y="22" width="127" height="20" uuid="b0f298c9-ed7e-4b82-a2e7-b78642f8c85a"/> + <textElement textAlignment="Center" markup="none"/> + <textFieldExpression><![CDATA[$R{label.qtdPassagens}]]></textFieldExpression> + </textField> + </band> + </groupHeader> + <groupFooter> + <band height="31"> + <line> + <reportElement positionType="Float" x="0" y="1" width="802" height="1" uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8"/> + </line> + <textField> + <reportElement x="366" y="2" width="205" height="20" uuid="38a0f957-1b50-46f9-b79f-c631baf8937b"/> + <textElement textAlignment="Right"/> + <textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression> + </textField> + <textField pattern="¤ #,##0.00"> + <reportElement x="571" y="2" width="81" height="20" uuid="d23d67e8-93ae-46ca-8f51-b90574818302"/> + <textElement textAlignment="Right"/> + <textFieldExpression><![CDATA[$V{sumValor}]]></textFieldExpression> + </textField> + </band> + </groupFooter> + </group> + <background> + <band splitType="Stretch"/> + </background> + <title> + <band height="81" 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="1" 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="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/utilitarios/RelatorioBaixasVendasInternetBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetBean.java index f62c9d546..dc259b2d0 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetBean.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetBean.java @@ -12,6 +12,7 @@ public class RelatorioBaixasVendasInternetBean { private BigDecimal valor; private Integer usuarioId; private String nombUsuario; + private BigDecimal valorPago; public Date getFecImpresion() { return fecImpresion; @@ -69,4 +70,14 @@ public class RelatorioBaixasVendasInternetBean { this.nombUsuario = nombUsuario; } + public BigDecimal getValorPago() { + return valorPago; + } + + public void setValorPago(BigDecimal precoPago) { + this.valorPago = precoPago; + } + + + } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetSinteticoBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetSinteticoBean.java new file mode 100644 index 000000000..c05d9b787 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioBaixasVendasInternetSinteticoBean.java @@ -0,0 +1,44 @@ +package com.rjconsultores.ventaboletos.relatorios.utilitarios; + +import java.math.BigDecimal; + +public class RelatorioBaixasVendasInternetSinteticoBean { + + private Integer puntoventaId; + private String nombPuntoventa; + private Integer qtdPassagens; + private BigDecimal valor; + private BigDecimal valorPago; + public Integer getPuntoventaId() { + return puntoventaId; + } + public void setPuntoventaId(Integer puntoventaId) { + this.puntoventaId = puntoventaId; + } + public String getNombPuntoventa() { + return nombPuntoventa; + } + public void setNombPuntoventa(String nombPuntoventa) { + this.nombPuntoventa = nombPuntoventa; + } + public Integer getQtdPassagens() { + return qtdPassagens; + } + public void setQtdPassagens(Integer qtdPassagens) { + this.qtdPassagens = qtdPassagens; + } + public BigDecimal getValor() { + return valor; + } + public void setValor(BigDecimal valor) { + this.valor = valor; + } + public BigDecimal getValorPago() { + return valorPago; + } + public void setValorPago(BigDecimal valorPago) { + this.valorPago = valorPago; + } + + +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java index 318671e4d..d06ff87ee 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioBaixasVendasInternetController.java @@ -14,6 +14,7 @@ import org.zkoss.zul.Datebox; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBaixasVendasInternet; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBaixasVendasInternetSintetico; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -31,15 +32,20 @@ public class RelatorioBaixasVendasInternetController extends MyGenericForwardCom private DataSource dataSourceRead; public void onClick$btnExecutarRelatorio(Event ev) throws Exception { - - PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue(); - RelatorioBaixasVendasInternet relatorio = new RelatorioBaixasVendasInternet(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue(), puntoVenta); - Map args = new HashMap(); - args.put("relatorio", relatorio); - - openWindow("/component/reportView.zul", - Labels.getLabel("indexController.mniRelatorioBaixasVendasInternet.label"), args, MODAL); + PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue(); + if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) { + RelatorioBaixasVendasInternet relatorio = new RelatorioBaixasVendasInternet(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue(), puntoVenta); + args.put("relatorio", relatorio); + openWindow("/component/reportView.zul", + Labels.getLabel("indexController.mniRelatorioBaixasVendasInternet.label"), args, MODAL); + } else { + // criar o relatorio sintetico com a outra consulta + RelatorioBaixasVendasInternetSintetico relatorio = new RelatorioBaixasVendasInternetSintetico(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue()); + args.put("relatorio", relatorio); + openWindow("/component/reportView.zul", + Labels.getLabel("indexController.mniRelatorioBaixasVendasInternetSintetico.label"), args, MODAL); + } } diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index e48fb6e2a..c5ef5582a 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -7685,3 +7685,11 @@ relatorioGratuidadeARTESPController.lbDataIni.value = Fecha Inicio relatorioGratuidadeARTESPController.lbDataFin.value = Fecha Final relatorioGratuidadeARTESPController.lbOrgao.value = Instituición concedente editarEmpresaController.usarAliasMapaViagemVenda.ajuda = En la pantalla de Venta o botón de Tarjeta de Viagem deve usar Alias para as Ubicaciones. + +indexController.mniRelatorioBaixasVendasInternet.label=Baixas Vendas Internet +relatorioBaixasVendasInternetController.window.title=Relatório de Baixas Vendas Internet +relatorioBaixasVendasInternetController.lbFecInicio.value=Data Início +relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim +relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda + +indexController.mniRelatorioBaixasVendasInternetSintetico.label=Baixas Vendas Internet Sintético diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 006b1e6bd..687169334 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -7928,6 +7928,8 @@ relatorioBaixasVendasInternetController.lbFecInicio.value=Data Início relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda +indexController.mniRelatorioBaixasVendasInternetSintetico.label=Baixas Vendas Internet Sintético + # Relatório CNAB indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400) relatorioRemessaCNAB.window.title = Remessa de Lote de Boletos Bancários