diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java index 05b36c892..f7a85024c 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java @@ -25,19 +25,19 @@ import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; * */ public class RelatorioDepositosDetalhado extends Relatorio { - + private static Logger log = Logger.getLogger(RelatorioDepositosDetalhado.class); private List lsDadosRelatorio; - + private Timestamp fecInicio; private Timestamp fecFinal; private Integer marcaId; private Integer instFinanceira; - + public RelatorioDepositosDetalhado(Map parametros, Connection conexao) throws Exception { super(parametros, conexao); - + this.setCustomDataSource(new DataSource(this) { @Override @@ -45,13 +45,13 @@ public class RelatorioDepositosDetalhado extends Relatorio { Map 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()); + if (parametros.get("MARCA_ID") != null) { + marcaId = Integer.valueOf(parametros.get("MARCA_ID").toString()); } - if(parametros.get("INST_FINANCEIRA")!=null){ - instFinanceira = Integer.valueOf(parametros.get("INST_FINANCEIRA").toString()); + if (parametros.get("INST_FINANCEIRA") != null) { + instFinanceira = Integer.valueOf(parametros.get("INST_FINANCEIRA").toString()); } - + Connection conexao = this.relatorio.getConexao(); processarDepositosDetalhados(conexao); setLsDadosRelatorio(lsDadosRelatorio); @@ -59,17 +59,18 @@ public class RelatorioDepositosDetalhado extends Relatorio { }); } + public void setLsDadosRelatorio(List lsDadosRelatorio) { this.setCollectionDataSource(new JRBeanCollectionDataSource(lsDadosRelatorio)); this.lsDadosRelatorio = lsDadosRelatorio; } - + private void processarDepositosDetalhados(Connection conexao) { ResultSet rset = null; NamedParameterStatement stmt = null; - + try { - if(lsDadosRelatorio == null) { + if (lsDadosRelatorio == null) { lsDadosRelatorio = new ArrayList(); } @@ -82,30 +83,30 @@ public class RelatorioDepositosDetalhado extends Relatorio { } 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) { + + if (fecInicio != null) { stmt.setTimestamp("fecInicio", fecInicio); } - if(fecFinal != null) { + if (fecFinal != null) { stmt.setTimestamp("fecFinal", fecFinal); } - if(marcaId != null){ + if (marcaId != null) { stmt.setInt("MARCA_ID", marcaId); } - if(instFinanceira != null){ + if (instFinanceira != null) { stmt.setInt("INST_FINANCEIRA", instFinanceira); } - return stmt; } - + private void processarResultado(ResultSet rset) throws SQLException { while (rset.next()) { RelatorioDepositosDetalhadosBean relatorioDepositosDetalhadosBean = new RelatorioDepositosDetalhadosBean(); @@ -113,7 +114,8 @@ public class RelatorioDepositosDetalhado extends Relatorio { 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.setFechaMovimiento(rset.getString("data_movimento")); + relatorioDepositosDetalhadosBean.setFechaInclusion(rset.getString("data_inclusao")); relatorioDepositosDetalhadosBean.setNumAgencia(rset.getString("Agencia")); relatorioDepositosDetalhadosBean.setNumConta(rset.getString("Conta")); relatorioDepositosDetalhadosBean.setNumDeposito(rset.getString("Numero_deposito")); @@ -121,93 +123,97 @@ public class RelatorioDepositosDetalhado extends Relatorio { lsDadosRelatorio.add(relatorioDepositosDetalhadosBean); } } + protected String getSqlPacotes() { StringBuilder sQuery = new StringBuilder(); - + sQuery.append(" SELECT "); sQuery.append(" fd.FECHAMENTODEPOSITO_ID, "); - 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.FECCREACION,'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(" E.NOMBEMPRESA Empresa, "); + sQuery.append(" PV.NOMBPUNTOVENTA Ponto_de_venda, "); + sQuery.append(" FD.NUMDEPOSITO Numero_deposito, "); + sQuery.append(" TO_CHAR(FD.FECHA_DEPOSITO, 'dd/MM/yyyy') data_deposito, "); + sQuery.append(" TO_CHAR(FC.FECFECHAMENTO, 'dd/MM/yyyy') data_movimento, "); + sQuery.append(" TO_CHAR(FD.FECCREACION, 'dd/MM/yyyy') data_inclusao, "); + 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(" JOIN EMPRESA_CONTABANCARIA ec "); + sQuery.append(" JOIN EMPRESA_CONTABANCARIA ec "); sQuery.append(" ON "); sQuery.append(" fd.EMPRESACONTABANCARIA_ID = EC.EMPRESACONTABANCARIA_ID "); - sQuery.append(" JOIN INSTI_FINANCEIRA IF "); - sQuery.append(" ON "); - sQuery.append(" EC.INSTIFINANCEIRA_ID = if.INSTIFINANCEIRA_ID "); - sQuery.append(" "); - 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(" JOIN INSTI_FINANCEIRA IF "); + sQuery.append(" ON "); + sQuery.append(" EC.INSTIFINANCEIRA_ID = if.INSTIFINANCEIRA_ID "); + sQuery.append(" "); + 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 "); - } - if(parametros.get("INST_FINANCEIRA")!= null){ + } + if (parametros.get("INST_FINANCEIRA") != null) { sQuery.append(" and if.INSTIFINANCEIRA_ID =:INST_FINANCEIRA "); } sQuery.append(" and FD.FECCREACION between :fecInicio and :fecFinal"); - sQuery.append(" GROUP BY "); + sQuery.append(" GROUP BY "); sQuery.append(" fd.FECHAMENTODEPOSITO_ID, "); - sQuery.append(" E.NOMBEMPRESA, "); - sQuery.append(" PV.NOMBPUNTOVENTA, "); - sQuery.append(" FD.FECHA_DEPOSITO, "); - sQuery.append(" FD.NUMDEPOSITO, "); - sQuery.append(" FD.FECCREACION, "); - sQuery.append(" if.NOME, "); - sQuery.append(" EC.NUMCONTA, "); - sQuery.append(" EC.NUMAGENCIA, "); - sQuery.append(" FD.VALOR "); + sQuery.append(" E.NOMBEMPRESA, "); + sQuery.append(" PV.NOMBPUNTOVENTA, "); + sQuery.append(" FD.FECHA_DEPOSITO, "); + sQuery.append(" FD.NUMDEPOSITO, "); + sQuery.append(" FC.FECFECHAMENTO, "); + sQuery.append(" FD.FECCREACION, "); + 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(" E.NOMBEMPRESA, "); sQuery.append(" PV.NOMBPUNTOVENTA, "); sQuery.append(" FD.FECCREACION, "); - sQuery.append(" FD.FECHA_DEPOSITO, "); - sQuery.append(" FD.NUMDEPOSITO, "); - sQuery.append(" if.NOME, "); - sQuery.append(" EC.NUMCONTA, "); - sQuery.append(" EC.NUMAGENCIA, "); + sQuery.append(" FD.FECHA_DEPOSITO, "); + sQuery.append(" FD.NUMDEPOSITO, "); + sQuery.append(" if.NOME, "); + sQuery.append(" EC.NUMCONTA, "); + sQuery.append(" EC.NUMAGENCIA, "); sQuery.append(" FD.VALOR "); - return sQuery.toString(); + return sQuery.toString(); } - + private void fecharConexaoBanco(NamedParameterStatement stmt, ResultSet rset) { try { - if(rset != null) { + if (rset != null) { rset.close(); } - if(stmt != null) { + if (stmt != null) { stmt.close(); } } catch (SQLException e) { log.error(e.getMessage(), e); } } + @Override protected void processaParametros() throws Exception { - + } } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_es.properties index 138da0824..b086c03f9 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_es.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_es.properties @@ -15,7 +15,8 @@ cabecalho.usuario=Usu label.nombPuntoVenta=Punto Venta label.fechaDeposito=Fecha Deposito label.numDeposito=N\u00B0 Deposito -label.fechaLancamientoDeposito=Lanzamiento +label.fechaLancamientoDeposito=Fec. Movimiento +label.fechaInclusion=Fec. Inclusion label.banco=Banco label.numConta=Cuenta label.numAgencia=Agencia diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_pt_BR.properties index a7f7168c5..5332650be 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositosDetalhado_pt_BR.properties @@ -15,7 +15,8 @@ cabecalho.usuario=Usu label.nombPuntoVenta=Nome Agência label.fechaDeposito=Data do Dep\u00F3sito label.numDeposito=N\u00B0 do Dep\u00F3sito -label.fechaLancamientoDeposito=Lan\u00E7amento +label.fechaLancamientoDeposito=Dt. Movimento +label.fechaInclusion=Dt. Inclusão label.banco=Banco label.numConta=Conta label.numAgencia=Ag\u00EAncia diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper index c6e3f2dea..ea9899ab0 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml index 90b1109aa..86dc4d66b 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml @@ -1,6 +1,6 @@ - + @@ -14,12 +14,13 @@ - + + @@ -86,55 +87,73 @@ - + - - + + + + - - + + + + - - + + + + - + + + - + + + - - + + + + - + + + - + + + - - - - - + + + + + + + @@ -145,7 +164,7 @@ - + @@ -155,19 +174,9 @@ - + - - - - - - - - - - - + @@ -179,10 +188,20 @@ - - + + - + + + + + + + + + + + @@ -210,7 +229,7 @@ - + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositosDetalhadosBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositosDetalhadosBean.java index 51fda4c83..ed80e6abf 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositosDetalhadosBean.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositosDetalhadosBean.java @@ -10,81 +10,103 @@ import java.math.BigDecimal; * */ public class RelatorioDepositosDetalhadosBean { - + private String empresa; private String nombPuntoVenta; private String fechaDeposito; private String numDeposito; - private String fechaLancamientoDeposito; + private String fechaMovimiento; + private String fechaInclusion; 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 + * @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 String getFechaMovimiento() { + return fechaMovimiento; } - public void setFechaLancamientoDeposito(String fechaLancamientoDeposito) { - this.fechaLancamientoDeposito = fechaLancamientoDeposito; + + public void setFechaMovimiento(String fechaMovimiento) { + this.fechaMovimiento = fechaMovimiento; } + + public String getFechaInclusion() { + return fechaInclusion; + } + + public void setFechaInclusion(String fechaInclusion) { + this.fechaInclusion = fechaInclusion; + } + 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; } - - - - - - }