Subversion Repositories Integrator Subversion

Rev

Rev 502 | Rev 543 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 502 Rev 541
Line 52... Line 52...
52
        private NotaFiscalConsultaPorDemanda lazy;
52
        private NotaFiscalConsultaPorDemanda lazy;
53
       
53
       
54
        private Long sequencialVendaParaVinculo;
54
        private Long sequencialVendaParaVinculo;
55
        private StreamedContent danfeNfePreVisualizacao;
55
        private StreamedContent danfeNfePreVisualizacao;
56
        private StreamedContent danfeNfe;
56
        private StreamedContent danfeNfe;
-
 
57
       
-
 
58
        private Boolean prepararNotaFiscal;
-
 
59
        private String tipoNotaFiscalParaEmissao;
57
       
60
       
58
        private String codigoProdutoParaVinculoNotaFiscal = "";
61
        private String codigoProdutoParaVinculoNotaFiscal = "";
59
        private ProdutoDTO produtoDTOParaVinculoNotaFiscal;
62
        private ProdutoDTO produtoDTOParaVinculoNotaFiscal;
60
        private CompraProdutoDTO compraProdutoDTOParaVinculoNotaFiscal;
63
        private CompraProdutoDTO compraProdutoDTOParaVinculoNotaFiscal;
61
        private List<CompraProdutoDTO> listaCompraProdutoDTOParaVinculoNotaFiscal;
64
        private List<CompraProdutoDTO> listaCompraProdutoDTOParaVinculoNotaFiscal;
Line 89... Line 92...
89
        }
92
        }
90
93
91
        @Override
94
        @Override
92
        public void limparEntidade() {
95
        public void limparEntidade() {
93
                setEntidade(new NotaFiscal());
96
                setEntidade(new NotaFiscal());
-
 
97
                setPrepararNotaFiscal(true);
94
        }
98
        }
95
99
96
        @Override
100
        @Override
97
        public GenericService<NotaFiscal> getService() {
101
        public GenericService<NotaFiscal> getService() {
98
                return notaFiscalService;
102
                return notaFiscalService;
Line 126... Line 130...
126
                        setTransporteSelecionado(new Transporte());
130
                        setTransporteSelecionado(new Transporte());
127
                } else {
131
                } else {
128
                        setTransporteSelecionado(notaFiscal.getTransporte());
132
                        setTransporteSelecionado(notaFiscal.getTransporte());
129
                }
133
                }
130
                super.preAlterar(notaFiscal);
134
                super.preAlterar(notaFiscal);
-
 
135
                setPrepararNotaFiscal(false);
131
        }
136
        }
132
       
137
       
133
        @Override
138
        @Override
134
        public void alterar() {
139
        public void alterar() {
135
                getEntidade().setTransporte(getTransporteSelecionado());
140
                getEntidade().setTransporte(getTransporteSelecionado());
Line 208... Line 213...
208
                return danfeNfe;
213
                return danfeNfe;
209
        }
214
        }
210
        public void setDanfeNfe(StreamedContent danfeNfe) {
215
        public void setDanfeNfe(StreamedContent danfeNfe) {
211
                this.danfeNfe = danfeNfe;
216
                this.danfeNfe = danfeNfe;
212
        }
217
        }
-
 
218
       
-
 
219
        public Boolean getPrepararNotaFiscal() {
-
 
220
                return prepararNotaFiscal;
-
 
221
        }
-
 
222
        public void setPrepararNotaFiscal(Boolean prepararNotaFiscal) {
-
 
223
                this.prepararNotaFiscal = prepararNotaFiscal;
-
 
224
        }
-
 
225
       
-
 
226
        public String getTipoNotaFiscalParaEmissao() {
-
 
227
                return tipoNotaFiscalParaEmissao;
-
 
228
        }
-
 
229
        public void setTipoNotaFiscalParaEmissao(String tipoNotaFiscalParaEmissao) {
-
 
230
                this.tipoNotaFiscalParaEmissao = tipoNotaFiscalParaEmissao;
-
 
231
        }
213
       
232
       
214
        public String getCodigoProdutoParaVinculoNotaFiscal() {
233
        public String getCodigoProdutoParaVinculoNotaFiscal() {
215
                return codigoProdutoParaVinculoNotaFiscal;
234
                return codigoProdutoParaVinculoNotaFiscal;
216
        }
235
        }
217
        public void setCodigoProdutoParaVinculoNotaFiscal(String codigoProdutoParaVinculoNotaFiscal) {
236
        public void setCodigoProdutoParaVinculoNotaFiscal(String codigoProdutoParaVinculoNotaFiscal) {
Line 266... Line 285...
266
        public void setStatusSefaz(String statusSefaz) {
285
        public void setStatusSefaz(String statusSefaz) {
267
                this.statusSefaz = statusSefaz;
286
                this.statusSefaz = statusSefaz;
268
        }
287
        }
269
       
288
       
270
        /**************************************************/
289
        /**************************************************/
-
 
290
       
-
 
291
        public void prepararNotaFiscalParaEmissao() {
-
 
292
                preCadastrar();
-
 
293
                if (getTipoNotaFiscalParaEmissao().equals(TipoNotaFiscal.NFE_SAIDA.getValor())) {
-
 
294
                        getEntidade().prepararNotaFiscalEletronicaVenda();
-
 
295
                }
-
 
296
                if (getTipoNotaFiscalParaEmissao().equals(TipoNotaFiscal.NFE_REMESSA_SAIDA.getValor())) {
-
 
297
                        getEntidade().prepararNotaFiscalEletronicaRemessa();
-
 
298
                }
-
 
299
                if (getTipoNotaFiscalParaEmissao().equals(TipoNotaFiscal.NFE_DEVOLUCAO.getValor())) {
-
 
300
                        getEntidade().prepararNotaFiscalEletronicaDevolucao();
-
 
301
                }
-
 
302
                if (getTipoNotaFiscalParaEmissao().equals(TipoNotaFiscal.NFE_IMPORTACAO.getValor())) {
-
 
303
                        getEntidade().prepararNotaFiscalEletronicaImportacao();
-
 
304
                }
-
 
305
                setPrepararNotaFiscal(false);
-
 
306
        }
271
       
307
       
272
        public void atualizarStatusSefaz() {
308
        public void atualizarStatusSefaz() {
273
                setStatusSefaz(notaFiscalService.retornarStatusSefaz());
309
                setStatusSefaz(notaFiscalService.retornarStatusSefaz());
274
        }
310
        }
275
       
311
       
Line 367... Line 403...
367
        }
403
        }
368
       
404
       
369
        /************************************/
405
        /************************************/
370
        /** REMESSA **/
406
        /** REMESSA **/
371
        /************************************/
407
        /************************************/
372
       
-
 
373
        public void prepararNotaFiscalRemessa() {
-
 
374
                preCadastrar();
-
 
375
                getEntidade().prepararNotaFiscalEletronicaRemessa();
-
 
376
        }
-
 
377
       
408
       
378
        public void emitirNotaFiscalRemessa() {
409
        public void emitirNotaFiscalRemessa() {
379
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
410
                new VerificadorLancamentoException().tratarIhRelancarExcecaoSemLimparEntidade(new CommandBean() {
380
                        public void execute() {
411
                        public void execute() {
381
                                notaFiscalService.emitirNotaFiscalEletronica(getEntidade());
412
                                notaFiscalService.emitirNotaFiscalEletronica(getEntidade());