Subversion Repositories Integrator Subversion

Rev

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

Rev 688 Rev 689
Line 675... Line 675...
675
        }
675
        }
676
       
676
       
677
        public void adicionarPagamentoComCashback() {
677
        public void adicionarPagamentoComCashback() {
678
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
678
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
679
                        public void execute() {
679
                        public void execute() {
-
 
680
                                Double valorCashback = new Double(getValorPagamento());
-
 
681
                                Double valorCashbackDisponivel = new Double(getParametrosVenda().getCliente().getValorCashbackDisponivel());
-
 
682
                                if (VerificadorUtil.naoEstaNuloOuVazio(valorCashback)) {
-
 
683
                                        if (VerificadorUtil.naoEstaNuloOuVazio(valorCashbackDisponivel)) {
-
 
684
                                                if (valorCashbackDisponivel < valorCashback) {
-
 
685
                                                        throw new NegocioException("VALOR DE CASHBACK MAIOR QUE O PERMITIDO");
-
 
686
                                                }
-
 
687
                                        }
-
 
688
                                }
-
 
689
                               
680
                                FormaPagamento formaPagamento = formaPagamentoService.consultarPorId(new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_CASHBACK_28));
690
                                FormaPagamento formaPagamento = formaPagamentoService.consultarPorId(new FormaPagamento(ConstantesSEC.FormasDePagamento.FORMAPAGAMENTO_CASHBACK_28));
681
                                VendaFormaPagamento vendaFormaPagamento = new VendaFormaPagamento(getEntidade(), formaPagamento);
691
                                VendaFormaPagamento vendaFormaPagamento = new VendaFormaPagamento(getEntidade(), formaPagamento);
682
                                vendaFormaPagamento.setValorPagamento(getValorPagamento());
692
                                vendaFormaPagamento.setValorPagamento(getValorPagamento());
683
                                retirarCashbackCliente(getValorPagamento());
693
                                retirarCashbackCliente(getValorPagamento());
684
                                adicionarPagamento(vendaFormaPagamento);
694
                                adicionarPagamento(vendaFormaPagamento);