From c1b0bfe0c81ff3edc9e8f244b790bafb57e607d9 Mon Sep 17 00:00:00 2001 From: julio Date: Wed, 30 Mar 2016 20:36:52 +0000 Subject: [PATCH] bug #6817 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@54379 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../impl/RelatorioAnaliticoFinanceiro.java | 169 ++++++++++++++++++ ...RelatorioAnaliticoFinanceiro_es.properties | 2 + ...atorioAnaliticoFinanceiro_pt_BR.properties | 2 + .../RelatorioAnaliticoFinanceiro.jasper | Bin 0 -> 26776 bytes .../RelatorioAnaliticoFinanceiro.jrxml | 165 +++++++++++++++++ .../BusquedaImportacionFiscalController.java | 45 ++++- .../impressaofiscal/TipoImportacaoFiscal.java | 16 +- .../ItemMenuFiscalRelatorioFinanceiro.java | 33 ++++ .../SubMenuRelatorioFiscalRelatorios.java | 16 ++ web/WEB-INF/i3-label_pt_BR.label | 2 +- .../busquedaImportacionFiscal.zul | 4 + 11 files changed, 450 insertions(+), 4 deletions(-) create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAnaliticoFinanceiro.java create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_es.properties create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_pt_BR.properties create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAnaliticoFinanceiro.jasper create mode 100644 src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAnaliticoFinanceiro.jrxml create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/ItemMenuFiscalRelatorioFinanceiro.java create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/SubMenuRelatorioFiscalRelatorios.java diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAnaliticoFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAnaliticoFinanceiro.java new file mode 100644 index 000000000..ae4e51404 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/impl/RelatorioAnaliticoFinanceiro.java @@ -0,0 +1,169 @@ +package com.rjconsultores.ventaboletos.relatorios.impl; + +import java.sql.Connection; +import java.sql.PreparedStatement; +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.log4j.Logger; + +import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.DataSource; +import com.rjconsultores.ventaboletos.relatorios.utilitarios.Relatorio; +import com.rjconsultores.ventaboletos.utilerias.DateUtil; +import com.rjconsultores.ventaboletos.vo.impressaofiscal.ItemRelatorioFinanceiro; + +import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource; + +public class RelatorioAnaliticoFinanceiro extends Relatorio { + + private static Logger log = Logger.getLogger(RelatorioAnaliticoFinanceiro.class); + + List listdata = null; + + public RelatorioAnaliticoFinanceiro(final Map parametros, Connection conexao) throws Exception { + super(parametros, conexao); + + this.setCustomDataSource(new DataSource(this) { + @Override + public void initDados() throws Exception { + + try { + Date inicio = (Date) parametros.get("inicio"); + Date fim = (Date) parametros.get("fim"); + Empresa empresa = (Empresa) parametros.get("empresa"); + + listdata = buscarMovimentosAnaliticos(inicio, fim, empresa.getEmpresaId()); + + } catch (SQLException e) { + log.error("", e); + } + } + + }); + + this.setCollectionDataSource(new JRBeanCollectionDataSource(listdata)); + } + + public List buscarMovimentosAnaliticos(Date inicio, Date fim, Integer empresaId) throws SQLException { + + inicio = DateUtil.inicioFecha(inicio); + fim = DateUtil.fimFecha(fim); + + StringBuilder sql = new StringBuilder(); + sql.append("select "); + sql.append("'FINANCEIRA' as movimentacao, "); + sql.append("caja.descripcionEmpresa as empresa, "); + sql.append("sum(caja.importe + caja.importeCancelacion) as valorEnCaja, "); + sql.append("case when caja.indstatusboleto = 'E' or caja.tipoVentaId IN (5,12,18) THEN 'VOUCHER' "); + sql.append(" when caja.tipoVentaId = 3 THEN 'MANUAL' "); + sql.append(" when caja.indstatusboleto = 'V' THEN 'NORMAL' "); + sql.append(" when caja.indstatusboleto = 'C' THEN 'CANCELAMENTO' "); + sql.append(" when caja.indstatusboleto = 'T' THEN 'TROCA' "); + sql.append(" ELSE 'OUTRO' END tipoVenta "); + sql.append("from "); + sql.append("( "); + sql.append("select "); + sql.append(" e.NOMBEMPRESA as descripcionEmpresa, "); + sql.append(" c.FECHORVENTA as fechorVenta, "); + sql.append(" case when c.MOTIVOCANCELACION_ID is null then cfp.IMPORTE else 0 end as importe, "); + sql.append(" case when c.MOTIVOCANCELACION_ID is null then 0 else cfp.IMPORTE * -1 end as importeCancelacion, "); + sql.append(" c.INDREIMPRESION as indReimpresion, "); + sql.append(" c.TIPOVENTA_ID as tipoVentaId, "); + sql.append(" c.indstatusboleto as indstatusboleto "); + sql.append("from "); + sql.append(" CAJA c "); + sql.append("inner join CAJA_FORMAPAGO cfp on c.CAJA_ID=cfp.CAJA_ID and cfp.activo = 1 "); + sql.append("inner join FORMA_PAGO fp on cfp.FORMAPAGO_ID=fp.FORMAPAGO_ID "); + sql.append("INNER join EMPRESA e on c.MARCA_ID = e.EMPRESA_ID "); + sql.append(" "); + sql.append("where c.FECHORVENTA BETWEEN ? AND ? "); + sql.append(" and c.TIPOVENTA_ID<> 6 "); + sql.append(" and e.EMPRESA_ID= ? "); + sql.append(" ) caja "); + sql.append("where caja.indReimpresion = 0 "); + sql.append("group by caja.descripcionEmpresa, "); + sql.append("case when caja.indstatusboleto = 'E' or caja.tipoVentaId IN (5,12,18) THEN 'VOUCHER' "); + sql.append(" when caja.tipoVentaId = 3 THEN 'MANUAL' "); + sql.append(" when caja.indstatusboleto = 'V' THEN 'NORMAL' "); + sql.append(" when caja.indstatusboleto = 'C' THEN 'CANCELAMENTO' "); + sql.append(" when caja.indstatusboleto = 'T' THEN 'TROCA' "); + sql.append(" ELSE 'OUTRO' END "); + sql.append(" "); + sql.append(" UNION "); + sql.append(" "); + sql.append("select "); + sql.append("'FISCAL' as movimentacao, "); + sql.append("caja.descripcionEmpresa as empresa, "); + sql.append("sum(caja.importe + caja.importeCancelacion) as valorEnCaja, "); + sql.append("case when caja.indstatusboleto = 'E' or caja.tipoVentaId IN (5,12,18) THEN 'IMPRESSÃO VOUCHER' "); + sql.append(" when caja.tipoVentaId = 3 THEN 'MANUAL' "); + sql.append(" when caja.indstatusboleto = 'V' THEN 'NORMAL' "); + sql.append(" when caja.indstatusboleto = 'C' THEN 'CANCELAMENTO' "); + sql.append(" when caja.indstatusboleto = 'T' THEN 'TROCA' "); + sql.append(" ELSE 'OUTRO' END TIPO_VENDA "); + sql.append("from "); + sql.append("( "); + sql.append("select "); + sql.append(" e.NOMBEMPRESA as descripcionEmpresa, "); + sql.append(" c.FECHORVENTA as fechorVenta, "); + sql.append(" case when c.MOTIVOCANCELACION_ID is null then cfp.IMPORTE else 0 end as importe, "); + sql.append(" case when c.MOTIVOCANCELACION_ID is null then 0 else cfp.IMPORTE * -1 end as importeCancelacion, "); + sql.append(" c.INDREIMPRESION as indReimpresion, "); + sql.append(" c.TIPOVENTA_ID as tipoVentaId, "); + sql.append(" c.indstatusboleto as indstatusboleto "); + sql.append("from "); + sql.append(" CAJA c "); + sql.append("inner join CAJA_FORMAPAGO cfp on c.CAJA_ID=cfp.CAJA_ID and cfp.activo = 1 "); + sql.append("inner join FORMA_PAGO fp on cfp.FORMAPAGO_ID=fp.FORMAPAGO_ID "); + sql.append("INNER join EMPRESA e on c.MARCA_ID = e.EMPRESA_ID "); + sql.append("inner join FISCAL_R4 FR4 ON FR4.CAJA_ID = c.CAJA_ID "); + sql.append(" "); + sql.append("where c.FECHORVENTA BETWEEN ? AND ? "); + sql.append(" and c.TIPOVENTA_ID<>6 "); + sql.append(" and e.EMPRESA_ID= ? "); + sql.append(" ) caja "); + sql.append("group by caja.descripcionEmpresa, "); + sql.append("case when caja.indstatusboleto = 'E' or caja.tipoVentaId IN (5,12,18) THEN 'IMPRESSÃO VOUCHER' "); + sql.append(" when caja.tipoVentaId = 3 THEN 'MANUAL' "); + sql.append(" when caja.indstatusboleto = 'V' THEN 'NORMAL' "); + sql.append(" when caja.indstatusboleto = 'C' THEN 'CANCELAMENTO' "); + sql.append(" when caja.indstatusboleto = 'T' THEN 'TROCA' "); + sql.append(" ELSE 'OUTRO' END "); + sql.append(" order by movimentacao, tipoVenta "); + + PreparedStatement stmt = getConexao().prepareStatement(sql.toString()); + stmt.setTimestamp(1, new java.sql.Timestamp(inicio.getTime())); + stmt.setTimestamp(2, new java.sql.Timestamp(fim.getTime())); + stmt.setInt(3, empresaId); + stmt.setTimestamp(4, new java.sql.Timestamp(inicio.getTime())); + stmt.setTimestamp(5, new java.sql.Timestamp(fim.getTime())); + stmt.setInt(6, empresaId); + + ResultSet rset = stmt.executeQuery(); + List list = new ArrayList(); + while (rset.next()) { + ItemRelatorioFinanceiro item = new ItemRelatorioFinanceiro(); + item.setEmpresa(rset.getString("empresa")); + item.setMovimentacao(rset.getString("movimentacao")); + item.setTipoVenta(rset.getString("tipoVenta")); + item.setValorEnCaja(rset.getBigDecimal("valorEnCaja")); + + list.add(item); + } + + if (!getConexao().isClosed()) + getConexao().close(); + + return list; + } + + @Override + protected void processaParametros() throws Exception { + } + +} diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_es.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_es.properties new file mode 100644 index 000000000..57daa3700 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_es.properties @@ -0,0 +1,2 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_pt_BR.properties b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_pt_BR.properties new file mode 100644 index 000000000..57daa3700 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/relatorios/internacionalizacao/RelatorioAnaliticoFinanceiro_pt_BR.properties @@ -0,0 +1,2 @@ +#geral +msg.noData=Não foi possivel obter dados com os parâmetros informados. \ No newline at end of file diff --git a/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAnaliticoFinanceiro.jasper b/src/java/com/rjconsultores/ventaboletos/relatorios/templates/RelatorioAnaliticoFinanceiro.jasper new file mode 100644 index 0000000000000000000000000000000000000000..369291c9be61c4602f68e13d45033521e69d6260 GIT binary patch literal 26776 zcmeHPdwg6~o&TLAZKlaIO_RQa7Q?$QlD>f!p?OT2DU$~?)0Cz{oXp%bLnkxSnVU8( ziXx!$P|%fCTy!n4va2AnC>2D7?V>KLvaGrSE{Lf3z~v+Q*+q9<-S6+5b6+#JGgJTG zv~%yB-#O=Ze&=_7=l442&VBzubBYC8nKjJL;$-JliDKR;6pVbXU=}-#?7no?=-erR zQ3)jZckZ)wR3D+{WNtd2&KP|OGhxz_$W@7hiLP|6D`phZiA?%PVj^Q~i_k({Z74Bq z#AYTZ)3YYEsmhr|c3)S_ETpshP;tJlSm@0pip2wT4b{yS=)6j_O(cpSFxrD#DS@lQ z^rn$mXjk9xcq|kRcSpuYL(y1xcxZfAxGzk>iJWQXrUw%R3^L4P$;?b=dvh~cGt89m zw^%-r1Zj5Z?sUqW8l%?qzHF{wj3m%9VWxB0F=|g2`!l(O*(=-i=W?b|;EKiA%=C1k zaCpc#gzCl^b=aWYX>*EU14bfc6uPr1t5r+77*CrSL$?W2Q^uGy6`?)UoGYY_EEtY{ zQIwY$()*@B^*sI}Y3xA(m}(9efEwf%xPmp*d1fweVQV=wWn_nPJcIGWc_Tti6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Tsud#n8R zeSABNZ<&YbSyi?l-^T2+E51a}?>R<4K(%Pw3%Ev5yy0Pb@o{<{-!5)@3D*k%>#_;&(U!s@jtC*d~={5RC z%+QlqXa9s*dP+3G&sj`Qi)Hj3%+`0sne;4X>^ZTDUcjuqD9)#sF>^l_Z=s)I_I@rd zrC(tN|3mDd*F}ncBlgjMi30r*Blyw(%hgXja)oa$x%#O`u5{U-FIO6YmMi^D%N4$T zZ?IIZFxz!v9!-h)bO0LG6m9el(T+fKDcy+KzeOyk+rF3u5q#42%x*d(qL=ZgukRV2k*#6B?~ro^QpBSytEY8((LQ2_KHuGc`W zUip8ys-&-e;gKuUWSRT(UeI=l;1oRa=)n^3sm4Lp2Nq9*>UkT_d0evN)uLSg!fW8vYR|5J< zKwk;yD*=5apsxh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <band height="65" splitType="Stretch"> + <textField> + <reportElement x="84" y="40" width="471" height="23" uuid="63ce47a3-7e94-42a2-8325-eceef777fbe2"/> + <textElement verticalAlignment="Middle"/> + <textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression> + </textField> + <staticText> + <reportElement x="0" y="0" width="276" height="20" uuid="2e2e9caa-4076-4209-bdaf-0017ddf83a56"/> + <textElement verticalAlignment="Middle"> + <font size="14" isBold="true"/> + </textElement> + <text><![CDATA[ANALITICO FINANCEIRO]]></text> + </staticText> + <textField pattern="dd/MM/yyyy HH:mm"> + <reportElement x="276" y="0" width="279" height="20" uuid="6b4f1375-4f4b-4b80-83b8-7650e62e107e"/> + <textElement textAlignment="Right" verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression> + </textField> + <textField> + <reportElement x="0" y="20" width="80" height="20" uuid="3f1d0681-30be-4c3a-ae90-cf34dd4ede3c"/> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA["Período: "]]></textFieldExpression> + </textField> + <staticText> + <reportElement x="0" y="40" width="84" height="23" uuid="cf05ce5a-615b-41ac-b24d-2c45ca1bc60e"/> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <text><![CDATA[Empresa:]]></text> + </staticText> + <textField pattern="dd/MM/yyyy"> + <reportElement x="80" y="20" width="78" height="20" uuid="7f5ee01d-f86d-49a4-a2a1-f1c671621ef0"/> + <textElement textAlignment="Left" verticalAlignment="Middle"/> + <textFieldExpression><![CDATA[$P{inicio}]]></textFieldExpression> + </textField> + <textField> + <reportElement x="158" y="20" width="28" height="20" uuid="c1dec10a-743d-4569-916d-f1b65d4475b7"/> + <textElement verticalAlignment="Middle"> + <font isBold="true"/> + </textElement> + <textFieldExpression><![CDATA[" a "]]></textFieldExpression> + </textField> + <textField pattern="dd/MM/yyyy"> + <reportElement x="186" y="20" width="369" height="20" uuid="0b39fe78-5378-404c-b364-8be6ca288e25"/> + <textElement verticalAlignment="Middle"/> + <textFieldExpression><![CDATA[$P{fim}]]></textFieldExpression> + </textField> + <line> + <reportElement x="0" y="63" width="555" height="1" uuid="481b2107-ee62-4815-8a89-8435d34384c8"/> + </line> + </band> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImportacionFiscalController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImportacionFiscalController.java index 2c6703211..7055fd094 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImportacionFiscalController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaImportacionFiscalController.java @@ -6,7 +6,9 @@ import java.io.FileNotFoundException; import java.io.InputStream; import java.sql.SQLException; import java.util.Calendar; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.sql.DataSource; @@ -14,6 +16,7 @@ import org.apache.log4j.Logger; 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.Executions; import org.zkoss.zk.ui.WrongValueException; @@ -24,6 +27,7 @@ import org.zkoss.zul.Datebox; import org.zkoss.zul.Filedownload; import com.rjconsultores.ventaboletos.entidad.Empresa; +import com.rjconsultores.ventaboletos.relatorios.impl.RelatorioAnaliticoFinanceiro; import com.rjconsultores.ventaboletos.service.EmpresaService; import com.rjconsultores.ventaboletos.service.FiscalService; import com.rjconsultores.ventaboletos.utilerias.DateUtil; @@ -53,6 +57,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose private Button btnExeImportacionReducaoZ; private Button btnExeImportacionManual; private Button btnExeImportacionNaoFiscal; + private Button btnExeRelatorioFinanceiro; @Override public void doAfterCompose(Component comp) throws Exception { @@ -98,6 +103,14 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose } else { btnExeImportacionNaoFiscal.setVisible(false); } + + boolean isRelatorioFinanceiro = (Boolean) Executions.getCurrent().getArg().get("RELATORIO_FINANCEIRO"); + if (isRelatorioFinanceiro) { + btnExeRelatorioFinanceiro.setVisible(true); + } else { + btnExeRelatorioFinanceiro.setVisible(false); + } + } public void onClick$btnExeImportacionManual(Event ev) throws InterruptedException { @@ -117,7 +130,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose log.error("", e); } } - + public void onClick$btnExeImportacionEcfCancelados(Event ev) throws InterruptedException { Empresa empresa = null; @@ -140,7 +153,6 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose } } - public void onClick$btnExeImportacionEcf(Event ev) throws InterruptedException { Empresa empresa = null; @@ -199,6 +211,35 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose } } + @SuppressWarnings({ "unchecked", "rawtypes" }) + public void onClick$btnExeRelatorioFinanceiro(Event ev) throws InterruptedException { + try { + Empresa empresa = null; + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + empresa = (Empresa) itemEmpresa.getValue(); + } + + Map parametros = new HashMap(); + parametros.put("inicio", datInicial.getValue()); + parametros.put("fim", datFinal.getValue()); + parametros.put("empresa", empresa); + + RelatorioAnaliticoFinanceiro relatorio = new RelatorioAnaliticoFinanceiro(parametros, dataSourceRead.getConnection()); + + Map args = new HashMap(); + args.put("relatorio", relatorio); + + openWindow("/component/reportView.zul", + Labels.getLabel("relatorioAproveitamentoController.window.title"), args, MODAL); + + } catch (SQLException e) { + log.error(e.getMessage(), e); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + public List getLsEmpresa() { return lsEmpresa; } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/TipoImportacaoFiscal.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/TipoImportacaoFiscal.java index 5f9de2fec..ffaa52918 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/TipoImportacaoFiscal.java +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/TipoImportacaoFiscal.java @@ -5,7 +5,7 @@ import java.util.HashMap; public class TipoImportacaoFiscal { public enum TipoImportacao { - ECF, ECF_CANCELADOS, MANUAL, REDUCAO_Z, NAO_FISCAL; + ECF, ECF_CANCELADOS, MANUAL, REDUCAO_Z, NAO_FISCAL, RELATORIO_FINANCEIRO; } public static HashMap selecionaTipoImportacao(TipoImportacao tipo, HashMap args) { @@ -17,6 +17,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.MANUAL.toString(), Boolean.FALSE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.ECF_CANCELADOS)) { @@ -25,6 +26,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.MANUAL.toString(), Boolean.FALSE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.MANUAL)) { @@ -33,6 +35,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.MANUAL.toString(), Boolean.TRUE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.REDUCAO_Z)) { @@ -41,6 +44,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.MANUAL.toString(), Boolean.FALSE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.TRUE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.NAO_FISCAL)) { @@ -49,6 +53,16 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.MANUAL.toString(), Boolean.FALSE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.TRUE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); + } + + if (tipo.equals(TipoImportacao.RELATORIO_FINANCEIRO)) { + map.put(TipoImportacao.ECF.toString(), Boolean.FALSE); + map.put(TipoImportacao.ECF_CANCELADOS.toString(), Boolean.FALSE); + map.put(TipoImportacao.MANUAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.FALSE); + map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); + map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.TRUE); } return map; diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/ItemMenuFiscalRelatorioFinanceiro.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/ItemMenuFiscalRelatorioFinanceiro.java new file mode 100644 index 000000000..b2c6f5b1d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/ItemMenuFiscalRelatorioFinanceiro.java @@ -0,0 +1,33 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.relatorios; + +import java.util.HashMap; + +import org.zkoss.util.resource.Labels; + +import com.rjconsultores.ventaboletos.web.utilerias.PantallaUtileria; +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; +import com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.TipoImportacaoFiscal; +import com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.TipoImportacaoFiscal.TipoImportacao; + +public class ItemMenuFiscalRelatorioFinanceiro extends DefaultItemMenuSistema { + + public ItemMenuFiscalRelatorioFinanceiro() { + super("indexController.mniRelatorioFinanceiro.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.IMPRESSAOFISCAL.MENU.IMPORTACIONFISCAL"; + } + + @Override + public void ejecutar() { + + @SuppressWarnings("unchecked") + HashMap map = TipoImportacaoFiscal.selecionaTipoImportacao(TipoImportacao.RELATORIO_FINANCEIRO, (HashMap) getArgs()); + + PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul", + Labels.getLabel("busquedaImportacionFiscalController.window.title"), map, desktop); + + } +} diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/SubMenuRelatorioFiscalRelatorios.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/SubMenuRelatorioFiscalRelatorios.java new file mode 100644 index 000000000..f61ca992d --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/relatorios/SubMenuRelatorioFiscalRelatorios.java @@ -0,0 +1,16 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal.relatorios; + +import com.rjconsultores.ventaboletos.web.utilerias.menu.DefaultItemMenuSistema; + +public class SubMenuRelatorioFiscalRelatorios extends DefaultItemMenuSistema { + + public SubMenuRelatorioFiscalRelatorios() { + super("indexController.mnSubMenuRelatorioFiscalRelatorios.label"); + } + + @Override + public String getClaveMenu() { + return "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.IMPRESSAOFISCAL.MENU.IMPORTACIONFISCAL"; + } + +} diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 55b235955..bef5b11fc 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -277,7 +277,7 @@ indexController.mnSubMenuRelatorioImpressaoFiscal.label=Importação Fiscal indexController.mniTotnaofiscalEmpresa.label=Totalizadoes Não-fiscais indexController.mniFormapagoEmpresa.label=Formas de Pagamento indexController.mniRelgerencialEmpresa.label=Relatorio Gerencial -indexController.mnSubMenuRelatorioFiscalRelatorios.label=Relatórios +indexController.mnSubMenuRelatorioFiscalRelatorios.label=Relatórios Analíticos indexController.mniImportacionFiscalEcf.label=ECF indexController.mniImportacionFiscalEcfCancelados.label=ECF Cancelados diff --git a/web/gui/impressaofiscal/busquedaImportacionFiscal.zul b/web/gui/impressaofiscal/busquedaImportacionFiscal.zul index ecd464a3d..1464152b9 100644 --- a/web/gui/impressaofiscal/busquedaImportacionFiscal.zul +++ b/web/gui/impressaofiscal/busquedaImportacionFiscal.zul @@ -59,6 +59,10 @@