From e55810a20e2bbbcfafb699ab24002bd49da1835d Mon Sep 17 00:00:00 2001 From: alberto Date: Thu, 9 Feb 2017 20:12:49 +0000 Subject: [PATCH] =?UTF-8?q?Exporta=C3=A7=C3=A3o=20Fiscal=20:=20ECF=20e=20R?= =?UTF-8?q?MD=20(issue=208120)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@65802 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../dao/hibernate/FiscalHibernateDAO.java | 1 + .../ventaboletos/service/FiscalService.java | 2 +- .../service/impl/FiscalServiceImpl.java | 4 +-- .../exportacaofiscal/ExportacaoFiscal.java | 28 ++++--------------- .../vo/ExportacaoECFTipoCFC.java | 11 +++++++- 5 files changed, 19 insertions(+), 27 deletions(-) diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java index f8f8e40e7..a033657d6 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FiscalHibernateDAO.java @@ -1325,6 +1325,7 @@ public class FiscalHibernateDAO extends HibernateDaoSupport implements FiscalDAO registro.setValorIsentas(totalIsenta); registro.setEstabelecimentoECF(rs.getString("codestabelecimentoimpressora")); registro.setNumeroSerie(rs.getString("numserie")); + registro.setInfoPadraoBilhetePassagem("00000060"); retorno.add(registro); } diff --git a/src/com/rjconsultores/ventaboletos/service/FiscalService.java b/src/com/rjconsultores/ventaboletos/service/FiscalService.java index 4a82d321b..3afb1faf2 100644 --- a/src/com/rjconsultores/ventaboletos/service/FiscalService.java +++ b/src/com/rjconsultores/ventaboletos/service/FiscalService.java @@ -43,7 +43,7 @@ public interface FiscalService { public File importacionFiscalECFPendencias(Date inicio, Date fim, Empresa empresa); - public File buscarArquivoExportacaoECF(Date value, Date value2, Empresa empresa, Estado estado); + public File buscarArquivoExportacaoECF(Date value, Date value2, Empresa empresa, Estado estado, String nomeArquivo); public File buscarArquivoExportacaoRMD(Date value, Date value2, Empresa empresa, Estado estado); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FiscalServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FiscalServiceImpl.java index e4e561958..7f852f57f 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/FiscalServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/FiscalServiceImpl.java @@ -801,7 +801,7 @@ public class FiscalServiceImpl implements FiscalService { } @Override - public File buscarArquivoExportacaoECF(Date inicio, Date fim, Empresa empresa, Estado estado) { + public File buscarArquivoExportacaoECF(Date inicio, Date fim, Empresa empresa, Estado estado, String nomeArquivo) { Connection connection = null; try { @@ -826,7 +826,7 @@ public class FiscalServiceImpl implements FiscalService { List listaRegistroECFTipoPRC = fiscalDAO.buscarRegistroECFTipoPRC(connection, inicio, fim, empresa.getEmpresaId(), estado.getCveestado()); tempos.add(infoTempo("PRC", begin)); - return exportacaoFiscal.gerarArquivoECF(tempos, inicio, fim, estado.getCveestado(), empresa.getNombempresa(), listaRegistroECFTipoCFC, listaRegistroECFTipoCCF, listaRegistroECFTipoICF, + return exportacaoFiscal.gerarArquivoECF(tempos, nomeArquivo, inicio, fim, estado.getCveestado(), empresa.getNombempresa(), listaRegistroECFTipoCFC, listaRegistroECFTipoCCF, listaRegistroECFTipoICF, listaRegistroECFTipoPRC); } catch (Exception e) { diff --git a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/ExportacaoFiscal.java b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/ExportacaoFiscal.java index bd1b2c676..0fb4b9006 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/ExportacaoFiscal.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/ExportacaoFiscal.java @@ -42,30 +42,10 @@ public class ExportacaoFiscal { } - public File gerarArquivoECF(final List tempos, final Date dataInicial, final Date dataFinal, final String estado, final String nomeEmpresa, final List listaRegistroECFTipoCFC, + public File gerarArquivoECF(final List tempos, String nomeArquivo, final Date dataInicial, final Date dataFinal, final String estado, final String nomeEmpresa, final List listaRegistroECFTipoCFC, final List listaRegistroECFTipoCCF, final List listaRegistroECFTipoICF, final List listaRegistroECFTipoPRC) { try { - String mes = new SimpleDateFormat("MM").format(dataInicial); - String nome = ""; - - switch (Integer.valueOf(mes)) { - case 1: nome = "Jan"; break; - case 2: nome = "Fev"; break; - case 3: nome = "Mar"; break; - case 4: nome = "Abr"; break; - case 5: nome = "Mai"; break; - case 6: nome = "Jun"; break; - case 7: nome = "Jul"; break; - case 8: nome = "Ago"; break; - case 9: nome = "Set"; break; - case 10: nome = "Out"; break; - case 11: nome = "Nov"; break; - case 12: nome = "Dez"; break; - default: break; - } - // String nomeArquivo = "fiscal_vendas_impressas_" + DateUtil.getStringDate(Calendar.getInstance().getTime(), "yyyyMMddhhmmss"); - String nomeArquivo = "TotalBus " + estado + " ECF " + nome + new SimpleDateFormat("yyyy").format(dataInicial); File arquivo = File.createTempFile(nomeArquivo + "-", ".fs"); @@ -254,6 +234,7 @@ public class ExportacaoFiscal { BigDecimal valorTotal = registro.getValorTotal(); BigDecimal valorIsentas = registro.getValorIsentas(); String estabelecimentoECF = registro.getEstabelecimentoECF(); + String infoPadraoBilhetePassagem = registro.getInfoPadraoBilhetePassagem(); String numeroSerie = registro.getNumeroSerie(); StringBuilder sb = new StringBuilder(); @@ -291,8 +272,9 @@ public class ExportacaoFiscal { sb.append("").append(SEPARADOR); // Posição 32 sb.append("V").append(SEPARADOR); sb.append(formataCaracter(VAZIO, false, 15)).append(SEPARADOR); // Posição 34 - sb.append(formataCaracter(estabelecimentoECF, false, 4))/*.append(SEPARADOR); - sb.append(formataCaracter(numeroSerie, false, 6))*/; + sb.append(formataCaracter(estabelecimentoECF, false, 4)).append(SEPARADOR); + sb.append(formataCaracter(infoPadraoBilhetePassagem, false, 8)); + /*sb.append(formataCaracter(numeroSerie, false, 6))*/; writer.print(sb.toString() + UtiliteriasFiscal.QUEBRA_LINHA); } diff --git a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoECFTipoCFC.java b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoECFTipoCFC.java index 4cb086111..1b88e656a 100644 --- a/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoECFTipoCFC.java +++ b/src/com/rjconsultores/ventaboletos/utilerias/exportacaofiscal/vo/ExportacaoECFTipoCFC.java @@ -16,6 +16,7 @@ public class ExportacaoECFTipoCFC { private String estabelecimentoECF; private String ecf; private String numeroSerie; + private String infoPadraoBilhetePassagem; public ExportacaoECFTipoCFC() { @@ -125,8 +126,16 @@ public class ExportacaoECFTipoCFC { this.numeroSerie = numeroSerie; } + public String getInfoPadraoBilhetePassagem() { + return infoPadraoBilhetePassagem; + } + + public void setInfoPadraoBilhetePassagem(String infoPadraoBilhetePassagem) { + this.infoPadraoBilhetePassagem = infoPadraoBilhetePassagem; + } + @Override public String toString() { - return "ExportacaoECFTipoCFC [estabelecimento=" + estabelecimento + ", dataEmissao=" + dataEmissao + ", numeroIdentificacaoECF=" + numeroIdentificacaoECF + ", cooReducaoZ=" + cooReducaoZ + ", cooInicial=" + cooInicial + ", cooFinal=" + cooFinal + ", contadorReducao=" + contadorReducao + ", cro=" + cro + ", valorTotal=" + valorTotal + ", valorIsentas=" + valorIsentas + ", estabelecimentoECF=" + estabelecimentoECF + ", ecf=" + ecf + ", numeroSerie=" + numeroSerie + "]"; + return "ExportacaoECFTipoCFC [estabelecimento=" + estabelecimento + ", dataEmissao=" + dataEmissao + ", numeroIdentificacaoECF=" + numeroIdentificacaoECF + ", cooReducaoZ=" + cooReducaoZ + ", cooInicial=" + cooInicial + ", cooFinal=" + cooFinal + ", contadorReducao=" + contadorReducao + ", cro=" + cro + ", valorTotal=" + valorTotal + ", valorIsentas=" + valorIsentas + ", estabelecimentoECF=" + estabelecimentoECF + ", ecf=" + ecf + ", numeroSerie=" + numeroSerie + ", infoPadraoBilhetePassagem=" + infoPadraoBilhetePassagem + "]"; } }