Subversion Repositories Integrator Subversion

Rev

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

Rev 305 Rev 320
Line 390... Line 390...
390
                                        .comConteudo(montarDadosDaVenda(venda, venda.getUsuario(), parametrosVenda.getLancamentos(), parametrosVenda.getLancamentosPagamentos()))
390
                                        .comConteudo(montarDadosDaVenda(venda, venda.getUsuario(), parametrosVenda.getLancamentos(), parametrosVenda.getLancamentosPagamentos()))
391
                                        .enviar();
391
                                        .enviar();
392
                        }
392
                        }
393
                }
393
                }
394
        }
394
        }
395
        */
-
 
-
 
395
       
396
396

397
        private Boolean pagamentoDividido(ParametrosVendaDTO parametrosVenda) {
397
        private Boolean pagamentoDividido(ParametrosVendaDTO parametrosVenda) {
398
                for (VendaFormaPagamento pagamento : parametrosVenda.getLancamentosPagamentos()) {
398
                for (VendaFormaPagamento pagamento : parametrosVenda.getLancamentosPagamentos()) {
399
                        if (pagamento.getFormaPagamento().formaPagamentoEhCreditoDividido()) {
399
                        if (pagamento.getFormaPagamento().formaPagamentoEhCreditoDividido()) {
400
                                return true;
400
                                return true;
Line 409... Line 409...
409
                                return true;
409
                                return true;
410
                        }
410
                        }
411
                }
411
                }
412
                return false;
412
                return false;
413
        }
413
        }
-
 
414
        */
414
       
415
       
415
        private boolean descontosEmProdutosSuperiores(ParametrosVendaDTO parametrosVenda) {
416
        private boolean descontosEmProdutosSuperiores(ParametrosVendaDTO parametrosVenda) {
-
 
417
                if (produtoJBLComDesconto(parametrosVenda.getLancamentos())) {
-
 
418
                        return true;
-
 
419
                }
-
 
420
               
-
 
421
                Double totalDescontoPermitido = 0.0;
-
 
422
                Double totalDescontoConcebido = 0.0;
416
                for (Lancamento lancamento : parametrosVenda.getLancamentos()) {
423
                for (Lancamento lancamento : parametrosVenda.getLancamentos()) {
417
                        if (lancamento.comDescontosAcimaDoPermitido()) {
-
 
418
                                return true;
-
 
-
 
424
                        if (VerificadorUtil.naoEstaNulo(lancamento.getValorVarejo()) && VerificadorUtil.naoEstaNulo(lancamento.getValorVenda())) {
-
 
425
                                totalDescontoConcebido = totalDescontoConcebido + (lancamento.getValorVarejo() - lancamento.getValorVenda());
-
 
426
                                if (lancamento.getValorVarejo() < 100) {
-
 
427
                                        totalDescontoPermitido = totalDescontoPermitido + 5.0;
-
 
428
                                } else {
-
 
429
                                        totalDescontoPermitido = totalDescontoPermitido + (lancamento.getValorVarejo()*10/100);
-
 
430
                                }
419
                        }
431
                        }
-
 
432
                }
-
 
433
                if (totalDescontoConcebido > totalDescontoPermitido) {
-
 
434
                        return true;
420
                }
435
                }
421
                return false;
436
                return false;
422
        }
437
        }
423
       
438
       
-
 
439
        private boolean produtoJBLComDesconto(List<Lancamento> lancamentos) {
-
 
440
                for (Lancamento lancamento : lancamentos) {
-
 
441
                        if (lancamento.getProduto().getDescricaoCompleta().contains("JBL") && lancamento.comDescontos()) {
-
 
442
                                return true;
-
 
443
                        }
-
 
444
                }
-
 
445
                return false;
-
 
446
        }
-
 
447
424
        private boolean produtosComDescontoECupom(ParametrosVendaDTO parametrosVenda) {
448
        private boolean produtosComDescontoECupom(ParametrosVendaDTO parametrosVenda) {
425
                for (Lancamento lancamento : parametrosVenda.getLancamentos()) {
449
                for (Lancamento lancamento : parametrosVenda.getLancamentos()) {
426
                        if (VerificadorUtil.naoEstaNulo(lancamento.getCupom()) && lancamento.comDescontos()) {
450
                        if (VerificadorUtil.naoEstaNulo(lancamento.getCupom()) && lancamento.comDescontos()) {
427
                                return true;
451
                                return true;
428
                        }
452
                        }