Rev 447 | Rev 462 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 447 | Rev 449 | ||
|---|---|---|---|
| Line 10... | Line 10... | ||
| 10 | 10 | ||
| 11 | import br.com.ec.controller.consultademanda.NotaFiscalConsultaPorDemanda; |
11 | import br.com.ec.controller.consultademanda.NotaFiscalConsultaPorDemanda; |
| 12 | import br.com.ec.core.generic.GenericService; |
12 | import br.com.ec.core.generic.GenericService; |
| 13 | import br.com.ec.domain.dto.consulta.ParametrosConsultaNotaFiscal; |
13 | import br.com.ec.domain.dto.consulta.ParametrosConsultaNotaFiscal; |
| 14 | import br.com.ec.domain.model.NotaFiscal; |
14 | import br.com.ec.domain.model.NotaFiscal; |
| - | 15 | import br.com.ec.domain.model.Pessoa; |
|
| 15 | import br.com.ec.domain.model.Venda; |
16 | import br.com.ec.domain.model.Venda; |
| 16 | import br.com.ec.domain.model.nfe.TipoNotaFiscal; |
17 | import br.com.ec.domain.model.nfe.TipoNotaFiscal; |
| 17 | import br.com.ec.domain.service.EmissorRelatorioService; |
18 | import br.com.ec.domain.service.EmissorRelatorioService; |
| 18 | import br.com.ec.domain.service.NotaFiscalService; |
19 | import br.com.ec.domain.service.NotaFiscalService; |
| 19 | import br.com.ec.web.exception.VerificadorLancamentoException; |
20 | import br.com.ec.web.exception.VerificadorLancamentoException; |
| Line 36... | Line 37... | ||
| 36 | private NotaFiscalConsultaPorDemanda lazy; |
37 | private NotaFiscalConsultaPorDemanda lazy; |
| 37 | 38 | ||
| 38 | private Long sequencialVendaParaVinculo; |
39 | private Long sequencialVendaParaVinculo; |
| 39 | private StreamedContent danfeNfePreVisualizacao; |
40 | private StreamedContent danfeNfePreVisualizacao; |
| 40 | private StreamedContent danfeNfe; |
41 | private StreamedContent danfeNfe; |
| 41 | - | ||
| - | 42 | ||
| 42 | @Inject |
43 | @Inject |
| 43 | public NotaFiscalBean(NotaFiscalConsultaPorDemanda lazy, NotaFiscalService notaFiscalService, EmissorRelatorioService emissorRelatorioService) { |
44 | public NotaFiscalBean(NotaFiscalConsultaPorDemanda lazy, NotaFiscalService notaFiscalService, EmissorRelatorioService emissorRelatorioService) { |
| 44 | this.lazy = lazy; |
45 | this.lazy = lazy; |
| 45 | this.notaFiscalService = notaFiscalService; |
46 | this.notaFiscalService = notaFiscalService; |
| 46 | this.emissorRelatorioService = emissorRelatorioService; |
47 | this.emissorRelatorioService = emissorRelatorioService; |
| Line 70... | Line 71... | ||
| 70 | 71 | ||
| 71 | @Override |
72 | @Override |
| 72 | public void preConsultar() { |
73 | public void preConsultar() { |
| 73 | setTipoOperacao(TipoOperacao.CONSULTAR); |
74 | setTipoOperacao(TipoOperacao.CONSULTAR); |
| 74 | }
|
75 | }
|
| 75 | - | ||
| - | 76 | ||
| - | 77 | /*
|
|
| - | 78 | @Override
|
|
| - | 79 | public void preAlterar(NotaFiscal notaFiscal) {
|
|
| - | 80 | NotaFiscal notaFiscalDetalhada = notaFiscalService.detalhar(notaFiscal.getSequencial());
|
|
| - | 81 | super.preAlterar(notaFiscalDetalhada);
|
|
| - | 82 | }
|
|
| - | 83 | */
|
|
| - | 84 | ||
| 76 | @Override |
85 | @Override |
| 77 | public NotaFiscal getId() { |
86 | public NotaFiscal getId() { |
| 78 | return getEntidade(); |
87 | return getEntidade(); |
| 79 | }
|
88 | }
|
| 80 | 89 | ||
| Line 171... | Line 180... | ||
| 171 | 180 | ||
| 172 | public void emitirDanfeNfeTeste() { |
181 | public void emitirDanfeNfeTeste() { |
| 173 | Long sequencialNotaFiscal = new Long(168722); |
182 | Long sequencialNotaFiscal = new Long(168722); |
| 174 | setDanfeNfePreVisualizacao(notaFiscalService.gerarDanfeNfePreVisualizacao(sequencialNotaFiscal)); |
183 | setDanfeNfePreVisualizacao(notaFiscalService.gerarDanfeNfePreVisualizacao(sequencialNotaFiscal)); |
| 175 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
184 | setDanfeNfe(notaFiscalService.gerarDanfeNfe(sequencialNotaFiscal)); |
| - | 185 | }
|
|
| - | 186 | ||
| - | 187 | public void selecionarEmitente(final Pessoa pessoa) { |
|
| - | 188 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 189 | public void execute() { |
|
| - | 190 | getEntidade().setPessoaEmitente(pessoa); |
|
| - | 191 | adicionandoParametroArgsConfirmandoAcao(true); |
|
| - | 192 | }
|
|
| - | 193 | }); |
|
| - | 194 | }
|
|
| - | 195 | ||
| - | 196 | public void retirarEmitente() { |
|
| - | 197 | getEntidade().setPessoaEmitente(null); |
|
| - | 198 | }
|
|
| - | 199 | ||
| - | 200 | public void selecionarDestinatario(final Pessoa pessoa) { |
|
| - | 201 | new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() { |
|
| - | 202 | public void execute() { |
|
| - | 203 | getEntidade().setPessoaDestinatario(pessoa); |
|
| - | 204 | adicionandoParametroArgsConfirmandoAcao(true); |
|
| - | 205 | }
|
|
| - | 206 | }); |
|
| - | 207 | }
|
|
| - | 208 | ||
| - | 209 | public void retirarDestinatario() { |
|
| - | 210 | getEntidade().setPessoaDestinatario(null); |
|
| - | 211 | }
|
|
| - | 212 | ||
| - | 213 | public void consultarProdutosVinculados() { |
|
| - | 214 | getEntidade().setListaProdutosVinculadosDTO(notaFiscalService.consultarProdutosVinculados(getEntidade().getSequencial())); |
|
| 176 | }
|
215 | }
|
| 177 | 216 | ||
| 178 | /*
|
217 | /*
|
| 179 | private StreamedContent chart;
|
218 | private StreamedContent chart;
|
| 180 | public StreamedContent getChart() {
|
219 | public StreamedContent getChart() {
|