0010932: Espec03 - Relatório Baixa Vendas Internet

fixes bug#10932
dev:Daniel Zauli
qua:Wallysson

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@85303 d1611594-4594-4d17-8e1d-87c2c4800839
master
fabricio.oliveira 2018-09-12 20:53:13 +00:00
parent 1279d1f8d3
commit c447cce916
15 changed files with 472 additions and 64 deletions

View File

@ -17,7 +17,7 @@ import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
public class RelatorioBaixasVendasInternet extends Relatorio { public class RelatorioBaixasVendasInternet extends Relatorio {
private Date fecInicio; private Date fecInicio;
private Date fecFinal; private Date fecFinal;
private PuntoVenta puntoVenta; private PuntoVenta puntoVenta;
@ -33,22 +33,24 @@ public class RelatorioBaixasVendasInternet extends Relatorio {
protected void processaParametros() throws Exception { protected void processaParametros() throws Exception {
NamedParameterStatement namedParameterStatement = new NamedParameterStatement(getConexao(), getSql()); NamedParameterStatement namedParameterStatement = new NamedParameterStatement(getConexao(), getSql());
namedParameterStatement.setInt("puntoVentaId", puntoVenta.getPuntoventaId()); if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) {
this.parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa()); namedParameterStatement.setInt("puntoVentaId", puntoVenta.getPuntoventaId());
this.parametros.put("nombPuntoVenta", puntoVenta.getNombpuntoventa());
}
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
this.parametros.put("fecInicio", dateFormat.format(fecInicio)); this.parametros.put("fecInicio", dateFormat.format(fecInicio));
this.parametros.put("fecFinal", dateFormat.format(fecFinal)); this.parametros.put("fecFinal", dateFormat.format(fecFinal));
namedParameterStatement.setDate("fecInicio", new java.sql.Date(fecInicio.getTime())); namedParameterStatement.setDate("fecInicio", new java.sql.Date(fecInicio.getTime()));
namedParameterStatement.setDate("fecFinal", new java.sql.Date(fecFinal.getTime())); namedParameterStatement.setDate("fecFinal", new java.sql.Date(fecFinal.getTime()));
ResultSet resultSet = namedParameterStatement.executeQuery(); ResultSet resultSet = namedParameterStatement.executeQuery();
List<RelatorioBaixasVendasInternetBean> resultBean = transformResultSet(resultSet); List<RelatorioBaixasVendasInternetBean> resultBean = transformResultSet(resultSet);
setCollectionDataSource(new JRBeanCollectionDataSource(resultBean)); setCollectionDataSource(new JRBeanCollectionDataSource(resultBean));
} }
private List<RelatorioBaixasVendasInternetBean> transformResultSet(ResultSet resultSet) throws SQLException { private List<RelatorioBaixasVendasInternetBean> transformResultSet(ResultSet resultSet) throws SQLException {
List<RelatorioBaixasVendasInternetBean> resultBean = new ArrayList<RelatorioBaixasVendasInternetBean>(); List<RelatorioBaixasVendasInternetBean> resultBean = new ArrayList<RelatorioBaixasVendasInternetBean>();
while (resultSet.next()) { while (resultSet.next()) {
@ -60,27 +62,45 @@ public class RelatorioBaixasVendasInternet extends Relatorio {
bean.setValor(resultSet.getBigDecimal("VALOR")); bean.setValor(resultSet.getBigDecimal("VALOR"));
bean.setUsuarioId(resultSet.getInt("USUARIO_ID")); bean.setUsuarioId(resultSet.getInt("USUARIO_ID"));
bean.setNombUsuario(resultSet.getString("NOMBUSUARIO")); bean.setNombUsuario(resultSet.getString("NOMBUSUARIO"));
bean.setValorPago(resultSet.getBigDecimal("VALOR_PAGO"));
resultBean.add(bean); resultBean.add(bean);
} }
return resultBean; return resultBean;
} }
private String getSql() { private String getSql() {
String sql = "SELECT DISTINCT B.FECCREACION, B.NUMFOLIOSISTEMA, " String sql = "";
+ "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 " if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) {
+ "FROM BOLETO B " sql = "SELECT DISTINCT B.FECCREACION, B.NUMFOLIOSISTEMA, "
+ "JOIN PARADA O ON B.ORIGEN_ID = O.PARADA_ID " + "U.USUARIO_ID, U.NOMBUSUARIO, O.DESCPARADA ORIGEN, D.DESCPARADA DESTINO, "
+ "JOIN PARADA D ON B.DESTINO_ID = D.PARADA_ID " + "COALESCE(COALESCE(B.PRECIOPAGADO, 0) + COALESCE(B.IMPORTETAXAEMBARQUE, 0) + COALESCE(B.IMPORTESEGURO, 0) + COALESCE(B.IMPORTEPEDAGIO, 0) + COALESCE(B.IMPORTEOUTROS, 0), 0) AS VALOR, "
+ "JOIN USUARIO U ON B.USUARIO_ID = U.USUARIO_ID " + "B.PRECIOPAGADO as VALOR_PAGO "
+ "WHERE B.INDSTATUSBOLETO = 'E' " + "FROM BOLETO B "
+ "AND B.FECCREACION BETWEEN :fecInicio AND :fecFinal " + "JOIN PARADA O ON B.ORIGEN_ID = O.PARADA_ID "
+ "AND PUNTOVENTA_ID = :puntoVentaId " + "JOIN PARADA D ON B.DESTINO_ID = D.PARADA_ID "
+ "ORDER BY U.USUARIO_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; return sql;
} }
} }

