Rev 195 | Details | Compare with Previous | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 106 | 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; |
||
| 195 | espaco | 11 | import br.com.ec.core.generic.GenericService; |
| 12 | import br.com.ec.core.util.DataUtils; |
||
| 106 | espaco | 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; |
||
| 195 | espaco | 17 | import br.com.ec.web.generic.AbstractBean; |
| 106 | espaco | 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()); |
||
| 577 | blopes | 44 | parametrosConsultaLancamentos.setNegociacao(false); |
| 106 | espaco | 45 | } |
| 46 | |||
| 47 | @Override |
||
| 48 | public void limparEntidade() { |
||
| 49 | entidade = new Parcela(); |
||
| 50 | } |
||
| 51 | |||
| 52 | @Override |
||
| 53 | public GenericService<Parcela> getService() { |
||
| 54 | return null; |
||
| 55 | } |
||
| 56 | |||
| 57 | @Override |
||
| 58 | public Parcela getEntidade() { |
||
| 59 | return entidade; |
||
| 60 | } |
||
| 61 | |||
| 62 | @Override |
||
| 63 | public Parcela getId() { |
||
| 64 | return getEntidade(); |
||
| 65 | } |
||
| 66 | |||
| 67 | public TipoBuscaParcela[] getTiposBuscaParcela() { |
||
| 68 | return TipoBuscaParcela.values(); |
||
| 69 | } |
||
| 70 | |||
| 71 | public ParametrosConsultaLancamentosDTO getParametrosConsultaLancamentos() { |
||
| 72 | return parametrosConsultaLancamentos; |
||
| 73 | } |
||
| 74 | public void setParametrosConsultaLancamentos(ParametrosConsultaLancamentosDTO parametrosConsultaLancamentos) { |
||
| 75 | this.parametrosConsultaLancamentos = parametrosConsultaLancamentos; |
||
| 76 | } |
||
| 77 | |||
| 78 | public ParcelaConsultaPorDemanda getLazyLancamentos() { |
||
| 79 | return lazyLancamentos; |
||
| 80 | } |
||
| 81 | public void setLazyLancamentos(ParcelaConsultaPorDemanda lazyLancamentos) { |
||
| 82 | this.lazyLancamentos = lazyLancamentos; |
||
| 83 | } |
||
| 84 | public void prepararConsultaDemandaLancados() { |
||
| 85 | getParametrosConsultaLancamentos().setPagamentoRealizado(true); |
||
| 86 | getParametrosConsultaLancamentos().setOrdenacao("e.dataPagamento DESC"); |
||
| 87 | lazyLancamentos.setarParametrosConsulta(getParametrosConsultaLancamentos()); |
||
| 88 | } |
||
| 89 | |||
| 90 | public ParcelaConsultaPorDemanda getLazyProgramados() { |
||
| 91 | return lazyProgramados; |
||
| 92 | } |
||
| 93 | public void setLazyProgramados(ParcelaConsultaPorDemanda lazyProgramados) { |
||
| 94 | this.lazyProgramados = lazyProgramados; |
||
| 95 | } |
||
| 96 | public void prepararConsultaDemandaProgramados() { |
||
| 97 | getParametrosConsultaLancamentos().setPagamentoRealizado(false); |
||
| 98 | getParametrosConsultaLancamentos().setOrdenacao("e.dataVencimento"); |
||
| 99 | lazyProgramados.setarParametrosConsulta(getParametrosConsultaLancamentos()); |
||
| 100 | } |
||
| 101 | |||
| 102 | public void selecionarFavorecidoParaConsulta(Pessoa pessoa) { |
||
| 103 | getParametrosConsultaLancamentos().setFavorecido(pessoa); |
||
| 104 | } |
||
| 105 | |||
| 106 | public void retirarFavorecidoParaConsulta() { |
||
| 107 | getParametrosConsultaLancamentos().setFavorecido(null); |
||
| 108 | } |
||
| 109 | |||
| 110 | /***************************************************************/ |
||
| 111 | |||
| 112 | } |