diff --git a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaExportacaoFiscalController.java b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaExportacaoFiscalController.java index 87344e31b..343f6109a 100644 --- a/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaExportacaoFiscalController.java +++ b/src/java/com/rjconsultores/ventaboletos/web/gui/controladores/impressaofiscal/BusquedaExportacaoFiscalController.java @@ -102,7 +102,7 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer } if (empresa != null && estado != null) { - String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado); + String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado, "ECF"); File arquivo = fiscalService.buscarArquivoExportacaoECF(datInicial.getValue(), datFinal.getValue(), empresa, estado, nomeArquivo); @@ -115,7 +115,7 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer } } - private String getNomeArquivoExportacaoECF(Date dataInicial, Estado estado) { + private String getNomeArquivoExportacaoECF(Date dataInicial, Estado estado, String tipo) { String[] mesano = new SimpleDateFormat("MM/yyyy").format(dataInicial).split("/"); String mes = mesano[0].toString(); @@ -139,7 +139,7 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer default: break; } - String nomeArquivo = "TotalBus " + estado.getCveestado() + " ECF " + nome + ano; + String nomeArquivo = "TotalBus " + estado.getCveestado() + " " + tipo + " " + nome + ano; return nomeArquivo; } @@ -160,7 +160,9 @@ public class BusquedaExportacaoFiscalController extends MyGenericForwardComposer } if (empresa != null && estado != null) { - File arquivo = fiscalService.buscarArquivoExportacaoRMD(datInicial.getValue(), datFinal.getValue(), empresa, estado); + String nomeArquivo = getNomeArquivoExportacaoECF(datInicial.getValue(), estado, "BPR"); + + File arquivo = fiscalService.buscarArquivoExportacaoRMD(datInicial.getValue(), datFinal.getValue(), empresa, estado, nomeArquivo); try { downloadArquivo(arquivo, null);