fixes bug#8750
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@67341 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
b12fbe3f56
commit
b912535028
|
@ -0,0 +1,120 @@
|
||||||
|
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 org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Estacion;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioVendasPercursoBean;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||||
|
|
||||||
|
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
||||||
|
|
||||||
|
public class RelatorioVendasPercurso extends Relatorio {
|
||||||
|
|
||||||
|
private List<PuntoVenta> lsPuntoVenta;
|
||||||
|
private Date fecInicio;
|
||||||
|
private Date fecFinal;
|
||||||
|
private Estacion estacion;
|
||||||
|
private Integer corridaId;
|
||||||
|
|
||||||
|
public RelatorioVendasPercurso(Connection conexao, List<PuntoVenta> lsPuntoVenta, Date fecInicio, Date fecFinal, Estacion estacion, Integer corridaId) {
|
||||||
|
super(new HashMap<String, Object>(), conexao);
|
||||||
|
this.lsPuntoVenta = lsPuntoVenta;
|
||||||
|
this.fecInicio = fecInicio;
|
||||||
|
this.fecFinal = fecFinal;
|
||||||
|
this.estacion = estacion;
|
||||||
|
this.corridaId = corridaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void processaParametros() throws Exception {
|
||||||
|
|
||||||
|
NamedParameterStatement namedParameterStatement = new NamedParameterStatement(getConexao(), getSql());
|
||||||
|
|
||||||
|
List<Integer> lsPuntoVentaId = new ArrayList<Integer>();
|
||||||
|
List<String> lsNombPuntoVenta = new ArrayList<String>();
|
||||||
|
for (PuntoVenta puntoVenta : lsPuntoVenta) {
|
||||||
|
lsPuntoVentaId.add(puntoVenta.getPuntoventaId());
|
||||||
|
lsNombPuntoVenta.add(puntoVenta.getNombpuntoventa());
|
||||||
|
}
|
||||||
|
namedParameterStatement.setString("lsPuntoVentaId", StringUtils.join(lsPuntoVentaId.toArray(), ','));
|
||||||
|
this.parametros.put("lsNombPuntoVenta", StringUtils.join(lsNombPuntoVenta.toArray(new String[0]), ", "));
|
||||||
|
|
||||||
|
namedParameterStatement.setInt("estacionId", estacion.getEstacionId());
|
||||||
|
this.parametros.put("estacion", estacion.toString());
|
||||||
|
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
|
||||||
|
if (fecInicio != null) {
|
||||||
|
namedParameterStatement.setDate("fecInicio", new java.sql.Date(fecInicio.getTime()));
|
||||||
|
this.parametros.put("fecInicio", dateFormat.format(fecInicio));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fecFinal != null) {
|
||||||
|
namedParameterStatement.setDate("fecFinal", new java.sql.Date(fecFinal.getTime()));
|
||||||
|
this.parametros.put("fecFinal", dateFormat.format(fecFinal));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (corridaId != null) {
|
||||||
|
namedParameterStatement.setString("corridaId", "%" + corridaId + "%");
|
||||||
|
}
|
||||||
|
|
||||||
|
ResultSet resultSet = namedParameterStatement.executeQuery();
|
||||||
|
List<RelatorioVendasPercursoBean> resultBean = transformResultSet(resultSet);
|
||||||
|
setCollectionDataSource(new JRBeanCollectionDataSource(resultBean));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<RelatorioVendasPercursoBean> transformResultSet(ResultSet resultSet) throws SQLException {
|
||||||
|
List<RelatorioVendasPercursoBean> resultBean = new ArrayList<RelatorioVendasPercursoBean>();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
RelatorioVendasPercursoBean bean = new RelatorioVendasPercursoBean();
|
||||||
|
bean.setCorridaId(resultSet.getInt("CORRIDA_ID"));
|
||||||
|
bean.setNumFolioSistema(resultSet.getString("NUMFOLIOSISTEMA"));
|
||||||
|
bean.setOrigen(resultSet.getString("ORIGEN"));
|
||||||
|
bean.setDestino(resultSet.getString("DESTINO"));
|
||||||
|
bean.setValor(resultSet.getBigDecimal("VALOR"));
|
||||||
|
resultBean.add(bean);
|
||||||
|
}
|
||||||
|
return resultBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSql() {
|
||||||
|
|
||||||
|
StringBuilder sql = new StringBuilder("SELECT C.CORRIDA_ID, C.NUMFOLIOSISTEMA, O.DESCPARADA ORIGEN, D.DESCPARADA DESTINO, "
|
||||||
|
+ "(C.PRECIOPAGADO + C.IMPORTETAXAEMBARQUE + C.IMPORTESEGURO + C.IMPORTEPEDAGIO + C.IMPORTEOUTROS) AS VALOR "
|
||||||
|
+ "FROM CAJA C "
|
||||||
|
+ "JOIN PARADA O ON C.ORIGEN_ID = O.PARADA_ID "
|
||||||
|
+ "JOIN PARADA D ON C.DESTINO_ID = D.PARADA_Id "
|
||||||
|
+ "WHERE "
|
||||||
|
+ "USUARIOREMOTO_ID IS NOT NULL "
|
||||||
|
+ "AND INDREMOTOINVERSO = 1 "
|
||||||
|
+ "AND C.PUNTOVENTA_ID IN(:lsPuntoVentaId) "
|
||||||
|
+ "AND C.ESTACION_ID = :estacionId ");
|
||||||
|
|
||||||
|
if (fecInicio != null) {
|
||||||
|
sql.append("AND C.FECHORVENTA >= :fecInicio ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fecFinal != null) {
|
||||||
|
sql.append("AND C.FECHORVENTA <= :fecFinal ");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (corridaId != null) {
|
||||||
|
sql.append("AND C.CORRIDA_ID LIKE :corridaId ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return sql.toString();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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.puntoVenta=Punto de Venda
|
||||||
|
label.estacion=Estacion
|
||||||
|
|
||||||
|
label.numCorrida=Número da Corrida
|
||||||
|
label.numFolio=Número da Passagem Digitada
|
||||||
|
label.origen=Origem
|
||||||
|
label.destino=Destino
|
||||||
|
label.valor=Valor da Passagem
|
||||||
|
label.total=Total
|
|
@ -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 de Vendas no Percurso
|
||||||
|
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.puntoVenta=Ponto de Venda
|
||||||
|
label.estacion=Estação
|
||||||
|
|
||||||
|
label.numCorrida=Número da Corrida
|
||||||
|
label.numFolio=Número da Passagem Digitada
|
||||||
|
label.origen=Origem
|
||||||
|
label.destino=Destino
|
||||||
|
label.valor=Valor da Passagem
|
||||||
|
label.total=Total
|
Binary file not shown.
|
@ -0,0 +1,188 @@
|
||||||
|
<?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="RelatorioVendasPercurso" 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="9"/>
|
||||||
|
<property name="ireport.y" value="21"/>
|
||||||
|
<parameter name="fecInicio" class="java.lang.String"/>
|
||||||
|
<parameter name="fecFinal" class="java.lang.String"/>
|
||||||
|
<parameter name="estacion" class="java.lang.String"/>
|
||||||
|
<parameter name="lsNombPuntoVenta" class="java.lang.String"/>
|
||||||
|
<queryString>
|
||||||
|
<![CDATA[]]>
|
||||||
|
</queryString>
|
||||||
|
<field name="corridaId" class="java.lang.Integer"/>
|
||||||
|
<field name="numFolioSistema" class="java.lang.String"/>
|
||||||
|
<field name="origen" class="java.lang.String"/>
|
||||||
|
<field name="destino" class="java.lang.String"/>
|
||||||
|
<field name="valor" class="java.math.BigDecimal"/>
|
||||||
|
<variable name="sumValor" class="java.math.BigDecimal" calculation="Sum">
|
||||||
|
<variableExpression><![CDATA[$F{valor}]]></variableExpression>
|
||||||
|
</variable>
|
||||||
|
<background>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</background>
|
||||||
|
<title>
|
||||||
|
<band height="97" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="43b2c28d-4760-4890-b00d-25e931e79c74" x="0" y="0" width="620" height="20"/>
|
||||||
|
<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"/>
|
||||||
|
<textElement textAlignment="Right">
|
||||||
|
<font isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="96d6ce56-5bf3-460a-b3ba-a81890a2caed" x="0" y="42" width="104" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.puntoVenta}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="35e8e5cd-52e2-4f14-bbd7-e3a2233ad637" x="104" y="62" width="139" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$P{estacion}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="b75cac86-9c93-40ec-b667-afd66f26103d" x="104" y="42" width="139" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$P{lsNombPuntoVenta}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="4f5a4fd1-5164-4865-8b05-73fe7a5b64e1" x="0" y="62" width="104" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.estacion}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="aef7159d-4131-49d3-85dd-75f63f92c5af" x="0" y="22" width="104" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{cabecalho.periodo}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="62f02d34-2844-48b6-bb97-274de2247bd6" x="104" y="22" width="56" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$P{fecInicio}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="e2bf6ff8-8d8e-4bab-bc3d-e1e690d707a0" x="181" y="22" width="56" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$P{fecFinal}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="6a9e5919-6b5b-430a-88a6-856957e20dea" x="160" y="22" width="21" height="20"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{cabecalho.periodoA}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</title>
|
||||||
|
<pageHeader>
|
||||||
|
<band height="21" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="6a8a0843-7236-40a3-98ae-5fbf59b4cfec" x="607" y="0" width="195" height="20"/>
|
||||||
|
<textElement textAlignment="Right">
|
||||||
|
<font isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$R{cabecalho.pagina} + " " + $V{PAGE_NUMBER}+ " " + $R{cabecalho.de} + " " + $V{PAGE_NUMBER}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</pageHeader>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="23" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="a3dea313-f2a7-4388-bd91-5c02e8612b8e" x="0" y="0" width="160" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.numCorrida}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<line>
|
||||||
|
<reportElement uuid="811af238-a027-48e9-bd6f-eee885474929" positionType="Float" x="0" y="21" width="802" height="1"/>
|
||||||
|
</line>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="a7ca2540-97de-4ec5-a2fe-234a004c5ab9" x="160" y="0" width="160" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.numFolio}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="e5daa47c-a71c-42ca-9d6f-101ae1375b47" x="642" y="0" width="160" height="20"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="4a2760f3-4cff-4bbb-ba28-600b516af474" x="382" y="0" width="130" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.origen}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="2d00e354-68ea-4d46-94a3-28c9fef225e0" x="512" y="0" width="130" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.destino}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="22" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="cfe5a284-65a4-427b-acde-8c6f8297e5d1" x="0" y="0" width="160" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$F{corridaId}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="c1389933-83ab-4e81-a0a4-20a081751b5e" x="160" y="0" width="160" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$F{numFolioSistema}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField pattern="¤ #,##0.00">
|
||||||
|
<reportElement uuid="41c9db9f-0dea-4369-a2e7-357a7898b86d" x="642" y="0" width="160" height="20"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{valor}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="0605d60f-eef2-4bab-9f86-b9599ed8f5e7" x="382" y="0" width="130" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$F{origen}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="2063095d-148c-4d6b-8d8f-04f712bbcedc" x="512" y="0" width="130" height="20"/>
|
||||||
|
<textElement/>
|
||||||
|
<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<columnFooter>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</columnFooter>
|
||||||
|
<pageFooter>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</pageFooter>
|
||||||
|
<summary>
|
||||||
|
<band height="26" splitType="Stretch">
|
||||||
|
<line>
|
||||||
|
<reportElement uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8" positionType="Float" x="0" y="2" width="802" height="1"/>
|
||||||
|
</line>
|
||||||
|
<textField>
|
||||||
|
<reportElement uuid="38a0f957-1b50-46f9-b79f-c631baf8937b" x="104" y="5" width="615" height="20"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
|
||||||
|
<reportElement uuid="f22b1a6f-2e0b-4771-acf3-b7460874f730" stretchType="RelativeToTallestObject" x="721" y="5" width="80" height="20" isPrintWhenDetailOverflows="true"/>
|
||||||
|
<textElement textAlignment="Right">
|
||||||
|
<font isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$V{sumValor}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</summary>
|
||||||
|
<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"/>
|
||||||
|
<textElement verticalAlignment="Middle"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</noData>
|
||||||
|
</jasperReport>
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class RelatorioVendasPercursoBean {
|
||||||
|
|
||||||
|
private Integer corridaId;
|
||||||
|
private String numFolioSistema;
|
||||||
|
private String origen;
|
||||||
|
private String destino;
|
||||||
|
private BigDecimal valor;
|
||||||
|
|
||||||
|
public Integer getCorridaId() {
|
||||||
|
return corridaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorridaId(Integer corridaId) {
|
||||||
|
this.corridaId = corridaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNumFolioSistema() {
|
||||||
|
return numFolioSistema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNumFolioSistema(String numfoliosistema) {
|
||||||
|
this.numFolioSistema = numfoliosistema;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrigen() {
|
||||||
|
return origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigen(String origen) {
|
||||||
|
this.origen = origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(String destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getValor() {
|
||||||
|
return valor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValor(BigDecimal valor) {
|
||||||
|
this.valor = valor;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,136 @@
|
||||||
|
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
|
|
||||||
|
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.zhtml.Messagebox;
|
||||||
|
import org.zkoss.zk.ui.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
|
import org.zkoss.zkplus.databind.BindingListModelList;
|
||||||
|
import org.zkoss.zul.Combobox;
|
||||||
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Intbox;
|
||||||
|
import org.zkoss.zul.Paging;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Estacion;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioVendasPercurso;
|
||||||
|
import com.rjconsultores.ventaboletos.service.EstacionService;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyTextbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
|
|
||||||
|
@Controller("relatorioVendasPercursoController")
|
||||||
|
@Scope("prototype")
|
||||||
|
public class RelatorioVendasPercursoController extends MyGenericForwardComposer {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 143203038399530349L;
|
||||||
|
|
||||||
|
private MyTextbox txtNombrePuntoVenta;
|
||||||
|
private Paging pagingPuntoVenta;
|
||||||
|
private MyListbox puntoVentaList;
|
||||||
|
private MyListbox puntoVentaSelList;
|
||||||
|
|
||||||
|
private Datebox fecInicio;
|
||||||
|
private Datebox fecFinal;
|
||||||
|
|
||||||
|
private Combobox cmbEstacion;
|
||||||
|
private List<Estacion> lsEstacion;
|
||||||
|
|
||||||
|
private Intbox txtIdCorrida;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource dataSourceRead;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EstacionService estacionService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
|
lsEstacion = new ArrayList<Estacion>();
|
||||||
|
super.doAfterCompose(comp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||||
|
|
||||||
|
Estacion estacion = (Estacion) cmbEstacion.getSelectedItem().getValue();
|
||||||
|
List<PuntoVenta> lsPuntoVenta = (List<PuntoVenta>) (Object) puntoVentaSelList.getListData();
|
||||||
|
Integer corridaId = txtIdCorrida.getValue();
|
||||||
|
|
||||||
|
RelatorioVendasPercurso relatorio = new RelatorioVendasPercurso(dataSourceRead.getConnection(), lsPuntoVenta, fecInicio.getValue(), fecFinal.getValue(), estacion, corridaId);
|
||||||
|
|
||||||
|
Map<String, Object> args = new HashMap<String, Object>();
|
||||||
|
args.put("relatorio", relatorio);
|
||||||
|
|
||||||
|
openWindow("/component/reportView.zul",
|
||||||
|
Labels.getLabel("indexController.mniRelatorioVendasComissao.label"), args, MODAL);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisa(Event ev) {
|
||||||
|
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
|
||||||
|
new HibernateSearchObject<PuntoVenta>(PuntoVenta.class, pagingPuntoVenta.getPageSize());
|
||||||
|
|
||||||
|
puntoVentaBusqueda.addFilterILike("nombpuntoventa", "%" + txtNombrePuntoVenta.getValue() + "%");
|
||||||
|
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
puntoVentaBusqueda.addSortAsc("nombpuntoventa");
|
||||||
|
|
||||||
|
puntoVentaBusqueda.addFilterEqual("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
plwPuntoVenta.init(puntoVentaBusqueda, puntoVentaList, pagingPuntoVenta);
|
||||||
|
|
||||||
|
if (puntoVentaList.getData().length == 0) {
|
||||||
|
try {
|
||||||
|
Messagebox.show(Labels.getLabel("MSG.ningunRegistro"),
|
||||||
|
Labels.getLabel("relatorioVendasPercursoController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnLimpar(Event ev) {
|
||||||
|
puntoVentaList.setData(new ArrayList<PuntoVenta>());
|
||||||
|
txtNombrePuntoVenta.setText("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$puntoVentaSelList(Event ev) {
|
||||||
|
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaSelList.getSelected();
|
||||||
|
puntoVentaSelList.removeItem(puntoVenta);
|
||||||
|
updateLsEstacion();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$puntoVentaList(Event ev) {
|
||||||
|
PuntoVenta puntoVenta = (PuntoVenta) puntoVentaList.getSelected();
|
||||||
|
puntoVentaSelList.addItemNovo(puntoVenta);
|
||||||
|
updateLsEstacion();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void updateLsEstacion() {
|
||||||
|
lsEstacion = estacionService.buscarEstaciones(puntoVentaSelList.getListData());
|
||||||
|
cmbEstacion.setSelectedIndex(-1);
|
||||||
|
cmbEstacion.setModel(new BindingListModelList(lsEstacion, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Estacion> getLsEstacion() {
|
||||||
|
return lsEstacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
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 ItemMenuRelatorioVendasPercurso extends DefaultItemMenuSistema {
|
||||||
|
|
||||||
|
public ItemMenuRelatorioVendasPercurso() {
|
||||||
|
super("indexController.mniRelatorioVendasPercurso.label");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getClaveMenu() {
|
||||||
|
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOVENDASPERCURSO";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ejecutar() {
|
||||||
|
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioVendasPercurso.zul",
|
||||||
|
Labels.getLabel("relatorioVendasPercursoController.window.title"), getArgs(), desktop);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -6939,4 +6939,22 @@ auditoriaController.nombmaterno.label = Sobrenome Materno
|
||||||
auditoriaController.perfil.label = Perfil
|
auditoriaController.perfil.label = Perfil
|
||||||
auditoriaController.btnPesquisa.label = Pesquisa
|
auditoriaController.btnPesquisa.label = Pesquisa
|
||||||
auditoriaController.empresa.label = Empresa
|
auditoriaController.empresa.label = Empresa
|
||||||
auditoriaController.puntoventa.label = Ponto de Venda(Agência)
|
auditoriaController.puntoventa.label = Ponto de Venda(Agência)
|
||||||
|
|
||||||
|
indexController.mniRelatorioVendasPercurso.label=Vendas no Percurso
|
||||||
|
relatorioVendasPercursoController.window.title=Relatório de Vendas no Percurso
|
||||||
|
relatorioVendasPercursoController.lbPuntoVenta.value=Punto de Venta
|
||||||
|
relatorioVendasPercursoController.btnPesquisa.label=Búsqueda
|
||||||
|
relatorioVendasPercursoController.btnLimpar.label=Limpiar
|
||||||
|
relatorioVendasPercursoController.lbEmpresa.value=Empresa
|
||||||
|
relatorioVendasPercursoController.lbNumero.value=Numero punto de venta
|
||||||
|
relatorioVendasPercursoController.dataInicial.value=Fecha Inicial
|
||||||
|
relatorioVendasPercursoController.dataFinal.value=Fecha Final
|
||||||
|
relatorioVendasPercursoController.estacion.label=Estación
|
||||||
|
relatorioVendasPercursoController.corridaId.label=Servicio
|
||||||
|
|
||||||
|
indexController.mniRelatorioBaixasVendasInternet.label=Baixas Vendas Internet
|
||||||
|
relatorioBaixasVendasInternetControllerr.window.title=Relatório de Baixas Vendas Internet
|
||||||
|
relatorioBaixasVendasInternetController.lbFecInicio.value=Fecha Início
|
||||||
|
relatorioBaixasVendasInternetController.lbFecFinal.value=Fecha Final
|
||||||
|
relatorioBaixasVendasInternetController.lbPuntoVenta.value=Punto Venta
|
|
@ -7112,4 +7112,22 @@ auditoriaController.nombpaterno.label = Sobrenome Paterno
|
||||||
auditoriaController.nombmaterno.label = Sobrenome Materno
|
auditoriaController.nombmaterno.label = Sobrenome Materno
|
||||||
auditoriaController.btnPesquisa.label = Pesquisa
|
auditoriaController.btnPesquisa.label = Pesquisa
|
||||||
auditoriaController.empresa.label = Empresa
|
auditoriaController.empresa.label = Empresa
|
||||||
auditoriaController.puntoventa.label = Ponto de Venda(Agência)
|
auditoriaController.puntoventa.label = Ponto de Venda(Agência)
|
||||||
|
|
||||||
|
indexController.mniRelatorioVendasPercurso.label=Vendas no Percurso
|
||||||
|
relatorioVendasPercursoController.window.title=Relatório de Vendas no Percurso
|
||||||
|
relatorioVendasPercursoController.lbPuntoVenta.value=Ponto de Venda
|
||||||
|
relatorioVendasPercursoController.btnPesquisa.label=Pesquisa
|
||||||
|
relatorioVendasPercursoController.btnLimpar.label=Limpar
|
||||||
|
relatorioVendasPercursoController.lbEmpresa.value=Empresa
|
||||||
|
relatorioVendasPercursoController.lbNumero.value=Número Ponto de Venda
|
||||||
|
relatorioVendasPercursoController.dataInicial.value=Data Inicial
|
||||||
|
relatorioVendasPercursoController.dataFinal.value=Data Final
|
||||||
|
relatorioVendasPercursoController.estacion.label=Estação
|
||||||
|
relatorioVendasPercursoController.corridaId.label=Serviço
|
||||||
|
|
||||||
|
indexController.mniRelatorioBaixasVendasInternet.label=Baixas Vendas Internet
|
||||||
|
relatorioBaixasVendasInternetControllerr.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
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<?page contentType="text/html;charset=UTF-8"?>
|
||||||
|
<?variable-resolver class="org.zkoss.zkplus.spring.DelegatingVariableResolver"?>
|
||||||
|
<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="winFiltroRelatorioVendasPercurso"?>
|
||||||
|
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
|
||||||
|
|
||||||
|
<zk xmlns="http://www.zkoss.org/2005/zul">
|
||||||
|
<window id="winFiltroRelatorioVendasPercurso"
|
||||||
|
apply="${relatorioVendasPercursoController}"
|
||||||
|
contentStyle="overflow:auto" height="300px" width="550px"
|
||||||
|
border="normal" closable="true">
|
||||||
|
<grid fixedLayout="true">
|
||||||
|
<columns>
|
||||||
|
<column width="25%" />
|
||||||
|
<column width="30%" />
|
||||||
|
<column width="15%" />
|
||||||
|
<column width="30%" />
|
||||||
|
</columns>
|
||||||
|
<rows>
|
||||||
|
<row spans="1,3">
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioVendasPercursoController.lbPuntoVenta.value')}"/>
|
||||||
|
<bandbox id="bbPesquisaPuntoVenta" width="100%"
|
||||||
|
mold="rounded" readonly="true">
|
||||||
|
<bandpopup>
|
||||||
|
<vbox>
|
||||||
|
<hbox>
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioVendasPercursoController.lbPuntoVenta.value')}" />
|
||||||
|
<textbox id="txtNombrePuntoVenta"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyTextbox"
|
||||||
|
width="300px" mold="rounded" />
|
||||||
|
<button id="btnPesquisa"
|
||||||
|
image="/gui/img/find.png"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.btnPesquisa.label')}" />
|
||||||
|
<button id="btnLimpar"
|
||||||
|
image="/gui/img/eraser.png"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.btnLimpar.label')}" />
|
||||||
|
</hbox>
|
||||||
|
<paging id="pagingPuntoVenta" pageSize="10" />
|
||||||
|
<listbox id="puntoVentaList"
|
||||||
|
mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100%" width="700px">
|
||||||
|
<listhead>
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbPuntoVenta.value')}" />
|
||||||
|
<listheader width="35%"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbEmpresa.value')}" />
|
||||||
|
<listheader width="20%"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbNumero.value')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
</vbox>
|
||||||
|
</bandpopup>
|
||||||
|
</bandbox>
|
||||||
|
</row>
|
||||||
|
<row spans="4">
|
||||||
|
<listbox id="puntoVentaSelList" mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" height="100px" width="100%">
|
||||||
|
<listhead>
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbPuntoVenta.value')}" />
|
||||||
|
<listheader width="35%"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbEmpresa.value')}" />
|
||||||
|
<listheader width="20%"
|
||||||
|
label="${c:l('relatorioVendasPercursoController.lbNumero.value')}" />
|
||||||
|
<listheader width="8%" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
<paging id="pagingSelPuntoVenta" pageSize="10" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioVendasPercursoController.dataInicial.value')}" />
|
||||||
|
<datebox id="fecInicio" format="dd/MM/yyyy"
|
||||||
|
width="90%" maxlength="10" />
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioVendasPercursoController.dataFinal.value')}" />
|
||||||
|
<datebox id="fecFinal" format="dd/MM/yyyy"
|
||||||
|
width="90%" maxlength="10" />
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<label
|
||||||
|
value="${c:l('relatorioVendasPercursoController.estacion.label')}" />
|
||||||
|
<combobox id="cmbEstacion" constraint="no empty"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
|
width="70%" mold="rounded" buttonVisible="true"
|
||||||
|
model="@{winFiltroRelatorioVendasPercurso$composer.lsEstacion}" />
|
||||||
|
<label value="${c:l('relatorioVendasPercursoController.corridaId.label')}"/>
|
||||||
|
<intbox id="txtIdCorrida" width="90%" maxlength="8" constraint="no empty" />
|
||||||
|
</row>
|
||||||
|
</rows>
|
||||||
|
</grid>
|
||||||
|
<toolbar>
|
||||||
|
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
|
||||||
|
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
|
||||||
|
</toolbar>
|
||||||
|
</window>
|
||||||
|
</zk>
|
||||||
|
|
Loading…
Reference in New Issue