Go to most recent revision | Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | espaco | 1 | package br.com.ec.domain.dto; |
| 2 | |||
| 3 | import java.util.Date; |
||
| 4 | import java.util.List; |
||
| 5 | |||
| 6 | import br.com.ec.domain.model.FormaPagamento; |
||
| 7 | import br.com.ec.domain.model.Parcela; |
||
| 8 | import br.com.ec.domain.model.VendaFormaPagamento; |
||
| 9 | import br.edu.cesmac.core.util.VerificadorUtil; |
||
| 10 | |||
| 11 | public class CartaoDTO implements Comparable<CartaoDTO> { |
||
| 12 | |||
| 13 | private boolean gerarParcela; |
||
| 14 | private boolean parcelaGerada; |
||
| 15 | private FormaPagamento formaDePagamento; |
||
| 16 | private String bandeira; |
||
| 17 | private Double bruto; |
||
| 18 | private Double brutoImportado; |
||
| 19 | private Date dataVenda; |
||
| 20 | |||
| 21 | private Parcela parcela; |
||
| 22 | private VendaFormaPagamento vendaFormaPagamento; |
||
| 23 | |||
| 24 | private List<CartaoResumoDTO> cartoes; |
||
| 25 | |||
| 26 | public boolean isGerarParcela() { |
||
| 27 | return gerarParcela; |
||
| 28 | } |
||
| 29 | public boolean getGerarParcela() { |
||
| 30 | return gerarParcela; |
||
| 31 | } |
||
| 32 | public void setGerarParcela(boolean gerarParcela) { |
||
| 33 | this.gerarParcela = gerarParcela; |
||
| 34 | } |
||
| 35 | |||
| 36 | public boolean isParcelaGerada() { |
||
| 37 | return parcelaGerada; |
||
| 38 | } |
||
| 39 | public boolean getParcelaGerada() { |
||
| 40 | return parcelaGerada; |
||
| 41 | } |
||
| 42 | public void setParcelaGerada(boolean parcelaGerada) { |
||
| 43 | this.parcelaGerada = parcelaGerada; |
||
| 44 | } |
||
| 45 | |||
| 46 | public FormaPagamento getFormaDePagamento() { |
||
| 47 | return formaDePagamento; |
||
| 48 | } |
||
| 49 | public void setFormaDePagamento(FormaPagamento formaDePagamento) { |
||
| 50 | this.formaDePagamento = formaDePagamento; |
||
| 51 | } |
||
| 52 | public String getDescricaoFormaDePagamento() { |
||
| 53 | return VerificadorUtil.naoEstaNulo(getFormaDePagamento())? getFormaDePagamento().getDescricao() : null; |
||
| 54 | } |
||
| 55 | |||
| 56 | public String getBandeira() { |
||
| 57 | return bandeira; |
||
| 58 | } |
||
| 59 | public void setBandeira(String bandeira) { |
||
| 60 | this.bandeira = bandeira; |
||
| 61 | } |
||
| 62 | |||
| 63 | public Double getBruto() { |
||
| 64 | return bruto; |
||
| 65 | } |
||
| 66 | public void setBruto(Double bruto) { |
||
| 67 | this.bruto = bruto; |
||
| 68 | } |
||
| 69 | |||
| 70 | public Double getBrutoImportado() { |
||
| 71 | return brutoImportado; |
||
| 72 | } |
||
| 73 | public void setBrutoImportado(Double brutoImportado) { |
||
| 74 | this.brutoImportado = brutoImportado; |
||
| 75 | } |
||
| 76 | |||
| 77 | public Date getDataVenda() { |
||
| 78 | return dataVenda; |
||
| 79 | } |
||
| 80 | public void setDataVenda(Date dataVenda) { |
||
| 81 | this.dataVenda = dataVenda; |
||
| 82 | } |
||
| 83 | |||
| 84 | public Parcela getParcela() { |
||
| 85 | return parcela; |
||
| 86 | } |
||
| 87 | public void setParcela(Parcela parcela) { |
||
| 88 | this.parcela = parcela; |
||
| 89 | } |
||
| 90 | |||
| 91 | public VendaFormaPagamento getVendaFormaPagamento() { |
||
| 92 | return vendaFormaPagamento; |
||
| 93 | } |
||
| 94 | public void setVendaFormaPagamento(VendaFormaPagamento vendaFormaPagamento) { |
||
| 95 | this.vendaFormaPagamento = vendaFormaPagamento; |
||
| 96 | } |
||
| 97 | |||
| 98 | public List<CartaoResumoDTO> getCartoes() { |
||
| 99 | return cartoes; |
||
| 100 | } |
||
| 101 | public void setCartoes(List<CartaoResumoDTO> cartoes) { |
||
| 102 | this.cartoes = cartoes; |
||
| 103 | } |
||
| 104 | |||
| 105 | public Boolean parcelaJaExiste(Parcela parcela) { |
||
| 106 | return VerificadorUtil.naoEstaNulo(getParcela())? getParcela().equals(parcela) : false; |
||
| 107 | } |
||
| 108 | |||
| 109 | @Override |
||
| 110 | public int compareTo(CartaoDTO cartao) { |
||
| 111 | return this.getFormaDePagamento().getNumeroOrdem().compareTo(cartao.getFormaDePagamento().getNumeroOrdem()); |
||
| 112 | } |
||
| 113 | |||
| 114 | } |