Rev 195 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 195 | Rev 304 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | import br.com.ec.core.util.VerificadorUtil; |
17 | import br.com.ec.core.util.VerificadorUtil; |
| 18 | import br.com.ec.domain.dto.ContaGerenciadorDTO; |
18 | import br.com.ec.domain.dto.ContaGerenciadorDTO; |
| 19 | import br.com.ec.domain.model.Categoria; |
19 | import br.com.ec.domain.model.Categoria; |
| 20 | import br.com.ec.domain.model.Compra; |
20 | import br.com.ec.domain.model.Compra; |
| 21 | import br.com.ec.domain.model.Conta; |
21 | import br.com.ec.domain.model.Conta; |
| - | 22 | import br.com.ec.domain.model.FormaPagamento; |
|
| 22 | import br.com.ec.domain.model.Parcela; |
23 | import br.com.ec.domain.model.Parcela; |
| 23 | import br.com.ec.domain.model.Pessoa; |
24 | import br.com.ec.domain.model.Pessoa; |
| 24 | import br.com.ec.domain.model.Venda; |
25 | import br.com.ec.domain.model.Venda; |
| 25 | import br.com.ec.domain.model.tipos.TipoConta; |
26 | import br.com.ec.domain.model.tipos.TipoConta; |
| 26 | import br.com.ec.domain.service.categoria.CategoriaService; |
27 | import br.com.ec.domain.service.categoria.CategoriaService; |
| 27 | import br.com.ec.domain.service.compra.CompraService; |
28 | import br.com.ec.domain.service.compra.CompraService; |
| 28 | import br.com.ec.domain.service.conta.ContaService; |
29 | import br.com.ec.domain.service.conta.ContaService; |
| - | 30 | import br.com.ec.domain.service.formapagamento.FormaPagamentoService; |
|
| 29 | import br.com.ec.domain.service.parcela.ParcelaService; |
31 | import br.com.ec.domain.service.parcela.ParcelaService; |
| 30 | import br.com.ec.domain.shared.ConstantesSEC; |
32 | import br.com.ec.domain.shared.ConstantesSEC; |
| 31 | import br.com.ec.web.exception.VerificadorLancamentoException; |
33 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| 32 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
34 | import br.com.ec.web.exception.VerificadorLancamentoException.CommandBean; |
| 33 | import br.com.ec.web.generic.AbstractBean; |
35 | import br.com.ec.web.generic.AbstractBean; |
| Line 41... | Line 43... | ||
| 41 | 43 | ||
| 42 | private ParcelaService parcelaService; |
44 | private ParcelaService parcelaService; |
| 43 | private ContaService contaService; |
45 | private ContaService contaService; |
| 44 | private CompraService compraService; |
46 | private CompraService compraService; |
| 45 | private CategoriaService categoriaService; |
47 | private CategoriaService categoriaService; |
| - | 48 | private FormaPagamentoService formaPagamentoService; |
|
| 46 | 49 | ||
| 47 | private String chavePagamento; |
50 | private String chavePagamento; |
| 48 | private ParcelaDataModel parcelas; |
51 | private ParcelaDataModel parcelas; |
| 49 | private Long vincularConta; |
52 | private Long vincularConta; |
| - | 53 | private List<FormaPagamento> formasDePagamento; |
|
| 50 | 54 | ||
| 51 | @Inject |
55 | @Inject |
| 52 | public ContaGerenciadorBean(ParcelaService parcelaService, ContaService contaService, CompraService compraService, CategoriaService categoriaService) { |
- | |
| - | 56 | public ContaGerenciadorBean(ParcelaService parcelaService, ContaService contaService, CompraService compraService, CategoriaService categoriaService, |
|
| - | 57 | FormaPagamentoService formaPagamentoService) { |
|
| 53 | this.parcelaService = parcelaService; |
58 | this.parcelaService = parcelaService; |
| 54 | this.contaService = contaService; |
59 | this.contaService = contaService; |
| 55 | this.compraService = compraService; |
60 | this.compraService = compraService; |
| 56 | this.categoriaService = categoriaService; |
61 | this.categoriaService = categoriaService; |
| - | 62 | this.formaPagamentoService = formaPagamentoService; |
|
| 57 | }
|
63 | }
|
| 58 | 64 | ||
| 59 | @Override |
65 | @Override |
| 60 | public void preCarregamento() { |
66 | public void preCarregamento() { |
| 61 | setEntidade(new ContaGerenciadorDTO()); |
67 | setEntidade(new ContaGerenciadorDTO()); |
| Line 123... | Line 129... | ||
| 123 | public Long getVincularConta() { |
129 | public Long getVincularConta() { |
| 124 | return vincularConta; |
130 | return vincularConta; |
| 125 | }
|
131 | }
|
| 126 | public void setVincularConta(Long vincularConta) { |
132 | public void setVincularConta(Long vincularConta) { |
| 127 | this.vincularConta = vincularConta; |
133 | this.vincularConta = vincularConta; |
| - | 134 | }
|
|
| - | 135 | ||
| - | 136 | public List<FormaPagamento> getFormasDePagamento() { |
|
| - | 137 | if (VerificadorUtil.estaNulo(formasDePagamento)) { |
|
| - | 138 | setFormasDePagamento(formaPagamentoService.listarFormasPagamentoAtivas()); |
|
| - | 139 | }
|
|
| - | 140 | return formasDePagamento; |
|
| - | 141 | }
|
|
| - | 142 | public void setFormasDePagamento(List<FormaPagamento> formasDePagamento) { |
|
| - | 143 | this.formasDePagamento = formasDePagamento; |
|
| 128 | }
|
144 | }
|
| 129 | 145 | ||
| 130 | public void onRowSelect(SelectEvent event) { |
146 | public void onRowSelect(SelectEvent event) { |
| 131 | preencherConta(((Parcela) event.getObject())); |
147 | preencherConta(((Parcela) event.getObject())); |
| 132 | }
|
148 | }
|