From e412ea52e4535f54a2bf6a5223f8a299628769a6 Mon Sep 17 00:00:00 2001 From: julio Date: Tue, 7 Jun 2016 19:31:45 +0000 Subject: [PATCH] bug #7500 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@56760 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../BusquedaImportacionFiscalController.java | 34 ++++++++++++++++--- ...ItemMenuImportacionFiscalEcFPendencia.java | 33 ++++++++++++++++++ .../impressaofiscal/TipoImportacaoFiscal.java | 21 +++++++++++- web/WEB-INF/i3-label_es_MX.label | 2 ++ web/WEB-INF/i3-label_pt_BR.label | 4 ++- .../busquedaImportacionFiscal.zul | 2 ++ 6 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/ItemMenuImportacionFiscalEcFPendencia.java 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 65be64d88..8ffe874e3 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 @@ -66,6 +66,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose private Button btnExeImportacionNaoFiscal; private Button btnExeRelatorioFinanceiro; private Button btnExeRelatorioVoucher; + private Button btnExeRelatorioPendenciaEcf; private Boolean isExibirTipoGeracaoArquivo; private Boolean isExibirCompetencia; @@ -132,6 +133,13 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose btnExeRelatorioVoucher.setVisible(false); } + boolean isRelatorioPendenciaEcf = (Boolean) Executions.getCurrent().getArg().get("PENDENCIA_ECF"); + if (isRelatorioPendenciaEcf) { + btnExeRelatorioPendenciaEcf.setVisible(true); + } else { + btnExeRelatorioPendenciaEcf.setVisible(false); + } + isExibirTipoGeracaoArquivo = (Boolean) Executions.getCurrent().getArg().get("ExibirTipoGeracaoArquivo"); isExibirCompetencia = (Boolean) Executions.getCurrent().getArg().get("ExibirCompetencia"); isExibirDatas = isExibirCompetencia != null ? !isExibirCompetencia : true; @@ -196,7 +204,26 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose } catch (Exception e) { log.error("", e); } + } + public void onClick$btnExeRelatorioPendenciaEcf(Event ev) throws InterruptedException { + + Empresa empresa = null; + Comboitem itemEmpresa = cmbEmpresa.getSelectedItem(); + if (itemEmpresa != null) { + empresa = (Empresa) itemEmpresa.getValue(); + } + + try { + File arquivoTxt = fiscalService.importacionFiscalECFPendencias(datInicial.getValue(), datFinal.getValue(), empresa); + File arquivoXls = null; + // if (chkArquivoXls.isChecked()) { + // arquivoXls = fiscalService.importacionFiscalECFXls(empresa, arquivoTxt); + // } + downloadArquivo(arquivoTxt, arquivoXls); + } catch (Exception e) { + log.error("", e); + } } private void downloadArquivo(File arquivoTxt, File arquivoXls) throws Exception { @@ -253,10 +280,9 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose arquivoXls = fiscalService.importacionFiscalReducaoZXls(empresa, arquivoTxt); } downloadArquivo(arquivoTxt, arquivoXls); - /*File arquivo = fiscalService.importacionFiscalReducaoZ(datInicial.getValue(), datFinal.getValue(), empresa); - InputStream is = new FileInputStream(arquivo); - Filedownload.save(is, "application/notepad", "fiscal_reducao_z" + DateUtil.getStringDate(Calendar.getInstance().getTime(), "yyyyMMddhhmm") + ".txt"); - arquivo.delete();*/ + /* + * File arquivo = fiscalService.importacionFiscalReducaoZ(datInicial.getValue(), datFinal.getValue(), empresa); InputStream is = new FileInputStream(arquivo); Filedownload.save(is, "application/notepad", "fiscal_reducao_z" + DateUtil.getStringDate(Calendar.getInstance().getTime(), "yyyyMMddhhmm") + ".txt"); arquivo.delete(); + */ } catch (Exception e) { log.error("", e); } diff --git a/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/ItemMenuImportacionFiscalEcFPendencia.java b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/ItemMenuImportacionFiscalEcFPendencia.java new file mode 100644 index 000000000..57ab0c6a2 --- /dev/null +++ b/src/java/com/rjconsultores/ventaboletos/web/utilerias/menu/item/relatorios/impressaofiscal/ItemMenuImportacionFiscalEcFPendencia.java @@ -0,0 +1,33 @@ +package com.rjconsultores.ventaboletos.web.utilerias.menu.item.relatorios.impressaofiscal; + +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.TipoImportacao; + +public class ItemMenuImportacionFiscalEcFPendencia extends DefaultItemMenuSistema { + + public ItemMenuImportacionFiscalEcFPendencia() { + super("indexController.mniImportacionFiscalPendenciaEcf.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.PENDENCIA_ECF, (HashMap) getArgs()); + // map.put("ExibirTipoGeracaoArquivo", true); + + PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul", + Labels.getLabel("busquedaImportacionFiscalEcfPendenciaController.window.title"), map, desktop); + + } +} 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 d626d411d..ae9f0a2d1 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, RELATORIO_FINANCEIRO, RELATORIO_VOUCHER; + ECF, ECF_CANCELADOS, MANUAL, REDUCAO_Z, NAO_FISCAL, RELATORIO_FINANCEIRO, RELATORIO_VOUCHER, PENDENCIA_ECF; } public static HashMap selecionaTipoImportacao(TipoImportacao tipo, HashMap map) { @@ -17,6 +17,7 @@ public class TipoImportacaoFiscal { map.remove(TipoImportacao.NAO_FISCAL.toString()); map.remove(TipoImportacao.RELATORIO_FINANCEIRO.toString()); map.remove(TipoImportacao.RELATORIO_VOUCHER.toString()); + map.remove(TipoImportacao.PENDENCIA_ECF.toString()); if (tipo.equals(TipoImportacao.ECF)) { map.put(TipoImportacao.ECF.toString(), Boolean.TRUE); @@ -26,6 +27,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.ECF_CANCELADOS)) { @@ -36,6 +38,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.MANUAL)) { @@ -46,6 +49,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.REDUCAO_Z)) { @@ -56,6 +60,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.NAO_FISCAL)) { @@ -66,6 +71,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.TRUE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.RELATORIO_FINANCEIRO)) { @@ -76,6 +82,7 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.TRUE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); } if (tipo.equals(TipoImportacao.RELATORIO_VOUCHER)) { @@ -86,6 +93,18 @@ public class TipoImportacaoFiscal { map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.TRUE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE); + } + + if (tipo.equals(TipoImportacao.PENDENCIA_ECF)) { + 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.FALSE); + map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); + map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.TRUE); } return map; diff --git a/web/WEB-INF/i3-label_es_MX.label b/web/WEB-INF/i3-label_es_MX.label index b4c905728..d7c377213 100644 --- a/web/WEB-INF/i3-label_es_MX.label +++ b/web/WEB-INF/i3-label_es_MX.label @@ -282,6 +282,7 @@ indexController.mniImportacionFiscalReducaoZ.label=Redução Z indexController.mniImportacionNaoFiscal.label=Não Fiscal indexController.mniRelatorioFinanceiro.label=Financeiro indexController.mniRelatorioVoucher.label=Voucher +indexController.mniImportacionFiscalPendenciaEcf.label=Pendência ECF indexController.mniSubMenuClientePacote.label=Paquete indexController.mniManutencaoPacote.label=Mantenimiento Paquete @@ -6440,6 +6441,7 @@ busquedaImportacionFiscalReducaoZController.window.title=Impressão Fiscal :: Re busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: Não Fiscal busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher +busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF #OCD busquedaOCDParamController.empresa.label=Empresa diff --git a/web/WEB-INF/i3-label_pt_BR.label b/web/WEB-INF/i3-label_pt_BR.label index 1c8c016aa..ad07a3615 100644 --- a/web/WEB-INF/i3-label_pt_BR.label +++ b/web/WEB-INF/i3-label_pt_BR.label @@ -288,6 +288,7 @@ indexController.mniImportacionFiscalReducaoZ.label=Redução Z indexController.mniImportacionNaoFiscal.label=Não Fiscal indexController.mniRelatorioFinanceiro.label=Financeiro indexController.mniRelatorioVoucher.label=Voucher +indexController.mniImportacionFiscalPendenciaEcf.label=Pendência ECF indexController.mniSubMenuClientePacote.label=Pacote indexController.mniManutencaoPacote.label=Manutenção Pacote @@ -6589,4 +6590,5 @@ busquedaImportacionFiscalManualController.window.title=Impressão Fiscal :: Manu busquedaImportacionFiscalReducaoZController.window.title=Impressão Fiscal :: Redução Z busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: Não Fiscal busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro -busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher \ No newline at end of file +busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher +busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF \ No newline at end of file diff --git a/web/gui/impressaofiscal/busquedaImportacionFiscal.zul b/web/gui/impressaofiscal/busquedaImportacionFiscal.zul index 80e75e8df..f91300fac 100644 --- a/web/gui/impressaofiscal/busquedaImportacionFiscal.zul +++ b/web/gui/impressaofiscal/busquedaImportacionFiscal.zul @@ -92,6 +92,8 @@