julio 2016-06-07 19:31:45 +00:00
parent 325310a52a
commit e412ea52e4
6 changed files with 90 additions and 6 deletions

View File

@ -66,6 +66,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
private Button btnExeImportacionNaoFiscal; private Button btnExeImportacionNaoFiscal;
private Button btnExeRelatorioFinanceiro; private Button btnExeRelatorioFinanceiro;
private Button btnExeRelatorioVoucher; private Button btnExeRelatorioVoucher;
private Button btnExeRelatorioPendenciaEcf;
private Boolean isExibirTipoGeracaoArquivo; private Boolean isExibirTipoGeracaoArquivo;
private Boolean isExibirCompetencia; private Boolean isExibirCompetencia;
@ -132,6 +133,13 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
btnExeRelatorioVoucher.setVisible(false); 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"); isExibirTipoGeracaoArquivo = (Boolean) Executions.getCurrent().getArg().get("ExibirTipoGeracaoArquivo");
isExibirCompetencia = (Boolean) Executions.getCurrent().getArg().get("ExibirCompetencia"); isExibirCompetencia = (Boolean) Executions.getCurrent().getArg().get("ExibirCompetencia");
isExibirDatas = isExibirCompetencia != null ? !isExibirCompetencia : true; isExibirDatas = isExibirCompetencia != null ? !isExibirCompetencia : true;
@ -196,7 +204,26 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
} catch (Exception e) { } catch (Exception e) {
log.error("", 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 { private void downloadArquivo(File arquivoTxt, File arquivoXls) throws Exception {
@ -253,10 +280,9 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
arquivoXls = fiscalService.importacionFiscalReducaoZXls(empresa, arquivoTxt); arquivoXls = fiscalService.importacionFiscalReducaoZXls(empresa, arquivoTxt);
} }
downloadArquivo(arquivoTxt, arquivoXls); downloadArquivo(arquivoTxt, arquivoXls);
/*File arquivo = fiscalService.importacionFiscalReducaoZ(datInicial.getValue(), datFinal.getValue(), empresa); /*
InputStream is = new FileInputStream(arquivo); * 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();
Filedownload.save(is, "application/notepad", "fiscal_reducao_z" + DateUtil.getStringDate(Calendar.getInstance().getTime(), "yyyyMMddhhmm") + ".txt"); */
arquivo.delete();*/
} catch (Exception e) { } catch (Exception e) {
log.error("", e); log.error("", e);
} }

View File

@ -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<String, Boolean> map = TipoImportacaoFiscal.selecionaTipoImportacao(TipoImportacao.PENDENCIA_ECF, (HashMap<String, Boolean>) getArgs());
// map.put("ExibirTipoGeracaoArquivo", true);
PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul",
Labels.getLabel("busquedaImportacionFiscalEcfPendenciaController.window.title"), map, desktop);
}
}

View File

@ -5,7 +5,7 @@ import java.util.HashMap;
public class TipoImportacaoFiscal { public class TipoImportacaoFiscal {
public enum TipoImportacao { 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<String, Boolean> selecionaTipoImportacao(TipoImportacao tipo, HashMap<String, Boolean> map) { public static HashMap<String, Boolean> selecionaTipoImportacao(TipoImportacao tipo, HashMap<String, Boolean> map) {
@ -17,6 +17,7 @@ public class TipoImportacaoFiscal {
map.remove(TipoImportacao.NAO_FISCAL.toString()); map.remove(TipoImportacao.NAO_FISCAL.toString());
map.remove(TipoImportacao.RELATORIO_FINANCEIRO.toString()); map.remove(TipoImportacao.RELATORIO_FINANCEIRO.toString());
map.remove(TipoImportacao.RELATORIO_VOUCHER.toString()); map.remove(TipoImportacao.RELATORIO_VOUCHER.toString());
map.remove(TipoImportacao.PENDENCIA_ECF.toString());
if (tipo.equals(TipoImportacao.ECF)) { if (tipo.equals(TipoImportacao.ECF)) {
map.put(TipoImportacao.ECF.toString(), Boolean.TRUE); 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.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.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)) { if (tipo.equals(TipoImportacao.ECF_CANCELADOS)) {
@ -36,6 +38,7 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE);
map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE);
} }
if (tipo.equals(TipoImportacao.MANUAL)) { if (tipo.equals(TipoImportacao.MANUAL)) {
@ -46,6 +49,7 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.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)) { if (tipo.equals(TipoImportacao.REDUCAO_Z)) {
@ -56,6 +60,7 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.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)) { if (tipo.equals(TipoImportacao.NAO_FISCAL)) {
@ -66,6 +71,7 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.TRUE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.TRUE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.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)) { if (tipo.equals(TipoImportacao.RELATORIO_FINANCEIRO)) {
@ -76,6 +82,7 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.TRUE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.TRUE);
map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.FALSE);
map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE);
} }
if (tipo.equals(TipoImportacao.RELATORIO_VOUCHER)) { if (tipo.equals(TipoImportacao.RELATORIO_VOUCHER)) {
@ -86,6 +93,18 @@ public class TipoImportacaoFiscal {
map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE); map.put(TipoImportacao.NAO_FISCAL.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE); map.put(TipoImportacao.RELATORIO_FINANCEIRO.toString(), Boolean.FALSE);
map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.TRUE); 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; return map;

View File

@ -282,6 +282,7 @@ indexController.mniImportacionFiscalReducaoZ.label=Redução Z
indexController.mniImportacionNaoFiscal.label=Não Fiscal indexController.mniImportacionNaoFiscal.label=Não Fiscal
indexController.mniRelatorioFinanceiro.label=Financeiro indexController.mniRelatorioFinanceiro.label=Financeiro
indexController.mniRelatorioVoucher.label=Voucher indexController.mniRelatorioVoucher.label=Voucher
indexController.mniImportacionFiscalPendenciaEcf.label=Pendência ECF
indexController.mniSubMenuClientePacote.label=Paquete indexController.mniSubMenuClientePacote.label=Paquete
indexController.mniManutencaoPacote.label=Mantenimiento 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 busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: Não Fiscal
busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro
busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher
busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF
#OCD #OCD
busquedaOCDParamController.empresa.label=Empresa busquedaOCDParamController.empresa.label=Empresa

View File

@ -288,6 +288,7 @@ indexController.mniImportacionFiscalReducaoZ.label=Redução Z
indexController.mniImportacionNaoFiscal.label=Não Fiscal indexController.mniImportacionNaoFiscal.label=Não Fiscal
indexController.mniRelatorioFinanceiro.label=Financeiro indexController.mniRelatorioFinanceiro.label=Financeiro
indexController.mniRelatorioVoucher.label=Voucher indexController.mniRelatorioVoucher.label=Voucher
indexController.mniImportacionFiscalPendenciaEcf.label=Pendência ECF
indexController.mniSubMenuClientePacote.label=Pacote indexController.mniSubMenuClientePacote.label=Pacote
indexController.mniManutencaoPacote.label=Manutenção 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 busquedaImportacionFiscalReducaoZController.window.title=Impressão Fiscal :: Redução Z
busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: Não Fiscal busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: Não Fiscal
busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro busquedaImportacionFiscalRelatorioFinanceiroController.window.title=Impressão Fiscal :: Relatório Financeiro
busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher busquedaImportacionFiscalRelatorioVoucherController.window.title=Impressão Fiscal :: Relatório Voucher
busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF

View File

@ -92,6 +92,8 @@
<button id="btnExeRelatorioVoucher" image="/gui/img/enginer.png" <button id="btnExeRelatorioVoucher" image="/gui/img/enginer.png"
label="${c:l('busquedaImportacionFiscalController.btnExe.label')}" /> label="${c:l('busquedaImportacionFiscalController.btnExe.label')}" />
<button id="btnExeRelatorioPendenciaEcf" image="/gui/img/enginer.png"
label="${c:l('busquedaImportacionFiscalController.btnExe.label')}" />
</toolbar> </toolbar>
</window> </window>