Subversion Repositories Integrator Subversion

Rev

Rev 613 | Rev 675 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 613 Rev 674
Line 246... Line 246...
246
                        }
246
                        }
247
                        if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_SAFRA_2)) {
247
                        if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_SAFRA_2)) {
248
                                arquivoBancoSafra(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada());
248
                                arquivoBancoSafra(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada());
249
                        }
249
                        }
250
                        if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_PAGSEGURO_3)) {
250
                        if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_PAGSEGURO_3)) {
-
 
251
                                arquivoBancoPagseguro(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada());
-
 
252
                        }
-
 
253
                        if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_INTER_5)) {
251
                                arquivoBancoPagseguro(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada());
254
                                arquivoBancoPagseguro(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada());
252
                        }
255
                        }
253
                setListaVendaFormaPagamento(vendaFormaPagamentoService.consultarLancamentosCartoesNoPeriodo(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), null, getMaquinetasSelecionadas()));
256
                setListaVendaFormaPagamento(vendaFormaPagamentoService.consultarLancamentosCartoesNoPeriodo(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), null, getMaquinetasSelecionadas()));
254
                for (VendaFormaPagamento vendaFormaPagamento : getListaVendaFormaPagamento()) {
257
                for (VendaFormaPagamento vendaFormaPagamento : getListaVendaFormaPagamento()) {
255
                        if (VerificadorUtil.estaNulo(vendaFormaPagamento.getCupom())) {
258
                        if (VerificadorUtil.estaNulo(vendaFormaPagamento.getCupom())) {
Line 459... Line 462...
459
                                        String parcelas = dadosSeparados[6];
462
                                        String parcelas = dadosSeparados[6];
460
                                        if (parcelas.equals("À vista") || parcelas.equals("� vista")) {
463
                                        if (parcelas.equals("À vista") || parcelas.equals("� vista")) {
461
                                                parcelas = "1";
464
                                                parcelas = "1";
462
                                        } else if (parcelas.equals("Parcelado")) {
465
                                        } else if (parcelas.equals("Parcelado")) {
463
                                                parcelas = "2";
466
                                                parcelas = "2";
-
 
467
                                        }
-
 
468
                                        formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas));
-
 
469
                                }
-
 
470
                                cartao.setBrutoImportado(new Double(dadosSeparados[7]));
-
 
471
                                preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao);
-
 
472
                        }
-
 
473
                        }
-
 
474
                }
-
 
475
        }
-
 
476
       
-
 
477
        private void arquivoBancoInter(Date dataInicial, Date dataFinal) {
-
 
478
                for (String linha : getLinhas()) {
-
 
479
                        Boolean adicionar = true;
-
 
480
                String[] dadosSeparados = linha.split(";");
-
 
481
                Date dataLinha = DataUtil.retornarDataApartirString("dd/MM/yyyy - hh:mm:ss", dadosSeparados[1]);
-
 
482
                if (DataUtils.dataEstaIgualOuEntrePeriodos(DataUtil.retornarDataFormatada("dd/MM/yyyy", dataLinha), dataInicial, dataFinal)) {
-
 
483
                        if (indicadorVerificarMaquinetas) {
-
 
484
                                if (!maquinetasSelecionadas.isEmpty()) {
-
 
485
                                        for (Maquineta maquinetaSelecionada : maquinetasSelecionadas) {
-
 
486
                                                adicionar = false;
-
 
487
                                                String maquineta = dadosSeparados[2];
-
 
488
                                                if (maquinetaSelecionada.getDescricao().equals(maquineta)) {
-
 
489
                                                        adicionar = true;
-
 
490
                                                        break;
-
 
491
                                                }
-
 
492
                                        }
-
 
493
                                }      
-
 
494
                        }
-
 
495
                        if (adicionar) {
-
 
496
                                        CartaoDTO cartao = new CartaoDTO();
-
 
497
                                        cartao.setBandeira(StringUtil.setarUpperCaseComTrim(dadosSeparados[4]));
-
 
498
                                FormaPagamento formaPagamento = null;
-
 
499
                                String formaPag = StringUtil.setarUpperCaseComTrim(dadosSeparados[3]);
-
 
500
                                String tipoCartao = null;
-
 
501
                                if (formaPag.equals("DÉBITO") || formaPag.equals("D�BITO")) {
-
 
502
                                        tipoCartao = TipoCartao.DEBITO.getValor();
-
 
503
                                        formaPagamento = new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_DEBITO);
-
 
504
                                        if (cartao.getBandeira().equals("MASTERCARD")) {
-
 
505
                                                cartao.setBandeira("MAESTRO");
-
 
506
                                        }
-
 
507
                                } else {
-
 
508
                                        tipoCartao = TipoCartao.CREDITO.getValor();
-
 
509
                                        String parcelas = StringUtil.setarUpperCaseComTrim(dadosSeparados[3]);
-
 
510
                                        if (parcelas.equals("À VISTA") || parcelas.equals("� VISTA")) {
-
 
511
                                                parcelas = "1";
-
 
512
                                        } else if (parcelas.contains("X")) {
-
 
513
                                                parcelas = parcelas.replaceAll("\\D+", "");
464
                                        }
514
                                        }
465
                                        formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas));
515
                                        formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas));
466
                                }
516
                                }
467
                                cartao.setBrutoImportado(new Double(dadosSeparados[7]));
517
                                cartao.setBrutoImportado(new Double(dadosSeparados[7]));
468
                                preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao);
518
                                preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao);