diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java index f832bfc71..d6b27f2fb 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositosDetalhado.java @@ -33,6 +33,7 @@ public class RelatorioDepositosDetalhado extends Relatorio { private Timestamp fecInicio; private Timestamp fecFinal; private Integer marcaId; + private Integer instFinanceira; public RelatorioDepositosDetalhado(Map parametros, Connection conexao) throws Exception { super(parametros, conexao); @@ -47,6 +48,9 @@ public class RelatorioDepositosDetalhado extends Relatorio { 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()); + } Connection conexao = this.relatorio.getConexao(); processarDepositosDetalhados(conexao); @@ -95,6 +99,9 @@ public class RelatorioDepositosDetalhado extends Relatorio { if(marcaId != null){ stmt.setInt("MARCA_ID", marcaId); } + if(instFinanceira != null){ + stmt.setInt("INST_FINANCEIRA", instFinanceira); + } return stmt; } @@ -118,73 +125,76 @@ public class RelatorioDepositosDetalhado extends Relatorio { 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 "); + 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(" JOIN INSTI_FINANCEIRA IF "); + sQuery.append(" ON "); + sQuery.append(" if.INSTIFINANCEIRA_ID = FD.INSTIFINANCEIRA_ID "); + sQuery.append(" JOIN EMPRESA_CONTABANCARIA ec "); + sQuery.append(" ON "); + sQuery.append(" EC.EMPRESA_ID = FC.EMPRESA_ID "); + sQuery.append(" AND EC.INSTIFINANCEIRA_ID = if.INSTIFINANCEIRA_ID "); + sQuery.append(" AND EC.ACTIVO = 1 "); + sQuery.append(" 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 EC.EMPRESACONTABANCARIA_ID = PVE.EMPRESACONTABANCARIA_ID "); + sQuery.append(" AND PVE.activo = 1 "); + 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 e.empresa_id =:MARCA_ID "); + } + if(parametros.get("INST_FINANCEIRA")!= null){ + sQuery.append(" and if.INSTIFINANCEIRA_ID =:INST_FINANCEIRA "); } 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 "); - + 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(" FD.FECHA_DEPOSITO, "); + sQuery.append(" FD.FECMODIF, "); + sQuery.append(" E.NOMBEMPRESA, "); + 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(); } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jasper index c262af989..d6ca013f6 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 770e73cc6..8c40c9706 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositosDetalhado.jrxml @@ -1,12 +1,13 @@ - + + @@ -26,7 +27,7 @@ - <band height="61" splitType="Stretch"> + <band height="82" splitType="Stretch"> <textField> <reportElement uuid="43b2c28d-4760-4890-b00d-25e931e79c74" x="0" y="0" width="620" height="20"/> <textElement markup="none"> @@ -58,6 +59,16 @@ <textElement/> <text><![CDATA[Empresa:]]></text> </staticText> + <textField> + <reportElement uuid="a0d7c1c5-7a17-477e-929a-b0d9665b409c" x="53" y="61" width="263" height="20"/> + <textElement/> + <textFieldExpression><![CDATA[$P{banco}]]></textFieldExpression> + </textField> + <staticText> + <reportElement uuid="2a1c0967-7154-4aa5-bc93-577d682a1e5a" x="0" y="61" width="53" height="20"/> + <textElement/> + <text><![CDATA[Banco:]]></text> + </staticText> </band> diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java index fd097c542..32b93d562 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioArquivoBGMController.java @@ -29,7 +29,6 @@ import com.rjconsultores.integracaoreceitadespesa.dao.Totalbus; import com.rjconsultores.ventaboletos.entidad.Empresa; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEmpresa; -import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxParada; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxPuntoVenta; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -124,7 +123,8 @@ public class RelatorioArquivoBGMController extends MyGenericForwardComposer { origem.close(); saida.close(); } catch(IOException e) { - throw new IOException(e.getMessage()); + log.error(e.getMessage()); + throw new IOException(e.getMessage()); } } diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDepositosDetalhadosController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDepositosDetalhadosController.java index 07c483cc2..99c55db5a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDepositosDetalhadosController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/relatorios/RelatorioDepositosDetalhadosController.java @@ -23,9 +23,11 @@ import org.zkoss.zul.Datebox; import org.zkoss.zul.Messagebox; import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.entidad.InstiFinanceira; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDepositosDetalhado; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; import com.rjconsultores.ventaboletos.service.EmpresaService; +import com.rjconsultores.ventaboletos.service.InstiFinanceiraService; import com.rjconsultores.ventaboletos.utilerias.DateUtil; import com.rjconsultores.ventaboletos.web.utilerias.MyComboboxEstandar; import com.rjconsultores.ventaboletos.web.utilerias.MyGenericForwardComposer; @@ -46,8 +48,13 @@ private static final long serialVersionUID = 1L; @Autowired private EmpresaService empresaService; + @Autowired + private InstiFinanceiraService ptovtaBancoService; + private MyComboboxEstandar cmbEmpresa; private List lsEmpresa; + private MyComboboxEstandar cmbBanco; + private List lsBanco; private Datebox dataInicial; private Datebox dataFinal; @@ -55,6 +62,7 @@ private static final long serialVersionUID = 1L; @Override public void doAfterCompose(Component comp) throws Exception { setLsEmpresa(empresaService.obtenerTodos()); + setLsBanco(ptovtaBancoService.obtenerTodos()); super.doAfterCompose(comp); } @@ -63,6 +71,7 @@ private static final long serialVersionUID = 1L; Date dataDe = dataInicial.getValue(); Date dataAte = dataFinal.getValue(); + Timestamp fecVentaInicial = new Timestamp(DateUtil.inicioFecha(dataDe).getTime()); Timestamp fecVentaFinal = new Timestamp(DateUtil.fimFecha(dataAte).getTime()); @@ -82,6 +91,7 @@ private static final long serialVersionUID = 1L; parametros.put("dataFiltroFinal", fecVentaFinal); Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { Empresa empresa = (Empresa) itemEmpresa.getValue(); parametros.put("MARCA_ID", empresa.getEmpresaId()); @@ -89,6 +99,14 @@ private static final long serialVersionUID = 1L; } else{ parametros.put("empresa", "Todas;"); } + Comboitem itemBanco = cmbBanco.getSelectedItem(); + if (itemBanco != null) { + InstiFinanceira banco = (InstiFinanceira) itemBanco.getValue(); + parametros.put("INST_FINANCEIRA", banco.getInstFinanceiraId()); + parametros.put("banco", banco.getNome()); + } else{ + parametros.put("banco", "Todos;"); + } Relatorio relatorio = new RelatorioDepositosDetalhado(parametros, dataSourceRead.getConnection()); @@ -113,4 +131,18 @@ private static final long serialVersionUID = 1L; this.lsEmpresa = lsEmpresa; } + /** + * @return the lsBanco + */ + public List getLsBanco() { + return lsBanco; + } + + /** + * @param lsBanco the lsBanco to set + */ + public void setLsBanco(List lsBanco) { + this.lsBanco = lsBanco; + } + } diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index 45aa9e8a1..e45ebfd02 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -5931,6 +5931,9 @@ relatorioVendasComissaoController.lbEmpresa.value = Empresa relatorioDepositosDetalhadosController.lbDataIni.value = Fecha Inicio relatorioDepositosDetalhadosController.lbDataFin.value = Fecha Final relatorioDepositosDetalhadosController.lbEmpresa.value = Empresa +relatorioDepositosDetalhadosController.lbBanco.value = Banco +relatorioDepositosDetalhadosController.window.title=Depositos Detallados +relatorioDepositosDetalhadosController.MSG.busquedaPeriodo = Fecha de inicio retrasado hasta la fecha final. # Calculo Comissao busquedaCalculoComissaoController.window.title = Cálculo de Comisión diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index c4e21048b..2f9ea5238 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -6074,6 +6074,7 @@ relatorioVendasComissaoController.lbEmpresa.value = Empresa relatorioDepositosDetalhadosController.lbDataIni.value = Data Início relatorioDepositosDetalhadosController.lbDataFin.value = Data Final relatorioDepositosDetalhadosController.lbEmpresa.value = Empresa +relatorioDepositosDetalhadosController.lbBanco.value = Banco relatorioDepositosDetalhadosController.window.title=Depósitos Detalhados relatorioDepositosDetalhadosController.MSG.busquedaPeriodo = Data de início posterior a data Final. diff --git a/web/gui/relatorios/filtroRelatorioDepositosDetalhados.zul b/web/gui/relatorios/filtroRelatorioDepositosDetalhados.zul index 78b537546..37127d060 100644 --- a/web/gui/relatorios/filtroRelatorioDepositosDetalhados.zul +++ b/web/gui/relatorios/filtroRelatorioDepositosDetalhados.zul @@ -37,6 +37,12 @@ model="@{winFiltroRelatorioDepositosDetalhados$composer.lsEmpresa}" width="95%" /> + +