Rev 106 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | espaco | 1 | package br.com.ec.domain.dto; |
| 2 | |||
| 3 | import java.beans.Transient; |
||
| 4 | |||
| 195 | espaco | 5 | import br.com.ec.core.util.VerificadorUtil; |
| 106 | espaco | 6 | import br.com.ec.domain.model.Conta; |
| 7 | import br.com.ec.domain.model.Parcela; |
||
| 8 | |||
| 9 | public class ContaGerenciadorDTO { |
||
| 10 | |||
| 11 | private Conta conta; |
||
| 12 | private Parcela parcela; |
||
| 13 | |||
| 14 | // private List<Lancamento> listaLancamento; |
||
| 15 | // private List<VendaFormaPagamento> listaVendaFormaPagamentos; |
||
| 16 | |||
| 17 | public ContaGerenciadorDTO() {} |
||
| 18 | |||
| 19 | public Conta getConta() { |
||
| 20 | return conta; |
||
| 21 | } |
||
| 22 | public void setConta(Conta conta) { |
||
| 23 | this.conta = conta; |
||
| 24 | } |
||
| 25 | |||
| 26 | public Parcela getParcela() { |
||
| 27 | return parcela; |
||
| 28 | } |
||
| 29 | public void setParcela(Parcela parcela) { |
||
| 30 | this.parcela = parcela; |
||
| 31 | } |
||
| 32 | |||
| 33 | /* |
||
| 34 | public List<Lancamento> getListaLancamento() { |
||
| 35 | return listaLancamento; |
||
| 36 | } |
||
| 37 | public void setListaLancamento(List<Lancamento> listaLancamento) { |
||
| 38 | this.listaLancamento = listaLancamento; |
||
| 39 | } |
||
| 40 | |||
| 41 | public List<VendaFormaPagamento> getListaVendaFormaPagamentos() { |
||
| 42 | return listaVendaFormaPagamentos; |
||
| 43 | } |
||
| 44 | public void setListaVendaFormaPagamentos(List<VendaFormaPagamento> listaVendaFormaPagamentos) { |
||
| 45 | this.listaVendaFormaPagamentos = listaVendaFormaPagamentos; |
||
| 46 | } |
||
| 47 | |||
| 48 | @Transient |
||
| 49 | public Double getTotalLancamentos() { |
||
| 50 | Double total = 0.0; |
||
| 51 | if (VerificadorUtil.naoEstaNulo(getListaLancamento())) { |
||
| 52 | for (Lancamento lancamento : getListaLancamento()) { |
||
| 53 | total = total + lancamento.getValorVenda(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 | return total; |
||
| 57 | } |
||
| 58 | |||
| 59 | @Transient |
||
| 60 | public Double getTotalPago() { |
||
| 61 | Double total = new Double(0.0); |
||
| 62 | if (VerificadorUtil.naoEstaNulo(getListaVendaFormaPagamentos())) { |
||
| 63 | for (VendaFormaPagamento pagamento : getListaVendaFormaPagamentos()) { |
||
| 64 | total = total + pagamento.getValorPagamento(); |
||
| 65 | } |
||
| 66 | } |
||
| 67 | return total; |
||
| 68 | }*/ |
||
| 69 | |||
| 70 | @Transient |
||
| 71 | public String sequencialDaConta() { |
||
| 72 | if (VerificadorUtil.naoEstaNulo(getConta())) { |
||
| 73 | if (VerificadorUtil.naoEstaNulo(getConta().getSequencial())) { |
||
| 74 | return " [" + getConta().getSequencial() + "]"; |
||
| 75 | } |
||
| 76 | } |
||
| 77 | return "[NOVO]"; |
||
| 78 | } |
||
| 79 | |||
| 80 | @Transient |
||
| 81 | public Long getSequencialDaConta() { |
||
| 82 | return VerificadorUtil.naoEstaNulo(getConta())? getConta().getSequencial() : null; |
||
| 83 | } |
||
| 84 | |||
| 85 | } |