diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/bpe/BusquedaBpeExportacaoController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/bpe/BusquedaBpeExportacaoController.java index 513e5ab2e..f29861b5a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/bpe/BusquedaBpeExportacaoController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/bpe/BusquedaBpeExportacaoController.java @@ -11,6 +11,8 @@ 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.zhtml.Messagebox; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.event.Event; import org.zkoss.zul.Comboitem; @@ -77,6 +79,14 @@ public class BusquedaBpeExportacaoController extends MyGenericForwardComposer { String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado, "BPE"); File arquivo = bpeService.buscarArquivoExportacaoBPE(datInicial.getValue(), datFinal.getValue(), empresa, estado, nomeArquivo); + if (arquivo == null) { + Messagebox.show( + Labels.getLabel("relatorio.parametro.msgNoData"), + Labels.getLabel("indexController.mnSubMenuBpeFiscal.exportacao.label"), + Messagebox.OK, Messagebox.INFORMATION); + return; + } + try { downloadArquivo(arquivo, nomeArquivo);