fixed bug #7094 - Criação de relatório de depósitos detalhados.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@52748 d1611594-4594-4d17-8e1d-87c2c4800839
master
thiago 2016-02-11 13:36:11 +00:00
parent ce92e917b9
commit d3e3d614dd
11 changed files with 761 additions and 0 deletions

View File

@ -0,0 +1,208 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.impl;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.log4j.Logger;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.RelatorioDepositosDetalhadosBean;
import com.rjconsultores.ventaboletos.web.utilerias.NamedParameterStatement;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
/**
* @author Thiago
*
*/
public class RelatorioDepositosDetalhado extends Relatorio {
private static Logger log = Logger.getLogger(RelatorioDepositosDetalhado.class);
private List<RelatorioDepositosDetalhadosBean> lsDadosRelatorio;
private Timestamp fecInicio;
private Timestamp fecFinal;
private Integer marcaId;
public RelatorioDepositosDetalhado(Map<String, Object> parametros, Connection conexao) throws Exception {
super(parametros, conexao);
this.setCustomDataSource(new DataSource(this) {
@Override
public void initDados() throws Exception {
Map<String, Object> parametros = this.relatorio.getParametros();
fecInicio = (Timestamp) parametros.get("dataFiltroInicial");
fecFinal = (Timestamp) parametros.get("dataFiltroFinal");
if(parametros.get("MARCA_ID")!=null){
marcaId = Integer.valueOf(parametros.get("MARCA_ID").toString());
}
Connection conexao = this.relatorio.getConexao();
processarDepositosDetalhados(conexao);
setLsDadosRelatorio(lsDadosRelatorio);
}
});
}
public void setLsDadosRelatorio(List<RelatorioDepositosDetalhadosBean> lsDadosRelatorio) {
this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio));
this.lsDadosRelatorio = lsDadosRelatorio;
}
private void processarDepositosDetalhados(Connection conexao) {
ResultSet rset = null;
NamedParameterStatement stmt = null;
try {
if(lsDadosRelatorio == null) {
lsDadosRelatorio = new ArrayList<RelatorioDepositosDetalhadosBean>();
}
/* Processando vendas normais */
stmt = carregarNamedParameterStatement(conexao);
rset = stmt.executeQuery();
processarResultado(rset);
fecharConexaoBanco(stmt, rset);
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
private NamedParameterStatement carregarNamedParameterStatement(Connection conexao) throws SQLException {
String sql = getSqlPacotes();
log.info(sql);
NamedParameterStatement stmt = new NamedParameterStatement(conexao, sql);
if(fecInicio != null) {
stmt.setTimestamp("fecInicio", fecInicio);
}
if(fecFinal != null) {
stmt.setTimestamp("fecFinal", fecFinal);
}
if(marcaId != null){
stmt.setInt("MARCA_ID", marcaId);
}
return stmt;
}
private void processarResultado(ResultSet rset) throws SQLException {
while (rset.next()) {
RelatorioDepositosDetalhadosBean relatorioDepositosDetalhadosBean = new RelatorioDepositosDetalhadosBean();
relatorioDepositosDetalhadosBean.setEmpresa(rset.getString("Empresa"));
relatorioDepositosDetalhadosBean.setNombPuntoVenta(rset.getString("Ponto_de_venda"));
relatorioDepositosDetalhadosBean.setBanco(rset.getString("Banco"));
relatorioDepositosDetalhadosBean.setFechaDeposito(rset.getString("data_deposito"));
relatorioDepositosDetalhadosBean.setFechaLancamientoDeposito(rset.getString("DATA_LANCAMENTO_DEPOSITO"));
relatorioDepositosDetalhadosBean.setNumAgencia(rset.getString("Agencia"));
relatorioDepositosDetalhadosBean.setNumConta(rset.getString("Conta"));
relatorioDepositosDetalhadosBean.setNumDeposito(rset.getString("Numero_deposito"));
relatorioDepositosDetalhadosBean.setValorDeposito(rset.getBigDecimal("valor_deposito"));
lsDadosRelatorio.add(relatorioDepositosDetalhadosBean);
}
}
protected String getSqlPacotes() {
StringBuilder sQuery = new StringBuilder();
sQuery.append(" SELECT ");
sQuery.append(" E.NOMBEMPRESA Empresa, ");
sQuery.append(" PV.NOMBPUNTOVENTA Ponto_de_venda, ");
sQuery.append(" TO_CHAR(FD.FECHA_DEPOSITO,'dd/MM/yyyy') data_deposito, ");
sQuery.append(" FD.NUMDEPOSITO Numero_deposito, ");
sQuery.append(" TO_CHAR(FD.FECMODIF,'dd/MM/yyyy') DATA_LANCAMENTO_DEPOSITO, ");
sQuery.append(" if.NOME Banco, ");
sQuery.append(" EC.NUMCONTA Conta, ");
sQuery.append(" EC.NUMAGENCIA Agencia, ");
sQuery.append(" FD.VALOR valor_deposito ");
sQuery.append(" FROM ");
sQuery.append(" FECHAMENTO_DEPOSITO fd ");
sQuery.append(" JOIN FECHAMENTO_CCT_DEPOSITO fcd ");
sQuery.append(" ON ");
sQuery.append(" FCD.FECHAMENTODEPOSITO_ID = FD.FECHAMENTODEPOSITO_ID ");
sQuery.append(" JOIN FECHAMENTO_CNTCORRENTE fc ");
sQuery.append(" ON ");
sQuery.append(" FCD.FECHAMENTOCNTCORRENTE_ID = FC.FECHAMENTOCNTCORRENTE_ID ");
sQuery.append(" JOIN EMPRESA e ");
sQuery.append(" ON ");
sQuery.append(" E.EMPRESA_ID = FC.EMPRESA_ID ");
sQuery.append(" JOIN PUNTO_VENTA pv ");
sQuery.append(" ON ");
sQuery.append(" PV.PUNTOVENTA_ID = FC.PUNTOVENTA_ID ");
sQuery.append(" LEFT JOIN PTOVTA_EMPRESA pve ");
sQuery.append(" ON ");
sQuery.append(" PVE.EMPRESA_ID = e.empresa_id ");
sQuery.append(" AND PVE.PUNTOVENTA_ID = PV.PUNTOVENTA_ID ");
sQuery.append(" AND PVE.activo = 1 ");
sQuery.append(" LEFT OUTER JOIN EMPRESA_CONTABANCARIA ec ");
sQuery.append(" ON ");
sQuery.append(" EC.EMPRESA_ID = PVE.EMPRESA_ID ");
sQuery.append(" AND EC.EMPRESACONTABANCARIA_ID = PVE.EMPRESACONTABANCARIA_ID ");
sQuery.append(" AND EC.ACTIVO = 1 ");
sQuery.append(" LEFT JOIN INSTI_FINANCEIRA IF ");
sQuery.append(" ON ");
sQuery.append(" if.INSTIFINANCEIRA_ID = EC.INSTIFINANCEIRA_ID ");
sQuery.append(" WHERE ");
sQuery.append(" FD.ACTIVO = 1 ");
sQuery.append(" AND FCD.ACTIVO = 1 ");
sQuery.append(" AND FC.ACTIVO = 1 ");
sQuery.append(" AND E.ACTIVO = 1 ");
sQuery.append(" AND PV.ACTIVO = 1 ");
if(parametros.get("MARCA_ID")!= null){
sQuery.append(" and e.empresa_id =:MARCA_ID ");
}
sQuery.append(" and FD.FECMODIF between :fecInicio and :fecFinal");
sQuery.append(" GROUP BY ");
sQuery.append(" E.NOMBEMPRESA, ");
sQuery.append(" PV.NOMBPUNTOVENTA, ");
sQuery.append(" FD.FECHA_DEPOSITO, ");
sQuery.append(" FD.NUMDEPOSITO, ");
sQuery.append(" FD.FECMODIF, ");
sQuery.append(" if.NOME, ");
sQuery.append(" EC.NUMCONTA, ");
sQuery.append(" EC.NUMAGENCIA, ");
sQuery.append(" FD.VALOR ");
sQuery.append(" ORDER BY ");
sQuery.append(" E.NOMBEMPRESA, ");
sQuery.append(" FD.FECHA_DEPOSITO, ");
sQuery.append(" FD.FECMODIF, ");
sQuery.append(" PV.NOMBPUNTOVENTA, ");
sQuery.append(" FD.NUMDEPOSITO, ");
sQuery.append(" if.NOME, ");
sQuery.append(" EC.NUMCONTA, ");
sQuery.append(" EC.NUMAGENCIA, ");
sQuery.append(" FD.VALOR ");
return sQuery.toString();
}
private void fecharConexaoBanco(NamedParameterStatement stmt, ResultSet rset) {
try {
if(rset != null) {
rset.close();
}
if(stmt != null) {
stmt.close();
}
} catch (SQLException e) {
log.error(e.getMessage(), e);
}
}
@Override
protected void processaParametros() throws Exception {
}
}

View File

@ -0,0 +1,22 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Depositos Detallados
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.fechaDeposito=Fecha Deposito
label.numDeposito=N\u00B0 Deposito
label.fechaLancamientoDeposito=Lanzamiento
label.banco=Banco
label.numConta=Cuenta
label.numAgencia=Agencia
label.valorDeposito=Valor

View File

@ -0,0 +1,22 @@
#geral
msg.noData=Não foi possivel obter dados com os parâmetros informados.
#Labels cabeçalho
cabecalho.nome=Relatório Dep\u00F3sitos Detalhados
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=Nome Agência
label.fechaDeposito=Data do Dep\u00F3sito
label.numDeposito=N\u00B0 do Dep\u00F3sito
label.fechaLancamientoDeposito=Lan\u00E7amento
label.banco=Banco
label.numConta=Conta
label.numAgencia=Ag\u00EAncia
label.valorDeposito=Valor

View File

@ -0,0 +1,210 @@
<?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.0"/>
<property name="ireport.x" value="131"/>
<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"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="valorDeposito" class="java.math.BigDecimal"/>
<field name="fechaDeposito" class="java.lang.String"/>
<field name="numDeposito" class="java.lang.String"/>
<field name="fechaLancamientoDeposito" class="java.lang.String"/>
<field name="banco" class="java.lang.String"/>
<field name="numConta" class="java.lang.String"/>
<field name="numAgencia" class="java.lang.String"/>
<field name="nombPuntoVenta" class="java.lang.String"/>
<field name="empresa" class="java.lang.String"/>
<variable name="total" class="java.math.BigDecimal" calculation="Sum">
<variableExpression><![CDATA[$F{valorDeposito}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="61" 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="fd05bd35-30d9-4baf-aa56-f8e5d3c3268b" x="0" y="20" width="620" height="20"/>
<textElement>
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$R{cabecalho.periodo} + " " + $P{fecInicio} + " " + $R{cabecalho.periodoA} + " " + $P{fecFinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="8fa1c53b-1da7-4d4d-a75c-ab1543acae2a" x="53" y="41" width="263" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$P{empresa}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="a91f6081-4740-4e36-8965-41b6cde4cc20" x="0" y="41" width="53" height="20"/>
<textElement/>
<text><![CDATA[Empresa:]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="21" splitType="Stretch">
<textField>
<reportElement uuid="73d3d9f7-45ed-4fde-99d9-4f55e43bbd0f" x="682" y="1" width="80" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{cabecalho.pagina} +" "+$V{PAGE_NUMBER}+" "+$R{cabecalho.de}]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement uuid="5080d897-9bd0-41d7-b0d5-1a62485e2480" x="762" y="1" width="40" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="23" splitType="Stretch">
<textField>
<reportElement uuid="8a39b1b1-6ebd-4f33-adea-c28a9988eaae" x="287" y="0" width="80" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.fechaDeposito}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="2d666aaf-65a6-4c3f-acd3-e65483a78256" x="367" y="0" width="81" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.numDeposito}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="a2ea7cea-d8ab-4c0e-bee0-4dafb3866c1f" x="448" y="0" width="80" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.fechaLancamientoDeposito}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="43d6ee75-8459-4b9e-8cbe-ca2819d3198a" x="597" y="0" width="63" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.numConta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="12a7a0b1-f60c-4819-972a-2ea87f1f07b3" x="528" y="0" width="69" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.banco}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="811af238-a027-48e9-bd6f-eee885474929" positionType="Float" x="0" y="21" width="802" height="1"/>
</line>
<textField>
<reportElement uuid="cfac237e-06b7-4c98-b7f1-285f5ec2c8b3" x="194" y="0" width="93" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$R{label.nombPuntoVenta}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="f1e309cf-c3e3-461e-86a3-bb8a3dd5eab0" x="660" y="0" width="62" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.numAgencia}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="d778da2b-cbb2-45a0-b40f-5547eadc225a" x="722" y="1" width="80" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$R{label.valorDeposito}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="924759aa-e9f1-4dcd-bf38-6159750422a1" x="2" y="0" width="192" height="20"/>
<textElement/>
<text><![CDATA[Empresa]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="22" splitType="Stretch">
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="2e83e648-f95f-42ae-9069-862e6ad79b21" stretchType="RelativeToTallestObject" x="528" y="0" width="69" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{banco}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="8cdbdd14-c9f1-45d8-bf41-a4066930f5a4" stretchType="RelativeToTallestObject" x="287" y="0" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{fechaDeposito}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="040c8de3-f836-40bc-96bd-761a7f5b46ef" stretchType="RelativeToTallestObject" x="597" y="0" width="63" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{numConta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="b18fae2e-6454-42b0-a68c-04cf790ddfd6" stretchType="RelativeToTallestObject" x="448" y="0" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{fechaLancamientoDeposito}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true">
<reportElement uuid="09b0cd36-1946-406f-923a-172b8a4f1ac6" stretchType="RelativeToTallestObject" x="367" y="0" width="81" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{numDeposito}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="cebb836f-d485-4d50-98e0-0678bb715fb9" stretchType="RelativeToTallestObject" x="194" y="0" width="93" height="20" isPrintWhenDetailOverflows="true"/>
<textElement/>
<textFieldExpression><![CDATA[$F{nombPuntoVenta}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement uuid="5fc60f32-0c1e-43ba-8dec-cfc5d6c085fc" stretchType="RelativeToTallestObject" x="660" y="0" width="62" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{numAgencia}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="¤ #,##0.00" isBlankWhenNull="true">
<reportElement uuid="c546149b-31a4-4a1c-bb24-dcb6681075d1" stretchType="RelativeToTallestObject" x="722" y="0" width="80" height="20" isPrintWhenDetailOverflows="true"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{valorDeposito}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="fd73cdf1-4bc5-440e-8b76-5a67a818e5ae" x="2" y="0" width="192" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{empresa}]]></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 pattern="¤ #,##0.00">
<reportElement uuid="d9967577-1a2d-4e8c-afc3-5aa8fa18ae63" x="723" y="6" width="79" height="20"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$V{total}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="8028606d-ad70-4197-b011-d2ade8e44267" x="623" y="6" width="100" height="20"/>
<textElement/>
<text><![CDATA[Total]]></text>
</staticText>
</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>

View File

@ -0,0 +1,90 @@
/**
*
*/
package com.rjconsultores.ventaboletos.relatorios.utilitarios;
import java.math.BigDecimal;
/**
* @author Thiago
*
*/
public class RelatorioDepositosDetalhadosBean {
private String empresa;
private String nombPuntoVenta;
private String fechaDeposito;
private String numDeposito;
private String fechaLancamientoDeposito;
private String banco;
private String numConta;
private String numAgencia;
private BigDecimal valorDeposito;
/**
* @return the empresa
*/
public String getEmpresa() {
return empresa;
}
/**
* @param empresa the empresa to set
*/
public void setEmpresa(String empresa) {
this.empresa = empresa;
}
public String getNombPuntoVenta() {
return nombPuntoVenta;
}
public void setNombPuntoVenta(String nombPuntoVenta) {
this.nombPuntoVenta = nombPuntoVenta;
}
public String getFechaDeposito() {
return fechaDeposito;
}
public void setFechaDeposito(String fechaDeposito) {
this.fechaDeposito = fechaDeposito;
}
public String getNumDeposito() {
return numDeposito;
}
public void setNumDeposito(String numDeposito) {
this.numDeposito = numDeposito;
}
public String getFechaLancamientoDeposito() {
return fechaLancamientoDeposito;
}
public void setFechaLancamientoDeposito(String fechaLancamientoDeposito) {
this.fechaLancamientoDeposito = fechaLancamientoDeposito;
}
public String getBanco() {
return banco;
}
public void setBanco(String banco) {
this.banco = banco;
}
public String getNumConta() {
return numConta;
}
public void setNumConta(String numConta) {
this.numConta = numConta;
}
public String getNumAgencia() {
return numAgencia;
}
public void setNumAgencia(String numAgencia) {
this.numAgencia = numAgencia;
}
public BigDecimal getValorDeposito() {
return valorDeposito;
}
public void setValorDeposito(BigDecimal valorDeposito) {
this.valorDeposito = valorDeposito;
}
}

View File

@ -0,0 +1,116 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.gui.controladores.relatorios;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.event.Event;
import org.zkoss.zul.Comboitem;
import org.zkoss.zul.Datebox;
import org.zkoss.zul.Messagebox;
import com.rjconsultores.ventaboletos.entidad.Empresa;
import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDepositosDetalhado;
import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio;
import com.rjconsultores.ventaboletos.service.EmpresaService;
import com.rjconsultores.ventaboletos.utilerias.DateUtil;
import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar;
import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer;
/**
* @author Thiago
*
*/
@Controller("relatorioDepositosDetalhadosController")
@Scope("prototype")
public class RelatorioDepositosDetalhadosController extends MyGenericForwardComposer {
private static final long serialVersionUID = 1L;
@Autowired
private DataSource dataSourceRead;
@Autowired
private EmpresaService empresaService;
private MyComboboxEstandar cmbEmpresa;
private List<Empresa> lsEmpresa;
private Datebox dataInicial;
private Datebox dataFinal;
@Override
public void doAfterCompose(Component comp) throws Exception {
setLsEmpresa(empresaService.obtenerTodos());
super.doAfterCompose(comp);
}
public void onClick$btnExecutarRelatorio(Event ev) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date dataDe = dataInicial.getValue();
Date dataAte = dataFinal.getValue();
Timestamp fecVentaInicial = new Timestamp(DateUtil.inicioFecha(dataDe).getTime());
Timestamp fecVentaFinal = new Timestamp(DateUtil.fimFecha(dataAte).getTime());
if(fecVentaFinal.before(fecVentaInicial)){
Messagebox.show(
Labels.getLabel("relatorioDepositosDetalhadosController.MSG.busquedaPeriodo"),
Labels.getLabel("relatorioDepositosDetalhadosController.window.title"),
Messagebox.OK, Messagebox.INFORMATION);
return;
}
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("fecInicio", sdf.format(dataDe));
parametros.put("fecFinal", sdf.format(dataAte));
parametros.put("dataFiltroInicial", fecVentaInicial);
parametros.put("dataFiltroFinal", fecVentaFinal);
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
Empresa empresa = (Empresa) itemEmpresa.getValue();
parametros.put("MARCA_ID", empresa.getEmpresaId());
parametros.put("empresa", empresa.getNombempresa());
} else{
parametros.put("empresa", "Todas;");
}
Relatorio relatorio = new RelatorioDepositosDetalhado(parametros, dataSourceRead.getConnection());
Map<String, Object> args = new HashMap<String, Object>();
args.put("relatorio", relatorio);
openWindow("/component/reportView.zul",
Labels.getLabel("indexController.mniRelatorioDepositosDetalhados.label"), args, MODAL);
}
/**
* @return the lsEmpresa
*/
public List<Empresa> getLsEmpresa() {
return lsEmpresa;
}
/**
* @param lsEmpresa the lsEmpresa to set
*/
public void setLsEmpresa(List<Empresa> lsEmpresa) {
this.lsEmpresa = lsEmpresa;
}
}

