Rev 195 | Rev 313 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 195 | Rev 293 | ||
|---|---|---|---|
| Line 241... | Line 241... | ||
| 241 | if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_REDE_1)) { |
241 | if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_REDE_1)) { |
| 242 | arquivoBancoRede(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), getMaquinetasSelecionadas(), getIndicadorVerificarMaquinetas()); |
242 | arquivoBancoRede(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), getMaquinetasSelecionadas(), getIndicadorVerificarMaquinetas()); |
| 243 | }
|
243 | }
|
| 244 | if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_SAFRA_2)) { |
244 | if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_SAFRA_2)) { |
| 245 | arquivoBancoSafra(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada()); |
245 | arquivoBancoSafra(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada()); |
| - | 246 | }
|
|
| - | 247 | if (getTipoArquivoSelecionado().equals(ConstantesSEC.ArquivoBanco.ARQUIVO_BANCO_PAGSEGURO_3)) { |
|
| - | 248 | arquivoBancoPagseguro(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada()); |
|
| 246 | }
|
249 | }
|
| 247 | setListaVendaFormaPagamento(vendaFormaPagamentoService.consultarLancamentosCartoesNoPeriodo(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), null, getMaquinetasSelecionadas())); |
250 | setListaVendaFormaPagamento(vendaFormaPagamentoService.consultarLancamentosCartoesNoPeriodo(getCartaoResumoGeral().getDataInicialVendasSelecionada(), getCartaoResumoGeral().getDataFinalVendasSelecionada(), null, getMaquinetasSelecionadas())); |
| 248 | for (VendaFormaPagamento vendaFormaPagamento : getListaVendaFormaPagamento()) { |
251 | for (VendaFormaPagamento vendaFormaPagamento : getListaVendaFormaPagamento()) { |
| 249 | if (VerificadorUtil.estaNulo(vendaFormaPagamento.getCupom())) { |
252 | if (VerificadorUtil.estaNulo(vendaFormaPagamento.getCupom())) { |
| 250 | preencherDados(vendaFormaPagamento); |
253 | preencherDados(vendaFormaPagamento); |
| Line 342... | Line 345... | ||
| 342 | tipoCartao = TipoCartao.CREDITO.getValor(); |
345 | tipoCartao = TipoCartao.CREDITO.getValor(); |
| 343 | formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas)); |
346 | formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas)); |
| 344 | }
|
347 | }
|
| 345 | cartao.setBrutoImportado(new Double(dadosSeparados[11].replace(".", "").replace(",", "."))); |
348 | cartao.setBrutoImportado(new Double(dadosSeparados[11].replace(".", "").replace(",", "."))); |
| 346 | preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao); |
349 | preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao); |
| - | 350 | }
|
|
| - | 351 | }
|
|
| - | 352 | }
|
|
| - | 353 | ||
| - | 354 | private void arquivoBancoPagseguro(Date dataInicial, Date dataFinal) { |
|
| - | 355 | for (String linha : getLinhas()) { |
|
| - | 356 | Boolean adicionar = true; |
|
| - | 357 | String[] dadosSeparados = linha.split(";"); |
|
| - | 358 | Date dataLinha = DataUtil.retornarDataApartirString("dd/MM/yyyy hh:mm", dadosSeparados[2]); |
|
| - | 359 | if (DataUtils.dataEstaIgualOuEntrePeriodos(DataUtil.retornarDataFormatada("dd/MM/yyyy", dataLinha), dataInicial, dataFinal)) { |
|
| - | 360 | if (indicadorVerificarMaquinetas) { |
|
| - | 361 | if (!maquinetasSelecionadas.isEmpty()) { |
|
| - | 362 | for (Maquineta maquinetaSelecionada : maquinetasSelecionadas) { |
|
| - | 363 | adicionar = false; |
|
| - | 364 | String maquineta = dadosSeparados[3]; |
|
| - | 365 | if (maquinetaSelecionada.getDescricao().equals(maquineta)) { |
|
| - | 366 | adicionar = true; |
|
| - | 367 | break; |
|
| - | 368 | }
|
|
| - | 369 | }
|
|
| - | 370 | }
|
|
| - | 371 | }
|
|
| - | 372 | if (adicionar) { |
|
| - | 373 | CartaoDTO cartao = new CartaoDTO(); |
|
| - | 374 | cartao.setBandeira(StringUtil.setarUpperCaseComTrim(dadosSeparados[5])); |
|
| - | 375 | FormaPagamento formaPagamento = null; |
|
| - | 376 | String bandeira = StringUtil.setarUpperCaseComTrim(dadosSeparados[4]); |
|
| - | 377 | String tipoCartao = null; |
|
| - | 378 | if (bandeira.equals("Débito") || bandeira.equals("D�BITO")) { |
|
| - | 379 | tipoCartao = TipoCartao.DEBITO.getValor(); |
|
| - | 380 | formaPagamento = new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_DEBITO); |
|
| - | 381 | if (cartao.getBandeira().equals("MasterCard")) { |
|
| - | 382 | cartao.setBandeira("MAESTRO"); |
|
| - | 383 | }
|
|
| - | 384 | } else { |
|
| - | 385 | tipoCartao = TipoCartao.CREDITO.getValor(); |
|
| - | 386 | String parcelas = dadosSeparados[6]; |
|
| - | 387 | if (parcelas.equals("À vista") || parcelas.equals("� vista")) { |
|
| - | 388 | parcelas = "1"; |
|
| - | 389 | }
|
|
| - | 390 | formaPagamento = new FormaPagamento(FormaPagamento.recuperarCodigoDaFormaDePagamento(parcelas)); |
|
| - | 391 | }
|
|
| - | 392 | cartao.setBrutoImportado(new Double(dadosSeparados[7])); |
|
| - | 393 | preencherDadosArquivo(dataLinha, cartao, formaPagamento, tipoCartao); |
|
| - | 394 | }
|
|
| 347 | }
|
395 | }
|
| 348 | }
|
396 | }
|
| 349 | }
|
397 | }
|
| 350 | 398 | ||
| 351 | private void preencherDadosArquivo(Date data, CartaoDTO cartao, FormaPagamento formaPagamento, String tipoCartao) { |
399 | private void preencherDadosArquivo(Date data, CartaoDTO cartao, FormaPagamento formaPagamento, String tipoCartao) { |