julio 2016-06-08 20:39:23 +00:00
parent c5159fa30d
commit 4d530f7f54
6 changed files with 87 additions and 66 deletions

View File

@ -67,6 +67,7 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
private Button btnExeRelatorioFinanceiro; private Button btnExeRelatorioFinanceiro;
private Button btnExeRelatorioVoucher; private Button btnExeRelatorioVoucher;
private Button btnExeRelatorioPendenciaEcf; private Button btnExeRelatorioPendenciaEcf;
private Button btnExeRelatorioPendenciaReducaoZ;
private Boolean isExibirTipoGeracaoArquivo; private Boolean isExibirTipoGeracaoArquivo;
private Boolean isExibirCompetencia; private Boolean isExibirCompetencia;
@ -84,62 +85,69 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
private void defineImportacao() { private void defineImportacao() {
boolean isEcf = (Boolean) Executions.getCurrent().getArg().get("ECF"); boolean isEcf = Executions.getCurrent().getArg().get("ECF") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("ECF");
if (isEcf) { if (isEcf) {
btnExeImportacionEcf.setVisible(true); btnExeImportacionEcf.setVisible(true);
} else { } else {
btnExeImportacionEcf.setVisible(false); btnExeImportacionEcf.setVisible(false);
} }
boolean isEcfCancel = (Boolean) Executions.getCurrent().getArg().get("ECF_CANCELADOS"); boolean isEcfCancel = Executions.getCurrent().getArg().get("ECF_CANCELADOS") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("ECF_CANCELADOS");
if (isEcfCancel) { if (isEcfCancel) {
btnExeImportacionEcfCancelados.setVisible(true); btnExeImportacionEcfCancelados.setVisible(true);
} else { } else {
btnExeImportacionEcfCancelados.setVisible(false); btnExeImportacionEcfCancelados.setVisible(false);
} }
boolean isManual = (Boolean) Executions.getCurrent().getArg().get("MANUAL"); boolean isManual = Executions.getCurrent().getArg().get("MANUAL") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("MANUAL");
if (isManual) { if (isManual) {
btnExeImportacionManual.setVisible(true); btnExeImportacionManual.setVisible(true);
} else { } else {
btnExeImportacionManual.setVisible(false); btnExeImportacionManual.setVisible(false);
} }
boolean isReducaoZ = (Boolean) Executions.getCurrent().getArg().get("REDUCAO_Z"); boolean isReducaoZ = Executions.getCurrent().getArg().get("REDUCAO_Z") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("REDUCAO_Z");
if (isReducaoZ) { if (isReducaoZ) {
btnExeImportacionReducaoZ.setVisible(true); btnExeImportacionReducaoZ.setVisible(true);
} else { } else {
btnExeImportacionReducaoZ.setVisible(false); btnExeImportacionReducaoZ.setVisible(false);
} }
boolean isNaoFiscal = (Boolean) Executions.getCurrent().getArg().get("NAO_FISCAL"); boolean isNaoFiscal = Executions.getCurrent().getArg().get("NAO_FISCAL") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("NAO_FISCAL");
if (isNaoFiscal) { if (isNaoFiscal) {
btnExeImportacionNaoFiscal.setVisible(true); btnExeImportacionNaoFiscal.setVisible(true);
} else { } else {
btnExeImportacionNaoFiscal.setVisible(false); btnExeImportacionNaoFiscal.setVisible(false);
} }
boolean isRelatorioFinanceiro = (Boolean) Executions.getCurrent().getArg().get("RELATORIO_FINANCEIRO"); boolean isRelatorioFinanceiro = Executions.getCurrent().getArg().get("RELATORIO_FINANCEIRO") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("RELATORIO_FINANCEIRO");
if (isRelatorioFinanceiro) { if (isRelatorioFinanceiro) {
btnExeRelatorioFinanceiro.setVisible(true); btnExeRelatorioFinanceiro.setVisible(true);
} else { } else {
btnExeRelatorioFinanceiro.setVisible(false); btnExeRelatorioFinanceiro.setVisible(false);
} }
boolean isRelatorioVoucher = (Boolean) Executions.getCurrent().getArg().get("RELATORIO_VOUCHER"); boolean isRelatorioVoucher = Executions.getCurrent().getArg().get("RELATORIO_VOUCHER") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("RELATORIO_VOUCHER");
if (isRelatorioVoucher) { if (isRelatorioVoucher) {
btnExeRelatorioVoucher.setVisible(true); btnExeRelatorioVoucher.setVisible(true);
} else { } else {
btnExeRelatorioVoucher.setVisible(false); btnExeRelatorioVoucher.setVisible(false);
} }
boolean isRelatorioPendenciaEcf = (Boolean) Executions.getCurrent().getArg().get("PENDENCIA_ECF"); boolean isRelatorioPendenciaEcf = Executions.getCurrent().getArg().get("PENDENCIA_ECF") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("PENDENCIA_ECF");
if (isRelatorioPendenciaEcf) { if (isRelatorioPendenciaEcf) {
btnExeRelatorioPendenciaEcf.setVisible(true); btnExeRelatorioPendenciaEcf.setVisible(true);
} else { } else {
btnExeRelatorioPendenciaEcf.setVisible(false); btnExeRelatorioPendenciaEcf.setVisible(false);
} }
boolean isRelatorioPendenciaReducaoZ = Executions.getCurrent().getArg().get("PENDENCIA_REDUCAO_Z") == null ? Boolean.FALSE : (Boolean) Executions.getCurrent().getArg().get("PENDENCIA_REDUCAO_Z");
if (isRelatorioPendenciaReducaoZ) {
btnExeRelatorioPendenciaReducaoZ.setVisible(true);
} else {
btnExeRelatorioPendenciaReducaoZ.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;
@ -265,6 +273,30 @@ public class BusquedaImportacionFiscalController extends MyGenericForwardCompose
} }
} }
public void onClick$btnExeRelatorioPendenciaReducaoZ(Event ev) throws InterruptedException {
Empresa empresa = null;
Comboitem itemEmpresa = cmbEmpresa.getSelectedItem();
if (itemEmpresa != null) {
empresa = (Empresa) itemEmpresa.getValue();
}
try {
File arquivoTxt = fiscalService.importacionFiscalReducaoZPendencia(datInicial.getValue(), datFinal.getValue(), empresa);
File arquivoXls = null;
// if (chkArquivoXls.isChecked()) {
// 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();
*/
} catch (Exception e) {
log.error("", e);
}
}
public void onClick$btnExeImportacionReducaoZ(Event ev) throws InterruptedException { public void onClick$btnExeImportacionReducaoZ(Event ev) throws InterruptedException {
Empresa empresa = null; Empresa empresa = null;

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 ItemMenuImportacionFiscalReducaoZPendencia extends DefaultItemMenuSistema {
public ItemMenuImportacionFiscalReducaoZPendencia() {
super("indexController.mniImportacionFiscalPendenciaReducaoZ.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_REDUCAO_Z, (HashMap<String, Boolean>) getArgs());
// map.put("ExibirTipoGeracaoArquivo", true);
PantallaUtileria.openWindow("/gui/impressaofiscal/busquedaImportacionFiscal.zul",
Labels.getLabel("busquedaImportacionFiscalEcfPendenciaReducaoZController.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, PENDENCIA_ECF; ECF, ECF_CANCELADOS, MANUAL, REDUCAO_Z, NAO_FISCAL, RELATORIO_FINANCEIRO, RELATORIO_VOUCHER, PENDENCIA_ECF, PENDENCIA_REDUCAO_Z;
} }
public static HashMap<String, Boolean> selecionaTipoImportacao(TipoImportacao tipo, HashMap<String, Boolean> map) { public static HashMap<String, Boolean> selecionaTipoImportacao(TipoImportacao tipo, HashMap<String, Boolean> map) {
@ -21,92 +21,40 @@ public class TipoImportacaoFiscal {
if (tipo.equals(TipoImportacao.ECF)) { if (tipo.equals(TipoImportacao.ECF)) {
map.put(TipoImportacao.ECF.toString(), Boolean.TRUE); map.put(TipoImportacao.ECF.toString(), Boolean.TRUE);
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.FALSE);
} }
if (tipo.equals(TipoImportacao.ECF_CANCELADOS)) { if (tipo.equals(TipoImportacao.ECF_CANCELADOS)) {
map.put(TipoImportacao.ECF.toString(), Boolean.FALSE);
map.put(TipoImportacao.ECF_CANCELADOS.toString(), Boolean.TRUE); map.put(TipoImportacao.ECF_CANCELADOS.toString(), Boolean.TRUE);
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.FALSE);
} }
if (tipo.equals(TipoImportacao.MANUAL)) { if (tipo.equals(TipoImportacao.MANUAL)) {
map.put(TipoImportacao.ECF.toString(), Boolean.FALSE);
map.put(TipoImportacao.ECF_CANCELADOS.toString(), Boolean.FALSE);
map.put(TipoImportacao.MANUAL.toString(), Boolean.TRUE); 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);
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)) {
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.TRUE); map.put(TipoImportacao.REDUCAO_Z.toString(), Boolean.TRUE);
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)) { if (tipo.equals(TipoImportacao.NAO_FISCAL)) {
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.TRUE); 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)) { 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); 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)) { if (tipo.equals(TipoImportacao.RELATORIO_VOUCHER)) {
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.TRUE); map.put(TipoImportacao.RELATORIO_VOUCHER.toString(), Boolean.TRUE);
map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.FALSE);
} }
if (tipo.equals(TipoImportacao.PENDENCIA_ECF)) { 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); map.put(TipoImportacao.PENDENCIA_ECF.toString(), Boolean.TRUE);
} }
if (tipo.equals(TipoImportacao.PENDENCIA_REDUCAO_Z)) {
map.put(TipoImportacao.PENDENCIA_REDUCAO_Z.toString(), Boolean.TRUE);
}
return map; return map;
} }