View File

@ -0,0 +1,32 @@
/**
*
*/
package com.rjconsultores.ventaboletos.web.utilerias.menu.item.contacorrente;
import org.zkoss.util.resource.Labels;
import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria;
import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema;
/**
* @author Thiago
*
*/
public class ItemMenuRelatorioDepositosDetalhados extends DefaultItemMenuSistema {
public ItemMenuRelatorioDepositosDetalhados() {
super("indexController.mniRelatorioDepositosDetalhados.label");
}
@Override
public String getClaveMenu() {
return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIODEPOSITOSDETALHADOS";
}
@Override
public void ejecutar() {
PantallaUtileria.openWindow("/gui/relatorios/filtroRelatorioDepositosDetalhados.zul",
Labels.getLabel("indexController.mniRelatorioDepositosDetalhados.label"), getArgs() ,desktop);
}
}

View File

@ -277,6 +277,7 @@ indexController.mniPracaPedagio.label = Caseta Peaje
indexController.mniRelatorioDescontos.label = Reporte Descuentos
indexController.mniRelatorioDepositos.label=Cierre Cnt Contábil / Depósitos
indexController.mniRelatorioDepositosDetalhados.label=Depósitos Detallados
#PARTE REALIZADA POR MANUEL
indexController.mnCortesias.label = Cortesias para empleados
@ -5912,6 +5913,11 @@ relatorioVendasComissaoController.lbDataIni.value = Fecha Inicio
relatorioVendasComissaoController.lbDataFin.value = Fecha Final
relatorioVendasComissaoController.lbEmpresa.value = Empresa
# Relatorio de Depósitos Detalhados
relatorioDepositosDetalhadosController.lbDataIni.value = Fecha Inicio
relatorioDepositosDetalhadosController.lbDataFin.value = Fecha Final
relatorioDepositosDetalhadosController.lbEmpresa.value = Empresa
# Calculo Comissao
busquedaCalculoComissaoController.window.title = Cálculo de Comisión
busquedaCalculoComissaoController.lbRelatorio.value = Emisión Cálculo Reporter

