Rev 195 | Rev 280 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 195 | Rev 277 | ||
|---|---|---|---|
| Line 639... | Line 639... | ||
| 639 | 639 | ||
| 640 | public void adicionarPagamento(final VendaFormaPagamento vendaFormaPagamento) { |
640 | public void adicionarPagamento(final VendaFormaPagamento vendaFormaPagamento) { |
| 641 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
641 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 642 | public void execute() { |
642 | public void execute() { |
| 643 | verificarPagamento(vendaFormaPagamento); |
643 | verificarPagamento(vendaFormaPagamento); |
| - | 644 | seParcelaAcima12xAlterarMaquineta(getFormaPagamento()); |
|
| 644 | getParametrosVenda().getLancamentosPagamentos().add(vendaFormaPagamento); |
645 | getParametrosVenda().getLancamentosPagamentos().add(vendaFormaPagamento); |
| 645 | setFormaPagamento(null); |
646 | setFormaPagamento(null); |
| 646 | setValorPagamento(null); |
647 | setValorPagamento(null); |
| 647 | setCupomSelecionado(null); |
648 | setCupomSelecionado(null); |
| 648 | LancadorMensagem.lancarSucesso("PAGAMENTO ADICIONADO COM SUCESSO"); |
649 | LancadorMensagem.lancarSucesso("PAGAMENTO ADICIONADO COM SUCESSO"); |
| Line 660... | Line 661... | ||
| 660 | if (pagamento.getCodigoDaFormaPagamento().equals(vendaFormaPagamento.getCodigoDaFormaPagamento())) {
|
661 | if (pagamento.getCodigoDaFormaPagamento().equals(vendaFormaPagamento.getCodigoDaFormaPagamento())) {
|
| 661 | throw new NegocioException("FORMA DE PAGAMENTO JÁ EXISTE");
|
662 | throw new NegocioException("FORMA DE PAGAMENTO JÁ EXISTE");
|
| 662 | }
|
663 | }
|
| 663 | }
|
664 | }
|
| 664 | */
|
665 | */
|
| - | 666 | }
|
|
| - | 667 | ||
| - | 668 | private void seParcelaAcima12xAlterarMaquineta(FormaPagamento formaPagamento) { |
|
| - | 669 | if (formaPagamento.formaPagamentoEhCreditoAcima12x()) { |
|
| - | 670 | getParametrosVenda().setMaquineta(null); |
|
| - | 671 | }
|
|
| 665 | }
|
672 | }
|
| 666 | }); |
673 | }); |
| 667 | }
|
674 | }
|
| 668 | 675 | ||
| 669 | protected void verificarPagamentoNoCartao(FormaPagamento formaPagamento) { |
676 | protected void verificarPagamentoNoCartao(FormaPagamento formaPagamento) { |
| Line 742... | Line 749... | ||
| 742 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
749 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 743 | public void execute() { |
750 | public void execute() { |
| 744 | setVendaSelecionada(vendaService.cadastrarVendaPeloPDV(getParametrosVenda())); |
751 | setVendaSelecionada(vendaService.cadastrarVendaPeloPDV(getParametrosVenda())); |
| 745 | preCarregamento(); |
752 | preCarregamento(); |
| 746 | getParametrosVenda().setLoja(getVendaSelecionada().getLoja()); |
753 | getParametrosVenda().setLoja(getVendaSelecionada().getLoja()); |
| 747 | getParametrosVenda().setMaquineta(getParametrosVenda().getLoja().getMaquineta()); |
- | |
| 748 | setEmitirCupom(true); |
754 | setEmitirCupom(true); |
| 749 | LancadorMensagem.lancarSucesso("VENDA REALIZADA COM SUCESSO"); |
755 | LancadorMensagem.lancarSucesso("VENDA REALIZADA COM SUCESSO"); |
| 750 | }
|
756 | }
|
| 751 | }); |
757 | }); |
| 752 | }
|
758 | }
|
| Line 764... | Line 770... | ||
| 764 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
770 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
| 765 | public void execute() { |
771 | public void execute() { |
| 766 | setVendaSelecionada(vendaService.cadastrarVendaPeloPDV(getParametrosVenda())); |
772 | setVendaSelecionada(vendaService.cadastrarVendaPeloPDV(getParametrosVenda())); |
| 767 | preCarregamento(); |
773 | preCarregamento(); |
| 768 | getParametrosVenda().setLoja(getVendaSelecionada().getLoja()); |
774 | getParametrosVenda().setLoja(getVendaSelecionada().getLoja()); |
| 769 | getParametrosVenda().setMaquineta(getParametrosVenda().getLoja().getMaquineta()); |
- | |
| 770 | getVendaSelecionada().setEmitirComanda(true); |
775 | getVendaSelecionada().setEmitirComanda(true); |
| 771 | setEmitirCupom(true); |
776 | setEmitirCupom(true); |
| 772 | LancadorMensagem.lancarSucesso("VENDA REALIZADA COM SUCESSO"); |
777 | LancadorMensagem.lancarSucesso("VENDA REALIZADA COM SUCESSO"); |
| 773 | }
|
778 | }
|
| 774 | }); |
779 | }); |