fixes bug#8701
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@66263 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
0fd66238dd
commit
4bd97d8269
|
@ -0,0 +1,103 @@
|
||||||
|
package com.rjconsultores.ventaboletos.relatorios.impl;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioFinanceiroReceitasDespesasBean;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
|
||||||
|
|
||||||
|
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
||||||
|
|
||||||
|
public class RelatorioFinanceiroReceitasDespesas extends Relatorio {
|
||||||
|
|
||||||
|
private List<RelatorioFinanceiroReceitasDespesasBean> lsDadosRelatorio;
|
||||||
|
|
||||||
|
public RelatorioFinanceiroReceitasDespesas(Map<String, Object> parametros, Connection conexao) throws Exception {
|
||||||
|
|
||||||
|
super(parametros, conexao);
|
||||||
|
|
||||||
|
this.setCustomDataSource(new DataSource(this) {
|
||||||
|
@Override
|
||||||
|
public void initDados() throws Exception {
|
||||||
|
super.initDados();
|
||||||
|
lsDadosRelatorio = executeQuery();
|
||||||
|
setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private List<RelatorioFinanceiroReceitasDespesasBean> executeQuery() throws SQLException {
|
||||||
|
|
||||||
|
Date fecInicio = (Date) parametros.get("fecInicio");
|
||||||
|
Date fecFinal = (Date) parametros.get("fecFinal");
|
||||||
|
Empresa empresa = (Empresa) parametros.get("empresa");
|
||||||
|
List<PuntoVenta> lsPuntoVenta = (List<PuntoVenta>) parametros.get("lsPuntoVenta");
|
||||||
|
Integer indTipo = (Integer) parametros.get("indTipo");
|
||||||
|
|
||||||
|
String sql = getSql(indTipo, lsPuntoVenta);
|
||||||
|
|
||||||
|
NamedParameterStatement stmt = new NamedParameterStatement(this.getConexao(), sql);
|
||||||
|
stmt.setDate("fecInicio", new java.sql.Date(fecInicio.getTime()));
|
||||||
|
stmt.setDate("fecFinal", new java.sql.Date(fecFinal.getTime()));
|
||||||
|
stmt.setInt("empresaId", empresa.getEmpresaId());
|
||||||
|
|
||||||
|
ResultSet resultSet = stmt.executeQuery();
|
||||||
|
List<RelatorioFinanceiroReceitasDespesasBean> lsBean = new ArrayList<RelatorioFinanceiroReceitasDespesasBean>();
|
||||||
|
while (resultSet.next()) {
|
||||||
|
RelatorioFinanceiroReceitasDespesasBean bean = new RelatorioFinanceiroReceitasDespesasBean();
|
||||||
|
bean.setDescTipoEvento(resultSet.getString("DESCTIPOEVENTO"));
|
||||||
|
bean.setFecHorVta(resultSet.getDate("FECHORVTA"));
|
||||||
|
bean.setTipoEventoExtraId(resultSet.getInt("TIPOEVENTOEXTRA_ID"));
|
||||||
|
bean.setNombPuntoVenta(resultSet.getString("NOMBPUNTOVENTA"));
|
||||||
|
bean.setPrecio(resultSet.getBigDecimal("PRECIO"));
|
||||||
|
bean.setPuntoVentaId(resultSet.getInt("PUNTOVENTA_ID"));
|
||||||
|
lsBean.add(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
return lsBean;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSql(Integer indTipo, List<PuntoVenta> lsPuntoVenta) {
|
||||||
|
|
||||||
|
String sql = "SELECT C.FECHORVTA, P.PUNTOVENTA_ID, P.NOMBPUNTOVENTA, TE.INDTIPO, TE.TIPOEVENTOEXTRA_ID, TE.DESCTIPOEVENTO, C.PRECIO "
|
||||||
|
+ "FROM CAJA_DIVERSOS C "
|
||||||
|
+ "JOIN EVENTO_EXTRA E ON E.EVENTOEXTRA_ID = C.EVENTOEXTRA_ID "
|
||||||
|
+ "JOIN TIPO_EVENTO_EXTRA TE ON TE.TIPOEVENTOEXTRA_ID = E.TIPOEVENTOEXTRA_ID "
|
||||||
|
+ "JOIN PUNTO_VENTA P ON P.PUNTOVENTA_ID = C.PUNTOVENTA_ID "
|
||||||
|
+ "WHERE E.EMPRESA_ID = :empresaId "
|
||||||
|
+ "AND C.FECHORVTA BETWEEN :fecInicio AND :fecFinal ";
|
||||||
|
|
||||||
|
if (indTipo >= 0) {
|
||||||
|
sql += "AND TE.INDTIPO = " + indTipo;
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(lsPuntoVenta)) {
|
||||||
|
Integer[] lsPuntoVentaId = new Integer[lsPuntoVenta.size()];
|
||||||
|
for (int i = 0; i < lsPuntoVenta.size(); i++) {
|
||||||
|
lsPuntoVentaId[i] = lsPuntoVenta.get(i).getPuntoventaId();
|
||||||
|
}
|
||||||
|
sql += "AND PUNTOVENTA_ID IN (" + StringUtils.join(lsPuntoVentaId, ',') + ") ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return sql;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void processaParametros() throws Exception {}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
#geral
|
||||||
|
msg.noData=Não foi possivel obter dados com os parâmetros informados.
|
||||||
|
|
||||||
|
#Labels cabeçalho
|
||||||
|
cabecalho.nome=Relatório Financeiro de Receitas e Despesas
|
||||||
|
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.data=Data
|
||||||
|
label.agenciaCodigo=Código da Agência
|
||||||
|
label.agenciaDescricao=Nome da Agência
|
||||||
|
label.operacaoCodigo=Código da Operação
|
||||||
|
label.operacaoDescricao=Descrição da Operação
|
||||||
|
label.valor=Valor
|
||||||
|
label.total=Total
|
|
@ -0,0 +1,21 @@
|
||||||
|
#geral
|
||||||
|
msg.noData=Não foi possivel obter dados com os parâmetros informados.
|
||||||
|
|
||||||
|
#Labels cabeçalho
|
||||||
|
cabecalho.nome=Relatório Financeiro de Receitas e Despesas
|
||||||
|
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.data=Data
|
||||||
|
label.agenciaCodigo=Código da Agência
|
||||||
|
label.agenciaDescricao=Nome da Agência
|
||||||
|
label.operacaoCodigo=Código da Operação
|
||||||
|
label.operacaoDescricao=Descrição da Operação
|
||||||
|
label.valor=Valor
|
||||||
|
label.total=Total
|
Binary file not shown.
|
@ -0,0 +1,168 @@
|
||||||
|
<?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="RelatorioVendasComissao" 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="402"/>
|
||||||
|
<property name="ireport.y" value="0"/>
|
||||||
|
<parameter name="fecInicioFormatted" class="java.lang.String"/>
|
||||||
|
<parameter name="fecFinalFormatted" class="java.lang.String"/>
|
||||||
|
<parameter name="noDataRelatorio" class="java.lang.String"/>
|
||||||
|
<parameter name="nombEmpresa" class="java.lang.String"/>
|
||||||
|
<queryString>
|
||||||
|
<![CDATA[]]>
|
||||||
|
</queryString>
|
||||||
|
<field name="fecHorVta" class="java.util.Date"/>
|
||||||
|
<field name="puntoVentaId" class="java.lang.Integer"/>
|
||||||
|
<field name="nombPuntoVenta" class="java.lang.String"/>
|
||||||
|
<field name="tipoEventoExtraId" class="java.lang.Integer"/>
|
||||||
|
<field name="descTipoEvento" class="java.lang.String"/>
|
||||||
|
<field name="precio" class="java.math.BigDecimal"/>
|
||||||
|
<variable name="vTotal" class="java.math.BigDecimal" calculation="Sum">
|
||||||
|
<variableExpression><![CDATA[$F{precio}]]></variableExpression>
|
||||||
|
</variable>
|
||||||
|
<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="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 pattern="">
|
||||||
|
<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{fecInicioFormatted} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinalFormatted}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="53" y="41" width="139" height="20" uuid="8fa1c53b-1da7-4d4d-a75c-ab1543acae2a"/>
|
||||||
|
<textFieldExpression><![CDATA[$P{nombEmpresa}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<staticText>
|
||||||
|
<reportElement x="0" y="41" width="53" height="20" uuid="a91f6081-4740-4e36-8965-41b6cde4cc20"/>
|
||||||
|
<text><![CDATA[Empresa:]]></text>
|
||||||
|
</staticText>
|
||||||
|
</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>
|
||||||
|
<columnHeader>
|
||||||
|
<band height="23" splitType="Stretch">
|
||||||
|
<textField>
|
||||||
|
<reportElement x="0" y="0" width="100" height="20" uuid="a3dea313-f2a7-4388-bd91-5c02e8612b8e"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.data}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<line>
|
||||||
|
<reportElement positionType="Float" x="0" y="21" width="802" height="1" uuid="811af238-a027-48e9-bd6f-eee885474929"/>
|
||||||
|
</line>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="102" y="0" width="100" height="20" uuid="1ee34c25-6f62-4fec-88b8-09678b2bfd18"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.agenciaCodigo}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="204" y="0" width="190" height="20" uuid="a228f320-6e89-45a4-aef6-d1e8e76fa7a7"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.agenciaDescricao}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="509" y="0" width="190" height="20" uuid="6724b194-ae32-48c6-ac74-578fe785e768"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.operacaoDescricao}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="702" y="0" width="100" height="20" uuid="97964207-4388-4f8b-be2b-befe4264210c"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.valor}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="397" y="0" width="110" height="20" uuid="4aec7219-59e5-4942-9887-363a961fb6f1"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.operacaoCodigo}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</columnHeader>
|
||||||
|
<detail>
|
||||||
|
<band height="22" splitType="Stretch">
|
||||||
|
<textField isStretchWithOverflow="true" pattern="dd/MM/yyyy h.mm a" isBlankWhenNull="true">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="100" height="20" isPrintWhenDetailOverflows="true" uuid="c98526c0-c36f-42df-9308-452ac671044c"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{fecHorVta}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="102" y="0" width="100" height="20" isPrintWhenDetailOverflows="true" uuid="15424f70-9d6b-436a-a844-4ff5a828e9a1"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{puntoVentaId}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="204" y="0" width="190" height="20" isPrintWhenDetailOverflows="true" uuid="aad51f92-6577-4404-9c57-1d47c0c64c6a"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{nombPuntoVenta}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="397" y="0" width="110" height="20" isPrintWhenDetailOverflows="true" uuid="54df7028-fdb6-489b-bfe9-63a5ccf0a54b"/>
|
||||||
|
<textElement textAlignment="Center"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{tipoEventoExtraId}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="509" y="0" width="190" height="20" isPrintWhenDetailOverflows="true" uuid="e2841610-831d-4379-96ff-e5806f4c1ceb"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{descTipoEvento}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="false">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="702" y="0" width="100" height="20" isPrintWhenDetailOverflows="true" uuid="77d7eb39-6b9d-448d-981b-01813e97d038"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$F{precio}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</detail>
|
||||||
|
<columnFooter>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</columnFooter>
|
||||||
|
<pageFooter>
|
||||||
|
<band splitType="Stretch"/>
|
||||||
|
</pageFooter>
|
||||||
|
<summary>
|
||||||
|
<band height="26" splitType="Stretch">
|
||||||
|
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
|
||||||
|
<reportElement stretchType="RelativeToTallestObject" x="702" y="5" width="99" height="20" isPrintWhenDetailOverflows="true" uuid="417ed1de-ce71-42fa-8108-33a37f6a0626"/>
|
||||||
|
<textElement textAlignment="Right">
|
||||||
|
<font isBold="true"/>
|
||||||
|
</textElement>
|
||||||
|
<textFieldExpression><![CDATA[$V{vTotal}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
<line>
|
||||||
|
<reportElement positionType="Float" x="0" y="2" width="802" height="1" uuid="c8dfd524-14cc-454c-afc0-3ce9f8d0ead8"/>
|
||||||
|
</line>
|
||||||
|
<textField>
|
||||||
|
<reportElement x="546" y="5" width="154" height="20" uuid="38a0f957-1b50-46f9-b79f-c631baf8937b"/>
|
||||||
|
<textElement textAlignment="Right"/>
|
||||||
|
<textFieldExpression><![CDATA[$R{label.total}]]></textFieldExpression>
|
||||||
|
</textField>
|
||||||
|
</band>
|
||||||
|
</summary>
|
||||||
|
<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>
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
public class RelatorioFinanceiroReceitasDespesasBean {
|
||||||
|
|
||||||
|
private Date fecHorVta;
|
||||||
|
|
||||||
|
private Integer puntoVentaId;
|
||||||
|
|
||||||
|
private String nombPuntoVenta;
|
||||||
|
|
||||||
|
private Integer tipoEventoExtraId;
|
||||||
|
|
||||||
|
private String descTipoEvento;
|
||||||
|
|
||||||
|
private BigDecimal precio;
|
||||||
|
|
||||||
|
public Date getFecHorVta() {
|
||||||
|
return fecHorVta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecHorVta(Date fecHorVta) {
|
||||||
|
this.fecHorVta = fecHorVta;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 getTipoEventoExtraId() {
|
||||||
|
return tipoEventoExtraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTipoEventoExtraId(Integer tipoEventoExtraId) {
|
||||||
|
this.tipoEventoExtraId = tipoEventoExtraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescTipoEvento() {
|
||||||
|
return descTipoEvento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescTipoEvento(String descTipoEvento) {
|
||||||
|
this.descTipoEvento = descTipoEvento;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPrecio() {
|
||||||
|
return precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrecio(BigDecimal precio) {
|
||||||
|
this.precio = precio;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,18 +1,36 @@
|
||||||
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.stereotype.Controller;
|
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.Component;
|
||||||
|
import org.zkoss.zk.ui.event.Event;
|
||||||
import org.zkoss.zul.Combobox;
|
import org.zkoss.zul.Combobox;
|
||||||
import org.zkoss.zul.Datebox;
|
import org.zkoss.zul.Datebox;
|
||||||
|
import org.zkoss.zul.Paging;
|
||||||
|
import org.zkoss.zul.Textbox;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioFinanceiroReceitasDespesas;
|
||||||
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
import com.rjconsultores.ventaboletos.service.EmpresaService;
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta;
|
|
||||||
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.MyListbox;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.HibernateSearchObject;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.paginacion.PagedListWrapper;
|
||||||
|
import com.rjconsultores.ventaboletos.web.utilerias.render.RenderPuntoVentaSimple;
|
||||||
|
import com.trg.search.Filter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -25,27 +43,93 @@ public class RelatorioFinanceiroReceitasDespesasController extends MyGenericForw
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DataSource dataSourceRead;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private EmpresaService empresaService;
|
private EmpresaService empresaService;
|
||||||
|
|
||||||
private List<Empresa> lsEmpresa;
|
private List<Empresa> lsEmpresa;
|
||||||
private Datebox dataInicial;
|
private Datebox dataInicial;
|
||||||
private Datebox dataFinal;
|
private Datebox dataFinal;
|
||||||
private MyComboboxPuntoVenta cmbAgencia;
|
|
||||||
private Combobox cmbIndTipo;
|
private Combobox cmbIndTipo;
|
||||||
|
private Combobox cmbEmpresa;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private transient PagedListWrapper<PuntoVenta> plwPuntoVenta;
|
||||||
|
private MyListbox puntoVentaList;
|
||||||
|
private MyListbox puntoVentaSelectedList;
|
||||||
|
private Textbox txtPalavraPesquisa;
|
||||||
|
private Paging pagingPuntoVenta;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void doAfterCompose(Component comp) throws Exception {
|
public void doAfterCompose(Component comp) throws Exception {
|
||||||
lsEmpresa = empresaService.obtenerTodos();
|
|
||||||
super.doAfterCompose(comp);
|
super.doAfterCompose(comp);
|
||||||
|
lsEmpresa = empresaService.obtenerTodos();
|
||||||
|
puntoVentaList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
|
puntoVentaSelectedList.setItemRenderer(new RenderPuntoVentaSimple());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Combobox getCmbIndTipo() {
|
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
|
||||||
return cmbIndTipo;
|
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||||
|
|
||||||
|
Map<String, Object> parametros = new HashMap<String, Object>();
|
||||||
|
parametros.put("fecInicio", dataInicial.getValue());
|
||||||
|
parametros.put("fecInicioFormatted", sdf.format(dataInicial.getValue()));
|
||||||
|
parametros.put("fecFinal", dataFinal.getValue());
|
||||||
|
parametros.put("fecFinalFormatted", sdf.format(dataFinal.getValue()));
|
||||||
|
Empresa empresa = (Empresa) cmbEmpresa.getSelectedItem().getValue();
|
||||||
|
parametros.put("empresa", empresa);
|
||||||
|
parametros.put("nombEmpresa", empresa.getNombempresa());
|
||||||
|
parametros.put("lsPuntoVenta", Arrays.asList(puntoVentaSelectedList.getData()));
|
||||||
|
parametros.put("indTipo", Integer.valueOf((String) cmbIndTipo.getSelectedItem().getValue()));
|
||||||
|
|
||||||
|
RelatorioFinanceiroReceitasDespesas relatorio = new RelatorioFinanceiroReceitasDespesas(parametros, dataSourceRead.getConnection());
|
||||||
|
|
||||||
|
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 setCmbIndTipo(Combobox cmbIndTipo) {
|
public void onDoubleClick$puntoVentaList(Event ev) {
|
||||||
this.cmbIndTipo = cmbIndTipo;
|
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaList.getSelected();
|
||||||
|
puntoVentaSelectedList.addItemNovo(puntoVentaSel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onDoubleClick$puntoVentaSelList(Event ev) {
|
||||||
|
PuntoVenta puntoVentaSel = (PuntoVenta) puntoVentaSelectedList.getSelected();
|
||||||
|
puntoVentaSelectedList.removeItem(puntoVentaSel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnLimpar(Event ev) {
|
||||||
|
puntoVentaSelectedList.setData(new ArrayList<Object>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onClick$btnPesquisa(Event ev) {
|
||||||
|
|
||||||
|
HibernateSearchObject<PuntoVenta> puntoVentaBusqueda =
|
||||||
|
new HibernateSearchObject<PuntoVenta>(PuntoVenta.class,
|
||||||
|
pagingPuntoVenta.getPageSize());
|
||||||
|
|
||||||
|
puntoVentaBusqueda.addFilterOr(Filter.like("nombpuntoventa", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%")), Filter.like("numPuntoVenta", "%" + txtPalavraPesquisa.getText().trim().toUpperCase().concat("%")));
|
||||||
|
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("relatorioReceitaDiariaAgenciaController.window.title"),
|
||||||
|
Messagebox.OK, Messagebox.INFORMATION);
|
||||||
|
} catch (InterruptedException ex) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Empresa> getLsEmpresa() {
|
public List<Empresa> getLsEmpresa() {
|
||||||
|
|
|
@ -6899,11 +6899,15 @@ busquedaTipoConfCondComissaoController.btnCerrar.tooltiptext=Cerrar
|
||||||
# Reporte Ingresos y Gastos Financieros
|
# Reporte Ingresos y Gastos Financieros
|
||||||
relatorioFinanceiroReceitasDespesasController.window.title = Reporte Ingresos y Gastos Financieros
|
relatorioFinanceiroReceitasDespesasController.window.title = Reporte Ingresos y Gastos Financieros
|
||||||
indexController.mniRelatorioFinanceiroReceitasDespesas.label = Ingresos y Gastos
|
indexController.mniRelatorioFinanceiroReceitasDespesas.label = Ingresos y Gastos
|
||||||
relatorioFinanceiroReceitasDespesas.lbDataIni.value=Fecha Inicio
|
relatorioFinanceiroReceitasDespesasController.lbDataIni.value=Fecha Inicio
|
||||||
relatorioFinanceiroReceitasDespesas.lbDataFin.value=Fecha Final
|
relatorioFinanceiroReceitasDespesasController.lbDataFin.value=Fecha Final
|
||||||
relatorioFinanceiroReceitasDespesas.lbEmpresa.value=Empresa
|
relatorioFinanceiroReceitasDespesasController.lbEmpresa.value=Empresa
|
||||||
relatorioFinanceiroReceitasDespesas.lbAgencia.value=Agência
|
relatorioFinanceiroReceitasDespesasController.lbAgencia.value=Agência
|
||||||
relatorioFinanceiroReceitasDespesas.tipoOperacion.value=Tipo
|
relatorioFinanceiroReceitasDespesasController.tipoOperacion.value=Tipo
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo1=Ingresos
|
relatorioFinanceiroReceitasDespesasController.indTipo1=Ingresos
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo2=Gasto
|
relatorioFinanceiroReceitasDespesasController.indTipo2=Gasto
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo3=Todos
|
relatorioFinanceiroReceitasDespesasController.indTipo3=Todos
|
||||||
|
relatorioFinanceiroReceitasDespesasController.btnPesquisa.label = Buscar
|
||||||
|
relatorioFinanceiroReceitasDespesasController.btnLimpar.label = Limpiar selección
|
||||||
|
relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.codigo = Código
|
||||||
|
relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.nome = Nombre
|
|
@ -7061,11 +7061,15 @@ busquedaTipoConfCondComissaoController.btnCerrar.tooltiptext=Fechar
|
||||||
# Reporte Ingresos y Gastos Financieros
|
# Reporte Ingresos y Gastos Financieros
|
||||||
relatorioFinanceiroReceitasDespesasController.window.title=Relatório Financeiro de Receitas e Despesas
|
relatorioFinanceiroReceitasDespesasController.window.title=Relatório Financeiro de Receitas e Despesas
|
||||||
indexController.mniRelatorioFinanceiroReceitasDespesas.label=Receitas e Despesas
|
indexController.mniRelatorioFinanceiroReceitasDespesas.label=Receitas e Despesas
|
||||||
relatorioFinanceiroReceitasDespesas.lbDataIni.value=Data Início
|
relatorioFinanceiroReceitasDespesasController.lbDataIni.value=Data Início
|
||||||
relatorioFinanceiroReceitasDespesas.lbDataFin.value=Data Final
|
relatorioFinanceiroReceitasDespesasController.lbDataFin.value=Data Final
|
||||||
relatorioFinanceiroReceitasDespesas.lbEmpresa.value=Empresa
|
relatorioFinanceiroReceitasDespesasController.lbEmpresa.value=Empresa
|
||||||
relatorioFinanceiroReceitasDespesas.lbAgencia.value=Agência
|
relatorioFinanceiroReceitasDespesasController.lbAgencia.value=Agência
|
||||||
relatorioFinanceiroReceitasDespesas.tipoOperacion.value=Tipo
|
relatorioFinanceiroReceitasDespesasController.tipoOperacion.value=Tipo
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo1=Receita
|
relatorioFinanceiroReceitasDespesasController.indTipo1=Receita
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo2=Despesa
|
relatorioFinanceiroReceitasDespesasController.indTipo2=Despesa
|
||||||
relatorioFinanceiroReceitasDespesas.indTipo3=Todas
|
relatorioFinanceiroReceitasDespesasController.indTipo3=Todas
|
||||||
|
relatorioFinanceiroReceitasDespesasController.btnPesquisa.label = Pesquisar
|
||||||
|
relatorioFinanceiroReceitasDespesasController.btnLimpar.label = Limpar Seleção
|
||||||
|
relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.codigo = Código
|
||||||
|
relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.nome = Nome
|
|
@ -18,40 +18,86 @@
|
||||||
<rows>
|
<rows>
|
||||||
<row>
|
<row>
|
||||||
<label
|
<label
|
||||||
value="${c:l('relatorioFinanceiroReceitasDespesas.lbDataIni.value')}" />
|
value="${c:l('relatorioFinanceiroReceitasDespesasController.lbDataIni.value')}" />
|
||||||
<datebox id="dataInicial" width="100%" mold="rounded"
|
<datebox id="dataInicial" width="100%" mold="rounded"
|
||||||
format="dd/MM/yyyy" constraint="no empty"
|
format="dd/MM/yyyy" constraint="no empty"
|
||||||
maxlength="10" />
|
maxlength="10" />
|
||||||
<label
|
<label
|
||||||
value="${c:l('relatorioFinanceiroReceitasDespesas.lbDataFin.value')}" />
|
value="${c:l('relatorioFinanceiroReceitasDespesasController.lbDataFin.value')}" />
|
||||||
<datebox id="dataFinal" width="100%" mold="rounded"
|
<datebox id="dataFinal" width="100%" mold="rounded"
|
||||||
format="dd/MM/yyyy" constraint="no empty"
|
format="dd/MM/yyyy" constraint="no empty"
|
||||||
maxlength="10" />
|
maxlength="10" />
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<label
|
<label
|
||||||
value="${c:l('relatorioFinanceiroReceitasDespesas.lbEmpresa.value')}" />
|
value="${c:l('relatorioFinanceiroReceitasDespesasController.lbEmpresa.value')}" />
|
||||||
<combobox id="cmbEmpresa"
|
<combobox id="cmbEmpresa"
|
||||||
buttonVisible="true" width="100%"
|
buttonVisible="true" width="100%"
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
|
||||||
model="@{winFiltroRelatorioFinanceiroReceitasDespesas$composer.lsEmpresa}" />
|
model="@{winFiltroRelatorioFinanceiroReceitasDespesas$composer.lsEmpresa}" />
|
||||||
<label value="${c:l('relatorioFinanceiroReceitasDespesas.lbAgencia.value')}" />
|
<label value="${c:l('relatorioFinanceiroReceitasDespesasController.lbAgencia.value')}" />
|
||||||
<combobox id="cmbAgencia" width="100%" maxlength="60" mold="rounded" buttonVisible="true"
|
<bandbox id="bbPesquisaPuntoVenta" width="90%"
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta"/>
|
mold="rounded" readonly="true">
|
||||||
|
<bandpopup height="150px">
|
||||||
|
<vbox>
|
||||||
|
<hbox>
|
||||||
|
<textbox id="txtPalavraPesquisa" />
|
||||||
|
<button id="btnPesquisa"
|
||||||
|
image="/gui/img/find.png"
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.btnPesquisa.label')}" />
|
||||||
|
<button id="btnLimpar"
|
||||||
|
image="/gui/img/eraser.png"
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.btnLimpar.label')}" />
|
||||||
|
</hbox>
|
||||||
|
|
||||||
|
<listbox id="puntoVentaList"
|
||||||
|
mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" multiple="false" height="100%" width="360px">
|
||||||
|
<listhead>
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.codigo')}" />
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.nome')}" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
<paging id="pagingPuntoVenta"
|
||||||
|
pageSize="10" />
|
||||||
|
</vbox>
|
||||||
|
</bandpopup>
|
||||||
|
</bandbox>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<label
|
<label
|
||||||
value="${c:l('relatorioFinanceiroReceitasDespesas.tipoOperacion.value')}" />
|
value="${c:l('relatorioFinanceiroReceitasDespesasController.tipoOperacion.value')}" />
|
||||||
<combobox id="cmbIndTipo" width="100%" mold="rounded"
|
<combobox id="cmbIndTipo" width="100%" mold="rounded"
|
||||||
buttonVisible="true"
|
buttonVisible="true"
|
||||||
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar">
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar">
|
||||||
<comboitem value="1"
|
<comboitem value="1"
|
||||||
label="${c:l('relatorioFinanceiroReceitasDespesas.indTipo1')}" />
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.indTipo1')}" />
|
||||||
<comboitem value="0"
|
<comboitem value="0"
|
||||||
label="${c:l('relatorioFinanceiroReceitasDespesas.indTipo2')}" />
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.indTipo2')}" />
|
||||||
<comboitem value="-1"
|
<comboitem value="-1"
|
||||||
label="${c:l('relatorioFinanceiroReceitasDespesas.indTipo3')}" />
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.indTipo3')}" />
|
||||||
</combobox>
|
</combobox>
|
||||||
|
<cell colspan="2" rowspan="2">
|
||||||
|
<borderlayout height="100px">
|
||||||
|
<center border="0">
|
||||||
|
<listbox id="puntoVentaSelectedList"
|
||||||
|
mold="paging"
|
||||||
|
use="com.rjconsultores.ventaboletos.web.utilerias.MyListbox"
|
||||||
|
vflex="true" multiple="true" height="60%" width="100%">
|
||||||
|
<listhead>
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.codigo')}" />
|
||||||
|
<listheader
|
||||||
|
label="${c:l('relatorioFinanceiroReceitasDespesasController.puntoVentaSelectedList.nome')}" />
|
||||||
|
<listheader width="35px" />
|
||||||
|
</listhead>
|
||||||
|
</listbox>
|
||||||
|
</center>
|
||||||
|
</borderlayout>
|
||||||
|
</cell>
|
||||||
</row>
|
</row>
|
||||||
</rows>
|
</rows>
|
||||||
</grid>
|
</grid>
|
||||||
|
|
Loading…
Reference in New Issue