View File

@ -283,6 +283,7 @@ 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.mniImportacionFiscalPendenciaEcf.label=Pendência ECF
indexController.mniImportacionFiscalPendenciaReducaoZ.label=Pendência Redução Z
indexController.mniSubMenuClientePacote.label=Paquete indexController.mniSubMenuClientePacote.label=Paquete
indexController.mniManutencaoPacote.label=Mantenimiento Paquete indexController.mniManutencaoPacote.label=Mantenimiento Paquete
@ -6442,6 +6443,7 @@ busquedaImportacionFiscalNaoFiscalController.window.title=Impressão Fiscal :: N
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 busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF
busquedaImportacionFiscalEcfPendenciaReducaoZController.window.title=Impressão Fiscal :: Pendência Redução Z
#OCD #OCD
busquedaOCDParamController.empresa.label=Empresa busquedaOCDParamController.empresa.label=Empresa

View File

@ -289,6 +289,7 @@ 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.mniImportacionFiscalPendenciaEcf.label=Pendência ECF
indexController.mniImportacionFiscalPendenciaReducaoZ.label=Pendência Redução Z
indexController.mniSubMenuClientePacote.label=Pacote indexController.mniSubMenuClientePacote.label=Pacote
indexController.mniManutencaoPacote.label=Manutenção Pacote indexController.mniManutencaoPacote.label=Manutenção Pacote
@ -6591,4 +6592,5 @@ 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 busquedaImportacionFiscalEcfPendenciaController.window.title=Impressão Fiscal :: Pendência ECF
busquedaImportacionFiscalEcfPendenciaReducaoZController.window.title=Impressão Fiscal :: Pendência Redução Z

View File

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