View File

@ -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<String, Object>(), 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<RelatorioBaixasVendasInternetSinteticoBean> resultBean = transformResultSet(resultSet);
setCollectionDataSource(new JRBeanCollectionDataSource(resultBean));
}
private List<RelatorioBaixasVendasInternetSinteticoBean> transformResultSet(ResultSet resultSet) throws SQLException {
List<RelatorioBaixasVendasInternetSinteticoBean> resultBean = new ArrayList<RelatorioBaixasVendasInternetSinteticoBean>();
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;
}
}

View File

@ -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

View File

@ -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

View File

@ -19,4 +19,6 @@ label.numFolioSistema=N
label.origen=Origen label.origen=Origen
label.destino=Destino label.destino=Destino
label.valor=Valor del Folio label.valor=Valor del Folio
label.total=Total label.total=Total
label.valorPago=Precios
label.totalPassagens=Total Pasajes

View File

@ -19,4 +19,6 @@ label.numFolioSistema=N
label.origen=Origem label.origen=Origem
label.destino=Destino label.destino=Destino
label.valor=Valor da Passagem label.valor=Valor da Passagem
label.total=Total label.total=Total
label.valorPago=Valor Tarifa
label.totalPassagens=Total Passagens

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?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="RelatorioBaixasVendasInternet" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="84b9dfcf-8ec5-4f51-80cc-7339e3b158b4"> <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="RelatorioBaixasVendasInternet" 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="2.0"/> <property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/> <property name="ireport.x" value="0"/>
<property name="ireport.y" value="133"/> <property name="ireport.y" value="0"/>
<parameter name="fecInicio" class="java.lang.String"/> <parameter name="fecInicio" class="java.lang.String"/>
<parameter name="fecFinal" class="java.lang.String"/> <parameter name="fecFinal" class="java.lang.String"/>
<parameter name="noDataRelatorio" class="java.lang.String"/> <parameter name="noDataRelatorio" class="java.lang.String"/>
@ -18,63 +18,90 @@
<field name="valor" class="java.math.BigDecimal"/> <field name="valor" class="java.math.BigDecimal"/>
<field name="usuarioId" class="java.lang.Integer"/> <field name="usuarioId" class="java.lang.Integer"/>
<field name="nombUsuario" class="java.lang.String"/> <field name="nombUsuario" class="java.lang.String"/>
<field name="valorPago" class="java.math.BigDecimal"/>
<variable name="sumValor" class="java.math.BigDecimal" resetType="Group" resetGroup="group_usuario" calculation="Sum"> <variable name="sumValor" class="java.math.BigDecimal" resetType="Group" resetGroup="group_usuario" calculation="Sum">
<variableExpression><![CDATA[$F{valor}]]></variableExpression> <variableExpression><![CDATA[$F{valor}]]></variableExpression>
</variable> </variable>
<variable name="sumValorPago" class="java.math.BigDecimal" resetType="Group" resetGroup="group_usuario" calculation="Sum">
<variableExpression><![CDATA[$F{valorPago}]]></variableExpression>
</variable>
<variable name="countNumFolioSistema" class="java.lang.Integer" resetType="Group" resetGroup="group_usuario" calculation="Count">
<variableExpression><![CDATA[$F{numFolioSistema}]]></variableExpression>
</variable>
<group name="group_usuario"> <group name="group_usuario">
<groupExpression><![CDATA[$F{usuarioId}]]></groupExpression> <groupExpression><![CDATA[$F{usuarioId}]]></groupExpression>
<groupHeader> <groupHeader>
<band height="46"> <band height="46">
<line> <line>
<reportElement uuid="811af238-a027-48e9-bd6f-eee885474929" positionType="Float" x="0" y="43" width="802" height="1"/> <reportElement positionType="Float" x="0" y="43" width="802" height="1" uuid="811af238-a027-48e9-bd6f-eee885474929"/>
</line> </line>
<textField> <textField>
<reportElement uuid="5af379ca-85ae-4850-a804-75d512d7cc9d" x="0" y="22" width="160" height="20"/> <reportElement x="0" y="22" width="140" height="20" uuid="5af379ca-85ae-4850-a804-75d512d7cc9d"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.fecImpresion}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.fecImpresion}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="0349258f-e494-4dff-9ac7-f7d70aa0132c" x="160" y="22" width="160" height="20"/> <reportElement x="140" y="22" width="120" height="20" uuid="0349258f-e494-4dff-9ac7-f7d70aa0132c"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.numFolioSistema}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.numFolioSistema}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="3be61cdf-8be1-4b15-8252-482c2339bfad" x="354" y="22" width="140" height="20"/> <reportElement x="394" y="22" width="120" height="20" uuid="3be61cdf-8be1-4b15-8252-482c2339bfad"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.origen}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.origen}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="3c02742d-db27-4608-82c1-e6a842310574" x="498" y="22" width="140" height="20"/> <reportElement x="516" y="22" width="120" height="20" uuid="3c02742d-db27-4608-82c1-e6a842310574"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="2f0a3804-fefe-46fd-827d-e777bb23412b" x="642" y="22" width="160" height="20"/> <reportElement x="642" y="22" width="160" height="20" uuid="2f0a3804-fefe-46fd-827d-e777bb23412b"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="f3f4d85a-499f-4273-ac5f-e1e404f7a538" x="0" y="0" width="181" height="20"/> <reportElement x="0" y="0" width="181" height="20" uuid="f3f4d85a-499f-4273-ac5f-e1e404f7a538"/>
<textElement/>
<textFieldExpression><![CDATA[$R{cabecalho.usuario} + " " + $F{nombUsuario}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.usuario} + " " + $F{nombUsuario}]]></textFieldExpression>
</textField> </textField>
<textField>
<reportElement x="263" y="22" width="130" height="20" uuid="0a47fb6b-bf37-4e7d-9997-6c6549634ba8"/>
<textElement markup="none"/>
<textFieldExpression><![CDATA[$R{label.valorPago}]]></textFieldExpression>
</textField>
</band> </band>
</groupHeader> </groupHeader>
<groupFooter> <groupFooter>
<band height="31"> <band height="31">
<line> <line>
<reportElement uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8" positionType="Float" x="0" y="1" width="802" height="1"/> <reportElement positionType="Float" x="0" y="1" width="802" height="1" uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8"/>
</line> </line>
<textField> <textField>
<reportElement uuid="38a0f957-1b50-46f9-b79f-c631baf8937b" x="516" y="2" width="205" height="20"/> <reportElement x="516" y="2" width="205" height="20" uuid="38a0f957-1b50-46f9-b79f-c631baf8937b"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField> </textField>
<textField pattern="¤ #,##0.00"> <textField pattern="¤ #,##0.00">
<reportElement uuid="d23d67e8-93ae-46ca-8f51-b90574818302" x="721" y="2" width="81" height="20"/> <reportElement x="721" y="2" width="81" height="20" uuid="d23d67e8-93ae-46ca-8f51-b90574818302"/>
<textElement textAlignment="Right"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{sumValor}]]></textFieldExpression> <textFieldExpression><![CDATA[$V{sumValor}]]></textFieldExpression>
</textField> </textField>
<textField pattern="¤ #,##0.00">
<reportElement x="303" y="1" width="90" height="20" uuid="e685bff4-43e0-4123-b19c-b7ba79c24cd6"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{sumValorPago}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="263" y="2" width="56" height="20" uuid="27c59497-a812-4144-9b4b-f2398ec66249"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="141" y="3" width="40" height="20" uuid="dfea6e64-a65b-4ce5-8b1c-7810f15c3199"/>
<textElement textAlignment="Center" verticalAlignment="Top"/>
<textFieldExpression><![CDATA[$V{countNumFolioSistema}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1" y="3" width="140" height="20" uuid="a4244669-425f-4594-bc61-e45065e77127"/>
<textElement textAlignment="Right" verticalAlignment="Top"/>
<textFieldExpression><![CDATA[$R{label.totalPassagens}]]></textFieldExpression>
</textField>
</band> </band>
</groupFooter> </groupFooter>
</group> </group>
@ -84,29 +111,28 @@
<title> <title>
<band height="81" splitType="Stretch"> <band height="81" splitType="Stretch">
<textField> <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"> <textElement markup="none">
<font size="14" isBold="true"/> <font size="14" isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.nome}]]></textFieldExpression>
</textField> </textField>
<textField pattern="dd/MM/yyyy HH:mm"> <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"> <textElement textAlignment="Right">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField> </textField>
<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> <textElement>
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="a91f6081-4740-4e36-8965-41b6cde4cc20" x="0" y="41" width="263" height="20"/> <reportElement x="0" y="41" width="263" height="20" uuid="a91f6081-4740-4e36-8965-41b6cde4cc20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.nombPuntoVenta} + ": " + $P{nombPuntoVenta}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{label.nombPuntoVenta} + ": " + $P{nombPuntoVenta}]]></textFieldExpression>
</textField> </textField>
</band> </band>
@ -114,7 +140,7 @@
<pageHeader> <pageHeader>
<band height="21" splitType="Stretch"> <band height="21" splitType="Stretch">
<textField> <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"> <textElement textAlignment="Right">
<font isBold="true"/> <font isBold="true"/>
</textElement> </textElement>
@ -125,30 +151,30 @@
<detail> <detail>
<band height="20" splitType="Stretch"> <band height="20" splitType="Stretch">
<textField> <textField>
<reportElement uuid="c6e24c5c-058d-4eab-8ceb-2ab9bd155da1" x="0" y="0" width="160" height="20"/> <reportElement x="0" y="0" width="140" height="20" uuid="c6e24c5c-058d-4eab-8ceb-2ab9bd155da1"/>
<textElement/>
<textFieldExpression><![CDATA[$F{fecImpresion}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{fecImpresion}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="eb9db181-e228-40df-ada1-10098ca99bfe" x="160" y="0" width="160" height="20"/> <reportElement x="140" y="0" width="120" height="20" uuid="eb9db181-e228-40df-ada1-10098ca99bfe"/>
<textElement/>
<textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="cc3db7ec-afda-474d-8e7e-5fb1ba1d499e" x="354" y="0" width="140" height="20"/> <reportElement x="394" y="0" width="120" height="20" uuid="cc3db7ec-afda-474d-8e7e-5fb1ba1d499e"/>
<textElement/>
<textFieldExpression><![CDATA[$F{origen}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{origen}]]></textFieldExpression>
</textField> </textField>
<textField> <textField>
<reportElement uuid="1d2ad720-6a25-43fa-9e41-9a9b6436c036" x="498" y="0" width="140" height="20"/> <reportElement x="516" y="0" width="120" height="20" uuid="1d2ad720-6a25-43fa-9e41-9a9b6436c036"/>
<textElement/>
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
</textField> </textField>
<textField pattern="¤ #,##0.00"> <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"/> <textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression> <textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
</textField> </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> </band>
</detail> </detail>
<pageFooter> <pageFooter>
@ -157,7 +183,7 @@
<noData> <noData>
<band height="24"> <band height="24">
<textField isBlankWhenNull="true"> <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"/> <textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression> <textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField> </textField>

View File

@ -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>
</title>
<pageHeader>
<band height="21" splitType="Stretch">
<textField>
<reportElement x="607" y="0" width="195" height="20" uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec"/>
<textElement textAlignment="Right">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER}+ " " + $R{cabecalho.de} + " " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="98" height="20" uuid="c6e24c5c-058d-4eab-8ceb-2ab9bd155da1"/>
<textFieldExpression><![CDATA[$F{puntoventaId}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="98" y="0" width="135" height="20" uuid="eb9db181-e228-40df-ada1-10098ca99bfe"/>
<textFieldExpression><![CDATA[$F{nombPuntoventa}]]></textFieldExpression>
</textField>
<textField pattern="¤ #,##0.00">
<reportElement x="492" 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="381" y="0" width="130" height="20" uuid="9ee0da34-ddc9-4698-829a-4ea072b659a2"/>
<textFieldExpression><![CDATA[$F{valorPago}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="233" y="0" width="127" height="20" uuid="6c23f4d8-d398-4bc9-a588-4e514953396b"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{qtdPassagens}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<noData>
<band height="24">
<textField isBlankWhenNull="true">
<reportElement positionType="Float" x="0" y="0" width="555" height="20" isPrintWhenDetailOverflows="true" uuid="d7df66c6-4dc0-4f3b-88f4-b22094d29091"/>
<textElement verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
</textField>
</band>
</noData>
</jasperReport>

View File

@ -12,6 +12,7 @@ public class RelatorioBaixasVendasInternetBean {
private BigDecimal valor; private BigDecimal valor;
private Integer usuarioId; private Integer usuarioId;
private String nombUsuario; private String nombUsuario;
private BigDecimal valorPago;
public Date getFecImpresion() { public Date getFecImpresion() {
return fecImpresion; return fecImpresion;
@ -69,4 +70,14 @@ public class RelatorioBaixasVendasInternetBean {
this.nombUsuario = nombUsuario; this.nombUsuario = nombUsuario;
} }
public BigDecimal getValorPago() {
return valorPago;
}
public void setValorPago(BigDecimal precoPago) {
this.valorPago = precoPago;
}
} }

View File

@ -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;
}
}

View File

@ -14,6 +14,7 @@ import org.zkoss.zul.Datebox;
import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioBaixasVendasInternet; 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.MyComboboxPuntoVenta;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
@ -31,15 +32,20 @@ public class RelatorioBaixasVendasInternetController extends MyGenericForwardCom
private DataSource dataSourceRead; private DataSource dataSourceRead;
public void onClick$btnExecutarRelatorio(Event ev) throws Exception { 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<String, Object> args = new HashMap<String, Object>(); Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio); PuntoVenta puntoVenta = (PuntoVenta) cmbPuntoVenta.getSelectedItem().getValue();
if (puntoVenta != null && puntoVenta.getPuntoventaId() != null && puntoVenta.getPuntoventaId() != -1) {
openWindow("/component/reportView.zul", RelatorioBaixasVendasInternet relatorio = new RelatorioBaixasVendasInternet(dataSourceRead.getConnection(), fecInicio.getValue(), fecFinal.getValue(), puntoVenta);
Labels.getLabel("indexController.mniRelatorioBaixasVendasInternet.label"), args, MODAL); 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);
}
} }

View File

@ -7685,3 +7685,11 @@ relatorioGratuidadeARTESPController.lbDataIni.value = Fecha Inicio
relatorioGratuidadeARTESPController.lbDataFin.value = Fecha Final relatorioGratuidadeARTESPController.lbDataFin.value = Fecha Final
relatorioGratuidadeARTESPController.lbOrgao.value = Instituición concedente 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. 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

View File

@ -7928,6 +7928,8 @@ relatorioBaixasVendasInternetController.lbFecInicio.value=Data Início
relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim relatorioBaixasVendasInternetController.lbFecFinal.value=Data Fim
relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda relatorioBaixasVendasInternetController.lbPuntoVenta.value=Ponto de Venda
indexController.mniRelatorioBaixasVendasInternetSintetico.label=Baixas Vendas Internet Sintético
# Relatório CNAB # Relatório CNAB
indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400) indexController.mniRelatorioRemessaCNAB.label = Remessa de Lote (CNAB 400)
relatorioRemessaCNAB.window.title = Remessa de Lote de Boletos Bancários relatorioRemessaCNAB.window.title = Remessa de Lote de Boletos Bancários