View File

@ -289,6 +289,7 @@ indexController.mniPracaPedagio.label = Praça Pedágio
indexController.mniRelatorioDescontos.label = Relatório Descontos
indexController.mniRelatorioDepositos.label=Fechamento Cnt Corrente / Depósitos
indexController.mniRelatorioDepositosDetalhados.label=Depósitos Detalhados
#PARTE REALIZADA POR MANUEL
indexController.mnCortesias.label = Cortesias Para Funcionários
@ -6056,6 +6057,13 @@ relatorioVendasComissaoController.lbDataIni.value = Data Início
relatorioVendasComissaoController.lbDataFin.value = Data Final
relatorioVendasComissaoController.lbEmpresa.value = Empresa
# Relatorio de Depósitos Detalhados
relatorioDepositosDetalhadosController.lbDataIni.value = Data Início
relatorioDepositosDetalhadosController.lbDataFin.value = Data Final
relatorioDepositosDetalhadosController.lbEmpresa.value = Empresa
relatorioDepositosDetalhadosController.window.title=Depósitos Detalhados
relatorioDepositosDetalhadosController.MSG.busquedaPeriodo = Data de início posterior a data Final.
# Calculo Comissao
busquedaCalculoComissaoController.window.title = Cálculo de Comissão
busquedaCalculoComissaoController.lbRelatorio.value = Emitir Relatório de Cálculo

