diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositos.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositos.java index cc014398d..44bea9b9c 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositos.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioDepositos.java @@ -9,14 +9,14 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; - 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.RelatorioDepositoBean; +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + public class RelatorioDepositos extends Relatorio { private static Logger log = Logger.getLogger(RelatorioDepositos.class); @@ -38,6 +38,7 @@ public class RelatorioDepositos extends Relatorio { Integer puntoventaId = parametros.get("puntoventaId") != null ? Integer.parseInt(parametros.get("puntoventaId").toString()) : null; Integer empresaId = parametros.get("empresaId") != null ? Integer.parseInt(parametros.get("empresaId").toString()) : null; Boolean filtrarPendentes = parametros.get("filtrarPendentes") != null ? Boolean.parseBoolean(parametros.get("filtrarPendentes").toString()) : false; + Boolean isClassificaPorBanco = parametros.get("isClassificaPorBanco") != null ? Boolean.parseBoolean(parametros.get("isClassificaPorBanco").toString()) : false; String fecInicio = parametros.get("fecInicio").toString() + " 00:00:00"; String fecFinal = parametros.get("fecFinal").toString() + " 23:59:59"; @@ -66,6 +67,11 @@ public class RelatorioDepositos extends Relatorio { deposito.setVrdeposito(rs.getBigDecimal(6)); deposito.setVrfechamento(rs.getBigDecimal(7)); deposito.setNumdeposito(rs.getString(8)); + // Se checkbox no estiver marcado no preenche este campo e relatrio no ir agrupar por nome banco + if (isClassificaPorBanco) { + deposito.setCodigoInstFinanceira(rs.getString(9)); + deposito.setNomeInstFinanceira(rs.getString(10)); + } lsDadosRelatorio.add(deposito); } @@ -100,15 +106,9 @@ public class RelatorioDepositos extends Relatorio { sql.append(" tmp.saldo, "); sql.append(" tmp.vrfechamento, "); sql.append(" tmp.vrdeposito, "); - sql.append(" COALESCE( "); - sql.append(" (SELECT UNIQUE LISTAGG( fdep.NUMDEPOSITO, '/') WITHIN GROUP ( "); - sql.append(" ORDER BY fdep.NUMDEPOSITO) as NUMDEPOSITO "); - sql.append(" FROM fechamento_cntcorrente fcnt "); - sql.append(" LEFT JOIN Fechamento_deposito fdep "); - sql.append(" ON fcnt.FECHAMENTOCNTCORRENTE_ID = fdep.FECHAMENTOCNTCORRENTE_ID "); - sql.append(" WHERE fcnt.FECHAMENTOCNTCORRENTE_ID = tmp.FECHAMENTOCNTCORRENTE_ID "); - sql.append(" GROUP BY fcnt.FECHAMENTOCNTCORRENTE_ID "); - sql.append(" ), ' ') AS numdeposito "); + sql.append(" tmp.numdeposito, "); + sql.append(" tmp.codinstfin, "); + sql.append(" tmp.nomeinstfin "); sql.append(" FROM "); sql.append(" ( SELECT DISTINCT e.nombempresa, "); sql.append(" p.nombpuntoventa, "); @@ -117,16 +117,30 @@ public class RelatorioDepositos extends Relatorio { sql.append(" ( SUM(NVL(fd.valor_pago,0)) - f.total ) AS saldo, "); sql.append(" SUM(NVL(fd.valor_pago,0)) AS vrfechamento , "); sql.append(" f.total AS vrdeposito, "); - sql.append(" fd.FECHAMENTOCNTCORRENTE_ID "); + sql.append(" f.FECHAMENTOCNTCORRENTE_ID, "); + sql.append(" fdp.NUMDEPOSITO as numdeposito, "); + sql.append(" ifin.CODIGO as codinstfin, "); + sql.append(" ifin.NOME as nomeinstfin "); sql.append(" FROM fechamento_cntcorrente f "); - sql.append(" INNER JOIN punto_venta p "); + // Join com PuntoVenta + sql.append(" LEFT JOIN punto_venta p "); sql.append(" ON p.puntoventa_id = f.puntoventa_id "); - sql.append(" INNER JOIN empresa e "); + // Join com empresa + sql.append(" LEFT JOIN empresa e "); sql.append(" ON e.empresa_id = f.empresa_id "); + // Join com fechamento_cct_deposito sql.append(" LEFT JOIN fechamento_cct_deposito fd "); sql.append(" ON fd.fechamentocntcorrente_id = f.fechamentocntcorrente_id "); - sql.append(" AND fd.activo = 1 "); - sql.append(" WHERE f.fecfechamento BETWEEN ? AND ?"); + // Join com FECHAMENTO_DEPOSITO + sql.append(" LEFT JOIN FECHAMENTO_DEPOSITO fdp "); + sql.append(" ON fdp.FECHAMENTODEPOSITO_ID = fd.FECHAMENTODEPOSITO_ID "); + // Join com empresa_contabancaria + sql.append(" LEFT JOIN empresa_contabancaria ecb "); + sql.append(" ON ecb.EMPRESACONTABANCARIA_ID = fdp.EMPRESACONTABANCARIA_ID "); + // Join com INSTI_FINANCEIRA + sql.append(" LEFT JOIN INSTI_FINANCEIRA ifin "); + sql.append(" ON ifin.INSTIFINANCEIRA_ID = ecb.INSTIFINANCEIRA_ID "); + sql.append(" WHERE f.fecfechamento BETWEEN ? AND ? "); sql.append(" AND f.activo = 1 "); if (puntoVentaId != null){ @@ -135,23 +149,24 @@ public class RelatorioDepositos extends Relatorio { if (empresaId != null){ sql.append(" and e.empresa_id = " + empresaId); } - sql.append(" GROUP BY e.nombempresa, "); sql.append(" p.nombpuntoventa, "); sql.append(" p.numpuntoventa, "); sql.append(" f.fecfechamento, "); - sql.append(" fd.FECHAMENTOCNTCORRENTE_ID, "); - sql.append(" f.total ) tmp "); + sql.append(" f.FECHAMENTOCNTCORRENTE_ID, "); + sql.append(" f.total, "); + sql.append(" fdp.NUMDEPOSITO, "); + sql.append(" ifin.CODIGO, "); + sql.append(" ifin.NOME ) tmp "); if (filtrarPendentes){ sql.append(" where "); sql.append(" tmp.saldo < tmp.vrdeposito and tmp.saldo <> 0"); } - sql.append(" ORDER BY tmp.nombempresa, "); + sql.append(" tmp.nomeinstfin, "); sql.append(" tmp.nombpuntoventa, "); sql.append(" tmp.dtmotivo, "); sql.append(" tmp.vrdeposito "); - return sql.toString(); } } diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_es .properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_es .properties index 13bb7fa2f..d78f844db 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_es .properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_es .properties @@ -9,7 +9,8 @@ header.banco=Banco header.numdeposito=N Depsito header.dataDeposito=Data header.valorDeposito=Valor - +header.empresa=Empresa: +header.data=Perodo: header.agencia=Agncia header.dtmotivo=Data Fechamento header.saldo=Pendente diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_pt_BR.properties index 410d3bb32..aba860115 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_pt_BR.properties +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioDepositos_pt_BR.properties @@ -9,7 +9,8 @@ header.banco=Banco header.numdeposito=N Depsito header.dataDeposito=Data header.valorDeposito=Valor - +header.empresa=Empresa: +header.data=Perodo: header.agencia=Agncia header.dtmotivo=Data Fechamento header.saldo=Pendente diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jasper index 7dec872fe..3f6a0bd47 100644 Binary files a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jasper and b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jasper differ diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jrxml b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jrxml index 35ace90d5..ba11038e6 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jrxml +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.jrxml @@ -1,8 +1,8 @@ - - - + + + @@ -19,6 +19,8 @@ + + @@ -28,15 +30,50 @@ + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + @@ -44,7 +81,13 @@ - + + + + + + + @@ -52,40 +95,27 @@ - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -93,57 +123,101 @@ - + + + + + + + - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + - + - + + @@ -151,20 +225,23 @@ + - + + - + + @@ -172,13 +249,15 @@ + - + + @@ -186,6 +265,7 @@ + @@ -193,12 +273,15 @@ - - - - + - + + + + + + + @@ -206,7 +289,13 @@ - + + + + + + + @@ -214,7 +303,13 @@ - + + + + + + + @@ -222,7 +317,13 @@ - + + + + + + + @@ -230,7 +331,13 @@ - + + + + + + + @@ -238,33 +345,27 @@ - - + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + @@ -276,42 +377,42 @@ - - + + - + - - + + - + - - + + - + diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.pdf b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.pdf new file mode 100644 index 000000000..c7ffbfe52 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioDepositos.pdf @@ -0,0 +1,51 @@ +%PDF-1.4 +% +3 0 obj +<>stream +xn0y9Y86GEꉟ@x; +뱼ڭoU7/Fn^ͻFWῦVK ų>^~_@Fgdk [(B )3wȮn:J&ݏ~RaIPg2tWB@½NӌC_;(Z oWP;xs?6jV}ܿmҭM!)M;fO!! ),T0}"H ʛg!e| +G!`t#Gsʛg!e GBGѴty,,֑\XaQh>̑8r*Q*o;rExQQ:JͳXG>paEɝ-@Őͼ"oE9=9=hCjB_d aaUPa$.?S+_8BY3!âJgG+ 1:Ӫ +(~xV0xaFсUW@dK%ų#'U̮0Ɍ)~m=4DVk0sRzN? G*Q9pW_3J"ëQu9|ގþFaI`-t/[_=*+.NA +endstream +endobj +1 0 obj +<>/Parent 4 0 R/Contents 3 0 R/Type/Page/Resources<>/Font<>>>/MediaBox[0 0 595 842]>> +endobj +5 0 obj +[1 0 R/XYZ 0 852 0] +endobj +2 0 obj +<> +endobj +4 0 obj +<> +endobj +6 0 obj +<> +endobj +7 0 obj +<> +endobj +8 0 obj +<>/Pages 4 0 R>> +endobj +9 0 obj +<> +endobj +xref +0 10 +0000000000 65535 f +0000000763 00000 n +0000001032 00000 n +0000000015 00000 n +0000001120 00000 n +0000000997 00000 n +0000001183 00000 n +0000001237 00000 n +0000001269 00000 n +0000001372 00000 n +trailer +<<636b874ee70d10c4927e6e7bb9b3d064>]/Info 9 0 R/Size 10>> +startxref +1539 +%%EOF diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositoBean.java b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositoBean.java index b186e40e5..38bdc3b3c 100644 --- a/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositoBean.java +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/utilitarios/RelatorioDepositoBean.java @@ -12,6 +12,24 @@ public class RelatorioDepositoBean { private Date dtmotivo; private String numdeposito; private String numpuntoventa; + private String codigoInstFinanceira; + private String nomeInstFinanceira; + + public String getCodigoInstFinanceira() { + return codigoInstFinanceira; + } + + public void setCodigoInstFinanceira(String codigoInstFinanceira) { + this.codigoInstFinanceira = codigoInstFinanceira; + } + + public String getNomeInstFinanceira() { + return nomeInstFinanceira; + } + + public void setNomeInstFinanceira(String nomeInstFinanceira) { + this.nomeInstFinanceira = nomeInstFinanceira; + } public String getNombpuntoventa() { return nombpuntoventa; diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/contacorrente/RelatorioDepositosController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/contacorrente/RelatorioDepositosController.java index 67231454f..15c9bc104 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/contacorrente/RelatorioDepositosController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/contacorrente/RelatorioDepositosController.java @@ -2,7 +2,6 @@ package com.rjconsultores.ventaboletos.web.gui.controladores.contacorrente; import java.text.SimpleDateFormat; import java.util.HashMap; -import java.util.List; import java.util.Map; import javax.sql.DataSource; @@ -12,35 +11,16 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import org.zkoss.util.resource.Labels; -import org.zkoss.zhtml.Messagebox; -import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; -import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zul.Checkbox; import org.zkoss.zul.Combobox; -import org.zkoss.zul.Paging; -import org.zkoss.zul.Textbox; import org.zkoss.zul.api.Datebox; -import com.rjconsultores.ventaboletos.entidad.Cortesia; import com.rjconsultores.ventaboletos.entidad.Empresa; -import com.rjconsultores.ventaboletos.entidad.MotivoViaje; import com.rjconsultores.ventaboletos.entidad.PuntoVenta; -import com.rjconsultores.ventaboletos.entidad.TipoCortesia; -import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAgenciasNaoImportadas; import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioDepositos; import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; -import com.rjconsultores.ventaboletos.service.MotivoViajeService; -import com.rjconsultores.ventaboletos.service.PuntoVentaService; -import com.rjconsultores.ventaboletos.service.TipoCortesiaService; -import com.rjconsultores.ventaboletos.service.impl.CortesiaServiceImpl; -import com.rjconsultores.ventaboletos.web.gui.controladores.relatorios.RelatorioAgenciasNaoImportadasController; 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.RenderCortesia; -import com.trg.search.Filter; @Controller("relatorioDepositosController") @Scope("prototype") @@ -49,8 +29,6 @@ public class RelatorioDepositosController extends MyGenericForwardComposer { private static final long serialVersionUID = 1L; private static Logger log = Logger.getLogger(RelatorioDepositosController.class); - @Autowired - private PuntoVentaService puntoVentaService; @Autowired private DataSource dataSourceRead; @@ -59,7 +37,8 @@ public class RelatorioDepositosController extends MyGenericForwardComposer { private Combobox cmbPuntoventa; private Combobox cmbEmpresa; private Checkbox chkFiltrarPendentes; - + private Checkbox chkClassificarBanco; + private void executarRelatorio() throws Exception { Map parametros = new HashMap(); @@ -77,6 +56,10 @@ public class RelatorioDepositosController extends MyGenericForwardComposer { parametros.put("filtrarPendentes", true); } + if (chkClassificarBanco.isChecked()) { + parametros.put("isClassificaPorBanco", true); + } + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy"); parametros.put("fecInicio", sdf.format(this.datInicial.getValue())); parametros.put("fecFinal", sdf.format(this.datFinal.getValue())); @@ -89,11 +72,28 @@ public class RelatorioDepositosController extends MyGenericForwardComposer { args.put("relatorio", relatorio); openWindow("/component/reportView.zul", - Labels.getLabel("indexController.mniRelatorioDepositos.label"), args, MODAL); + Labels.getLabel("indexController.mniRelatorioDepositos.label"), args, MyGenericForwardComposer.MODAL); } + public void onClick$chkFiltrarPendentes() { + if (chkFiltrarPendentes.isChecked()) { + chkClassificarBanco.setDisabled(false); + } else { + chkClassificarBanco.setChecked(false); + chkClassificarBanco.setDisabled(true); + } + } + public void onClick$btnExecutarRelatorio(Event ev) throws Exception { executarRelatorio(); } + + public Checkbox getChkClassificarBanco() { + return chkClassificarBanco; + } + + public void setChkClassificarBanco(Checkbox chkClassificarBanco) { + this.chkClassificarBanco = chkClassificarBanco; + } }