Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 200 | espaco | 1 | package br.com.ec.controller.managedbean; |
| 2 | |||
| 3 | import java.io.Serializable; |
||
| 4 | |||
| 5 | import javax.inject.Inject; |
||
| 6 | import javax.inject.Named; |
||
| 7 | |||
| 8 | import org.springframework.context.annotation.Scope; |
||
| 9 | |||
| 10 | import br.com.ec.controller.managedbean.consultademanda.ParcelaConsultaPorDemanda; |
||
| 11 | import br.com.ec.core.generic.GenericService; |
||
| 12 | import br.com.ec.core.util.DataUtils; |
||
| 13 | import br.com.ec.domain.dto.ParametrosConsultaLancamentosDTO; |
||
| 14 | import br.com.ec.domain.model.Parcela; |
||
| 15 | import br.com.ec.domain.model.Pessoa; |
||
| 16 | import br.com.ec.domain.model.tipos.TipoBuscaParcela; |
||
| 17 | import br.com.ec.web.generic.AbstractBean; |
||
| 18 | |||
| 19 | @Named |
||
| 20 | @Scope("view") |
||
| 21 | public class FinanceiroBean extends AbstractBean<Parcela> implements Serializable { |
||
| 22 | |||
| 23 | private static final long serialVersionUID = 1L; |
||
| 24 | |||
| 25 | private ParametrosConsultaLancamentosDTO parametrosConsultaLancamentos; |
||
| 26 | |||
| 27 | private ParcelaConsultaPorDemanda lazyLancamentos; |
||
| 28 | private ParcelaConsultaPorDemanda lazyProgramados; |
||
| 29 | |||
| 30 | @Inject |
||
| 31 | public FinanceiroBean(ParcelaConsultaPorDemanda lazyLancamentos, ParcelaConsultaPorDemanda lazyProgramados) { |
||
| 32 | this.lazyLancamentos = lazyLancamentos; |
||
| 33 | this.lazyProgramados = lazyProgramados; |
||
| 34 | } |
||
| 35 | |||
| 36 | @Override |
||
| 37 | public void preCarregamento() { |
||
| 38 | entidade = new Parcela(); |
||
| 39 | parametrosConsultaLancamentos = new ParametrosConsultaLancamentosDTO(); |
||
| 40 | parametrosConsultaLancamentos.setEntidade(new Parcela()); |
||
| 41 | parametrosConsultaLancamentos.setDataInicial(DataUtils.getPrimeiroDiaDoMesAtual()); |
||
| 42 | parametrosConsultaLancamentos.setDataFinal(DataUtils.getUltimoDiaDoMesAtual()); |
||
| 43 | parametrosConsultaLancamentos.setTipoBusca(TipoBuscaParcela.PAGOS.getValor()); |
||
| 44 | } |
||
| 45 | |||
| 46 | @Override |
||
| 47 | public void limparEntidade() { |
||
| 48 | entidade = new Parcela(); |
||
| 49 | } |
||
| 50 | |||
| 51 | @Override |
||
| 52 | public GenericService<Parcela> getService() { |
||
| 53 | return null; |
||
| 54 | } |
||
| 55 | |||
| 56 | @Override |
||
| 57 | public Parcela getEntidade() { |
||
| 58 | return entidade; |
||
| 59 | } |
||
| 60 | |||
| 61 | @Override |
||
| 62 | public Parcela getId() { |
||
| 63 | return getEntidade(); |
||
| 64 | } |
||
| 65 | |||
| 66 | public TipoBuscaParcela[] getTiposBuscaParcela() { |
||
| 67 | return TipoBuscaParcela.values(); |
||
| 68 | } |
||
| 69 | |||
| 70 | public ParametrosConsultaLancamentosDTO getParametrosConsultaLancamentos() { |
||
| 71 | return parametrosConsultaLancamentos; |
||
| 72 | } |
||
| 73 | public void setParametrosConsultaLancamentos(ParametrosConsultaLancamentosDTO parametrosConsultaLancamentos) { |
||
| 74 | this.parametrosConsultaLancamentos = parametrosConsultaLancamentos; |
||
| 75 | } |
||
| 76 | |||
| 77 | public ParcelaConsultaPorDemanda getLazyLancamentos() { |
||
| 78 | return lazyLancamentos; |
||
| 79 | } |
||
| 80 | public void setLazyLancamentos(ParcelaConsultaPorDemanda lazyLancamentos) { |
||
| 81 | this.lazyLancamentos = lazyLancamentos; |
||
| 82 | } |
||
| 83 | public void prepararConsultaDemandaLancados() { |
||
| 84 | getParametrosConsultaLancamentos().setPagamentoRealizado(true); |
||
| 85 | getParametrosConsultaLancamentos().setOrdenacao("e.dataPagamento DESC"); |
||
| 86 | lazyLancamentos.setarParametrosConsulta(getParametrosConsultaLancamentos()); |
||
| 87 | } |
||
| 88 | |||
| 89 | public ParcelaConsultaPorDemanda getLazyProgramados() { |
||
| 90 | return lazyProgramados; |
||
| 91 | } |
||
| 92 | public void setLazyProgramados(ParcelaConsultaPorDemanda lazyProgramados) { |
||
| 93 | this.lazyProgramados = lazyProgramados; |
||
| 94 | } |
||
| 95 | public void prepararConsultaDemandaProgramados() { |
||
| 96 | getParametrosConsultaLancamentos().setPagamentoRealizado(false); |
||
| 97 | getParametrosConsultaLancamentos().setOrdenacao("e.dataVencimento"); |
||
| 98 | lazyProgramados.setarParametrosConsulta(getParametrosConsultaLancamentos()); |
||
| 99 | } |
||
| 100 | |||
| 101 | public void selecionarFavorecidoParaConsulta(Pessoa pessoa) { |
||
| 102 | getParametrosConsultaLancamentos().setFavorecido(pessoa); |
||
| 103 | } |
||
| 104 | |||
| 105 | public void retirarFavorecidoParaConsulta() { |
||
| 106 | getParametrosConsultaLancamentos().setFavorecido(null); |
||
| 107 | } |
||
| 108 | |||
| 109 | /***************************************************************/ |
||
| 110 | |||
| 111 | } |