View File

@ -0,0 +1,47 @@
<?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="winFiltroRelatorioDepositosDetalhados"?>
<?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c"?>
<zk xmlns="http://www.zkoss.org/2005/zul">
<window id="winFiltroRelatorioDepositosDetalhados"
apply="${relatorioDepositosDetalhadosController}"
contentStyle="overflow:auto" width="700px" border="normal">
<grid fixedLayout="true">
<columns>
<column width="13%" />
<column width="37%" />
<column width="13%" />
<column width="37%" />
</columns>
<rows>
<row>
<label
value="${c:l('relatorioDepositosDetalhadosController.lbDataIni.value')}" />
<datebox id="dataInicial" width="100%" mold="rounded"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
<label
value="${c:l('relatorioDepositosDetalhadosController.lbDataFin.value')}" />
<datebox id="dataFinal" width="100%" mold="rounded"
format="dd/MM/yyyy" lenient="false" constraint="no empty"
maxlength="10" />
</row>
<row>
<label
value="${c:l('relatorioDepositosDetalhadosController.lbEmpresa.value')}" />
<combobox id="cmbEmpresa"
buttonVisible="true"
use="com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar"
model="@{winFiltroRelatorioDepositosDetalhados$composer.lsEmpresa}"
width="95%" />
</row>
</rows>
</grid>
<toolbar>
<button id="btnExecutarRelatorio" image="/gui/img/find.png"
label="${c:l('relatorio.lb.btnExecutarRelatorio')}" />
</toolbar>
</window>
</zk>