Subversion Repositories Integrator Subversion

Rev

Rev 106 | Rev 170 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
106 espaco 1
package br.com.ec.domain.model;
2
 
3
import java.io.ByteArrayInputStream;
4
import java.io.ByteArrayOutputStream;
5
import java.io.IOException;
126 espaco 6
import java.io.InputStream;
106 espaco 7
import java.io.Serializable;
8
import java.io.StringReader;
9
import java.util.Date;
10
import java.util.List;
11
 
12
import javax.persistence.Column;
13
import javax.persistence.Entity;
14
import javax.persistence.GeneratedValue;
15
import javax.persistence.GenerationType;
16
import javax.persistence.Id;
17
import javax.persistence.JoinColumn;
18
import javax.persistence.ManyToOne;
19
import javax.persistence.SequenceGenerator;
20
import javax.persistence.Table;
21
import javax.persistence.Transient;
22
import javax.validation.constraints.NotNull;
23
import javax.validation.constraints.Size;
24
import javax.xml.bind.JAXBContext;
25
import javax.xml.bind.JAXBException;
26
import javax.xml.bind.Unmarshaller;
27
import javax.xml.parsers.DocumentBuilder;
28
import javax.xml.parsers.DocumentBuilderFactory;
29
import javax.xml.transform.Transformer;
30
import javax.xml.transform.TransformerFactory;
31
import javax.xml.transform.dom.DOMSource;
32
import javax.xml.transform.stream.StreamResult;
33
import javax.xml.transform.stream.StreamSource;
34
 
35
import org.apache.commons.io.IOUtils;
36
import org.hibernate.annotations.ForeignKey;
37
import org.primefaces.model.DefaultStreamedContent;
38
import org.w3c.dom.Document;
39
 
40
import br.com.ec.domain.model.tipos.TipoModeloNotaFiscal;
41
import br.com.ec.domain.model.tipos.TipoNotaFiscal;
42
import br.edu.cesmac.core.exception.NegocioException;
43
import br.edu.cesmac.core.generic.identidade.Identidade;
44
import br.edu.cesmac.core.interfaces.Alterar;
45
import br.edu.cesmac.core.interfaces.Cadastrar;
46
import br.edu.cesmac.core.util.StringUtil;
47
import br.edu.cesmac.core.util.VerificadorUtil;
48
import br.edu.cesmac.relatorio.util.RelatorioUtils;
49
import br.edu.cesmac.web.util.DataUtil;
50
import nfce.java.TNfeProc;
51
 
52
@Entity
53
@Table(name="sec_nota_fiscal", schema="sc_sec")
54
public class NotaFiscal implements Serializable, Identidade {
55
 
56
        private static final long serialVersionUID = 1L;
57
 
58
        private Long sequencial;
59
        private Long numeroNotaFiscal;
60
        private String chave;
61
        private String serie;
62
        private Venda venda;
63
        private Pessoa pessoaJuridicaEmitente;
64
        private Pessoa pessoaJuridicaDestinatario;
65
        private String observacaoVenda;
66
//      private Transporte transporte;
67
        private String descricaoComplementares;
68
        private Date dataHoraEmissao;
69
        private String textoXml;
70
        private String tipoNotaFiscal;
71
        private String tipoModeloNotaFiscal;
72
        private String protocoloAutorizacao;
73
        private String caminhoQrcode;
74
 
75
        private String statusRetorno;
76
        private String motivoRetorno;
77
        private Date dataHoraEvento;
78
        private String textoXmlEvento;
79
 
80
        private List<NotaFiscalProduto> listaNFRemessaProdutos;
81
 
82
        private byte[] arquivoXml;
83
 
84
        private List<Parcela> listaParcelas;
85
        private List<CompraProduto> listaCompraProduto;
86
        private List<Lancamento> listaLancamento;
87
        private List<VendaFormaPagamento> listaFormaPagamento;
88
 
89
        private Boolean notaFiscalPendente;
90
 
91
        @Override
92
        @Transient
93
        public Object getId() {
94
                return this.getSequencial();
95
        }
96
        @Override
97
        public void setId(Object id) {
98
                this.sequencial = (Long) id;
99
        }
100
 
101
        @Id
102
        @SequenceGenerator(name = "sq_notafiscal")
103
        @GeneratedValue(strategy = GenerationType.IDENTITY)
104
        @Column(name="seq_nota_fiscal", nullable=false)
105
        public Long getSequencial() {
106
                return sequencial;
107
        }
108
        public void setSequencial(Long sequencial) {
109
                this.sequencial = sequencial;
110
        }
111
 
112
        @Column(name="cod_nota_fiscal")
113
        public String getChave() {
114
                return chave;
115
        }
116
        public void setChave(String chave) {
117
                this.chave = chave;
118
        }
119
 
120
        @Column(name="dsc_serie")
121
        public String getSerie() {
122
                return serie;
123
        }
124
        public void setSerie(String serie) {
125
                this.serie = serie;
126
        }
127
 
128
        @Column(name="num_nota_fiscal", nullable=false)
129
        public Long getNumeroNotaFiscal() {
130
                return numeroNotaFiscal;
131
        }
132
        public void setNumeroNotaFiscal(Long numeroNotaFiscal) {
133
                this.numeroNotaFiscal = numeroNotaFiscal;
134
        }
135
 
136
        @ManyToOne
137
        @ForeignKey(name = "fk_notafiscal_venda")
138
        @JoinColumn(name="seq_venda", referencedColumnName="seq_venda", insertable=true, updatable=false)
139
        public Venda getVenda() {
140
                return venda;
141
        }
142
        public void setVenda(Venda venda) {
143
                this.venda = venda;
144
        }
145
 
146
        @ManyToOne
147
        @ForeignKey(name = "fk_notafiscal_emitente")
148
        @JoinColumn(name="seq_pessoa_emitente", referencedColumnName="seq_pessoa", insertable=true, updatable=true)
149
        public Pessoa getPessoaJuridicaEmitente() {
150
                return pessoaJuridicaEmitente;
151
        }
152
        public void setPessoaJuridicaEmitente(Pessoa pessoaJuridicaEmitente) {
153
                this.pessoaJuridicaEmitente = pessoaJuridicaEmitente;
154
        }
155
 
156
        @ManyToOne
157
        @ForeignKey(name = "fk_notafiscal_destinatario")
158
        @JoinColumn(name="seq_pessoa_destinatario", referencedColumnName="seq_pessoa", insertable=true, updatable=true)
159
        public Pessoa getPessoaJuridicaDestinatario() {
160
                return pessoaJuridicaDestinatario;
161
        }
162
        public void setPessoaJuridicaDestinatario(Pessoa pessoaJuridicaDestinatario) {
163
                this.pessoaJuridicaDestinatario = pessoaJuridicaDestinatario;
164
        }
165
 
166
        @Column(name="dsc_obs_venda")
167
        @Size(max = 100, message = "Limite de caracteres ultrapassado: Observação da Venda")
168
        public String getObservacaoVenda() {
169
                return observacaoVenda;
170
        }
171
        public void setObservacaoVenda(String observacaoVenda) {
172
                this.observacaoVenda = observacaoVenda;
173
        }
174
 
175
        @Column(name="dsc_complementares")
176
        @Size(max = 1500, message = "Limite de caracteres ultrapassado: Descrição Complementares")
177
        public String getDescricaoComplementares() {
178
                return descricaoComplementares;
179
        }
180
        public void setDescricaoComplementares(String descricaoComplementares) {
181
                this.descricaoComplementares = descricaoComplementares;
182
        }
183
 
184
        @Column(name="dth_emissao", nullable=false)
185
        public Date getDataHoraEmissao() {
186
                return dataHoraEmissao;
187
        }
188
        public void setDataHoraEmissao(Date dataHoraEmissao) {
189
                this.dataHoraEmissao = dataHoraEmissao;
190
        }
191
 
192
        @Column(name="txt_xml")
193
        public String getTextoXml() {
194
                return textoXml;
195
        }
196
        public void setTextoXml(String textoXml) {
197
                this.textoXml = textoXml;
198
        }
199
 
200
        @Column(name="tip_nota_fiscal", nullable=false)
201
        @NotNull(message="Obrigatório informar o tipo da nota fiscal", groups={Cadastrar.class, Alterar.class})
202
        public String getTipoNotaFiscal() {
203
                return tipoNotaFiscal;
204
        }
205
        public void setTipoNotaFiscal(String tipoNotaFiscal) {
206
                this.tipoNotaFiscal = tipoNotaFiscal;
207
        }
208
        @Transient
209
        public String getDescricaoDoTipoNotaFiscal() {
210
                return VerificadorUtil.naoEstaNuloOuVazio(getTipoNotaFiscal())? TipoNotaFiscal.parse(getTipoNotaFiscal()).getDescricao() : null;
211
        }
212
 
213
        @Column(name="tip_modelo_notafiscal", nullable=false)
214
        @NotNull(message="Obrigatório informar o tipo do modelo da nota fiscal", groups={Cadastrar.class, Alterar.class})
215
        public String getTipoModeloNotaFiscal() {
216
                return tipoModeloNotaFiscal;
217
        }
218
        public void setTipoModeloNotaFiscal(String tipoModeloNotaFiscal) {
219
                this.tipoModeloNotaFiscal = tipoModeloNotaFiscal;
220
        }
221
        @Transient
222
        public String getDescricaoDoTipoModeloNotaFiscal() {
223
                return VerificadorUtil.naoEstaNuloOuVazio(getTipoModeloNotaFiscal())? TipoModeloNotaFiscal.parse(getTipoModeloNotaFiscal()).getDescricao() : null;
224
        }
225
 
226
        @Column(name="dsc_protocolo_autorizacao")
227
        @Size(max = 100, message = "Limite de caracteres ultrapassado: Protocolo da Autorização")
228
        public String getProtocoloAutorizacao() {
229
                return protocoloAutorizacao;
230
        }
231
        public void setProtocoloAutorizacao(String protocoloAutorizacao) {
232
                this.protocoloAutorizacao = protocoloAutorizacao;
233
        }
234
 
235
        @Column(name="dsc_caminho_qrcode")
236
        @Size(max = 500, message = "Limite de caracteres ultrapassado: Caminho QRCode")
237
        public String getCaminhoQrcode() {
238
                return caminhoQrcode;
239
        }
240
        public void setCaminhoQrcode(String caminhoQrcode) {
241
                this.caminhoQrcode = caminhoQrcode;
242
        }
243
 
244
        @Column(name="dsc_status_retorno")
245
        @Size(max = 100, message = "Limite de caracteres ultrapassado: Status do Retorno")
246
        public String getStatusRetorno() {
247
                return statusRetorno;
248
        }
249
        public void setStatusRetorno(String statusRetorno) {
250
                this.statusRetorno = statusRetorno;
251
        }
252
 
253
        @Column(name="dsc_motivo_retorno")
254
        @Size(max = 100, message = "Limite de caracteres ultrapassado: Motivo do Retorno")
255
        public String getMotivoRetorno() {
256
                return motivoRetorno;
257
        }
258
        public void setMotivoRetorno(String motivoRetorno) {
259
                this.motivoRetorno = motivoRetorno;
260
        }
261
 
262
        @Column(name="dth_evento")
263
        public Date getDataHoraEvento() {
264
                return dataHoraEvento;
265
        }
266
        public void setDataHoraEvento(Date dataHoraEvento) {
267
                this.dataHoraEvento = dataHoraEvento;
268
        }
269
 
270
        @Column(name="txt_xml_evento", nullable=false)
271
        public String getTextoXmlEvento() {
272
                return textoXmlEvento;
273
        }
274
        public void setTextoXmlEvento(String textoXmlEvento) {
275
                this.textoXmlEvento = textoXmlEvento;
276
        }
277
 
278
//      @OneToMany(mappedBy="notaFiscal", cascade=CascadeType.ALL, orphanRemoval=true)
279
        @Transient
280
        public List<NotaFiscalProduto> getListaNFRemessaProdutos() {
281
                return listaNFRemessaProdutos;
282
        }
283
        public void setListaNFRemessaProdutos(List<NotaFiscalProduto> listaNFRemessaProdutos) {
284
                this.listaNFRemessaProdutos = listaNFRemessaProdutos;
285
        }
286
 
287
        @Transient
288
        public Boolean temPessoaJuridica() {
289
                if (VerificadorUtil.estaNulo(getVenda())) return false;
290
                if (VerificadorUtil.estaNulo(getVenda().getLoja())) return false;
291
                return VerificadorUtil.naoEstaNulo(getVenda().getLoja().getPessoaJuridica());
292
        }
293
 
294
        @Transient
295
        public String getRazaoSocialDaLoja() {
296
                return temPessoaJuridica()? getVenda().getLoja().getPessoaJuridica().getRazaoSocial() : "";
297
        }
298
 
299
        @Transient
300
        public String getCnpjDaLoja() {
301
                return temPessoaJuridica()? StringUtil.formatarCnpj(getVenda().getLoja().getPessoaJuridica().getCpfCnpj()) : "";
302
        }
303
 
304
        @Transient
305
        public byte[] getArquivoXml() {
306
                return arquivoXml;
307
        }
308
        public void setArquivoXml(byte[] arquivoXml) {
309
                this.arquivoXml = arquivoXml;
310
        }
311
 
312
        @Transient
313
        public List<Parcela> getListaParcelas() {
314
                return listaParcelas;
315
        }
316
        public void setListaParcelas(List<Parcela> listaParcelas) {
317
                this.listaParcelas = listaParcelas;
318
        }
319
 
320
        @Transient
321
        public List<CompraProduto> getListaCompraProduto() {
322
                return listaCompraProduto;
323
        }
324
        public void setListaCompraProduto(List<CompraProduto> listaCompraProduto) {
325
                this.listaCompraProduto = listaCompraProduto;
326
        }
327
 
328
        @Transient
329
        public List<Lancamento> getListaLancamento() {
330
                return listaLancamento;
331
        }
332
        public void setListaLancamento(List<Lancamento> listaLancamento) {
333
                this.listaLancamento = listaLancamento;
334
        }
335
 
336
        @Transient
337
        public List<VendaFormaPagamento> getListaFormaPagamento() {
338
                return listaFormaPagamento;
339
        }
340
        public void setListaFormaPagamento(List<VendaFormaPagamento> listaFormaPagamento) {
341
                this.listaFormaPagamento = listaFormaPagamento;
342
        }
343
 
344
        @Transient
345
        public Boolean getNotaFiscalPendente() {
346
                return notaFiscalPendente;
347
        }
348
        public void setNotaFiscalPendente(Boolean notaFiscalPendente) {
349
                this.notaFiscalPendente = notaFiscalPendente;
350
        }
351
 
352
        @Override
353
        public int hashCode() {
354
                final int prime = 31;
355
                int result = 1;
356
                result = prime * result + ((chave == null) ? 0 : chave.hashCode());
357
                return result;
358
        }
359
 
360
        @Override
361
        public boolean equals(Object obj) {
362
                if (this == obj)
363
                        return true;
364
                if (obj == null)
365
                        return false;
366
                if (getClass() != obj.getClass())
367
                        return false;
368
                NotaFiscal other = (NotaFiscal) obj;
369
                if (chave == null) {
370
                        if (other.chave != null)
371
                                return false;
372
                } else if (!chave.equals(other.chave))
373
                        return false;
374
                return true;
375
        }
376
 
377
        @Transient
378
        public Double getTotalLancamentos() {
379
                Double total = 0.0;
380
                if (!VerificadorUtil.isListaNulaOuVazia(getListaLancamento())) {
381
                        for (Lancamento lancamento : getListaLancamento()) {
382
                                total = total + lancamento.getValorVenda();
383
                        }
384
                }
385
                return total;  
386
        }
387
 
388
        @Transient
389
        public Double getTotalPago() {
390
                Double total = 0.0;
391
                if (!VerificadorUtil.isListaNulaOuVazia(getListaFormaPagamento())) {
392
                        for (VendaFormaPagamento vendaFormaPagamento : getListaFormaPagamento()) {
393
                                total = total + vendaFormaPagamento.getValorPagamento();
394
                        }
395
                }
396
                return total;  
397
        }
398
 
399
        @Transient
400
        public Double getValorNotaFiscal() {
401
                if (VerificadorUtil.naoEstaNuloOuVazio(getTextoXml())) {
402
                        if (getTextoXml().indexOf("<vNF>") > 0) {
403
                                String valorLocalizado = getTextoXml().substring(getTextoXml().indexOf("<vNF>"), getTextoXml().indexOf("</vNF>"))
404
                                                                                        .replace("<vNF>", "").replace("</vNF>", "");
405
                                return new Double(valorLocalizado);
406
                        }
407
                }
408
                return 0.0;
409
        }
410
 
411
        @Transient
412
        public Double getTotalValorProdutosRemessa() {
413
                Double total = new Double(0.0);
414
                if (VerificadorUtil.naoEstaNuloOuVazio(getListaNFRemessaProdutos())) {
415
                        for (NotaFiscalProduto notaFiscalProduto : getListaNFRemessaProdutos()) {
416
                                total = total + notaFiscalProduto.getProduto().getValorCompra() * notaFiscalProduto.getQuantidade();
417
                        }
418
                }
419
                return total;
420
        }
421
 
422
        @Transient
423
        public Boolean ehNotaFiscalDeRemessa() {
424
                return VerificadorUtil.naoEstaNulo(getTipoNotaFiscal()) ? getTipoNotaFiscal().equals(TipoNotaFiscal.NFE_REMESSA.getValor()) : false;
425
        }
426
 
427
        @Transient
428
        public byte[] criarArquivoXml() {
429
                ByteArrayInputStream in = null;
430
                ByteArrayOutputStream bos = null;
431
                try {
432
                        in = new ByteArrayInputStream(getTextoXml().getBytes());
433
                        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
434
                        DocumentBuilder builder = dbf.newDocumentBuilder();
435
                        Document xml = builder.parse(in);
436
 
437
                        bos = new ByteArrayOutputStream();
438
                        TransformerFactory transformerFactory = TransformerFactory.newInstance();
439
                        Transformer transformer = transformerFactory.newTransformer();
440
                        DOMSource source = new DOMSource(xml);
441
                        StreamResult result = new StreamResult(bos);
442
                        transformer.transform(source, result);
443
 
444
                        DefaultStreamedContent arquivo = (DefaultStreamedContent) RelatorioUtils.gerarArquivo(bos.toByteArray(), "ArquivoXML", "xml");
445
                        return IOUtils.toByteArray(arquivo.getStream());
446
                } catch (Exception e) {
447
                        e.printStackTrace();
448
                } finally {
449
                        try {
450
                                in.close();
451
                                bos.close();
452
                        } catch (IOException e) {
453
                                e.printStackTrace();
454
                        }
455
                }
456
                return null;
457
        }
458
 
459
        @Transient
460
        public byte[] getRetornarArquivoXml() {
461
                setArquivoXml(criarArquivoXml());
462
                return getArquivoXml();
463
        }
464
 
465
        @Transient
466
        public void gerarChaveAcessoNfe(String codigoUFEmitente, String dataAAMM, String cnpjCpfEmitente, String modeloNf,
467
                        String serieNF, String tpEmissao, String numeroNF) {
468
                try {
469
            StringBuilder chave = new StringBuilder();
470
            chave.append(StringUtil.lpadTo(codigoUFEmitente, 2, '0'));
471
            chave.append(StringUtil.lpadTo(dataAAMM, 4, '0'));
472
            chave.append(StringUtil.lpadTo(cnpjCpfEmitente.replaceAll("\\D",""), 14, '0'));
473
            chave.append(StringUtil.lpadTo(modeloNf, 2, '0'));
474
            chave.append(StringUtil.lpadTo(serieNF, 3, '0'));
475
            chave.append(StringUtil.lpadTo(String.valueOf(numeroNF), 9, '0'));
476
            chave.append(StringUtil.lpadTo(tpEmissao, 1, '0'));
477
            chave.append(StringUtil.lpadTo(numeroNF, 8, '0'));
478
            chave.append(StringUtil.modulo11(chave.toString()));
479
            chave.insert(0, "NFe");
480
            setChave(chave.toString());
481
        } catch (Exception e) {
482
                System.out.println(e.toString());
483
                throw new NegocioException(e.getMessage());
484
        }
485
        }
486
 
487
        @Transient
488
        public Long getSequencialDaVenda() {
489
                return VerificadorUtil.naoEstaNulo(getVenda())? getVenda().getSequencial() : null;
490
        }
491
 
492
        @Transient
493
        public void preencherNumeroPelaChave() {
494
                if (VerificadorUtil.naoEstaNuloOuVazio(getChave())) {
495
                        setNumeroNotaFiscal(new Long(getChave().substring(25, 34)));
496
                }
497
        }
498
 
499
        @Transient
500
        public void preencherMotivoPadrao() {
501
                setMotivoRetorno("Autorizado o uso da NF-e");
502
        }
503
 
504
        @Transient
505
        public void preencherSeriePadrao() {
506
                setSerie("1");
507
        }
508
 
509
        @Transient
510
        public void preencherStatusPadrao() {
511
                setStatusRetorno("100");
512
        }
513
 
514
        @Transient
515
        public void preencherQRCodePadrao() {
516
                setCaminhoQrcode("http://nfce.sefaz.al.gov.br/QRCode/consultarNFCe.jsp?p=" + getChave() + "|2|1|1|437A52AD9DE9BDD04D6BFF55ED997C5199ECC64D");
517
        }
518
 
519
        @Transient
520
        public String retornarCodigoNumerico() {
521
                if (VerificadorUtil.naoEstaNuloOuVazio(getChave())) {
522
                        if (getChave().length() > 42) {
523
                                return getChave().substring(35, 43);
524
                        }
525
                }
526
                return "";
527
        }
528
 
529
        @Transient
530
        public void preencherComXML() {
531
                if (VerificadorUtil.naoEstaNuloOuVazio(this.getTextoXml())) {
532
                        TNfeProc tNfeProc = unmarshal(this.getTextoXml());
533
                        preencher(tNfeProc);
534
                }
535
 
536
        }
537
 
538
        @Transient
539
        public void preencher(TNfeProc nfeProc) {
540
                if (VerificadorUtil.naoEstaNulo(nfeProc)) {
541
                        if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe())) {
542
                                if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe().getInfNFe())) {
543
                                        if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe().getInfNFe().getIde())) {
544
                                                //this.setCodigoNotaFiscal(new Long(nfeProc.getNFe().getInfNFe().getIde().getCNF()));
545
                                                this.setNumeroNotaFiscal(new Long(nfeProc.getNFe().getInfNFe().getIde().getNNF()));
546
                                                this.setSerie(nfeProc.getNFe().getInfNFe().getIde().getSerie());
547
                                                this.setDataHoraEmissao(DataUtil.retornarDataApartirString("yyyy-MM-dd'T'HH:mm:ss", nfeProc.getNFe().getInfNFe().getIde().getDhEmi()));
548
                                        }
549
                                        if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe().getInfNFe().getInfAdic())) {
550
                                                this.setDescricaoComplementares(nfeProc.getNFe().getInfNFe().getInfAdic().getInfCpl());
551
                                        }
552
                                }
553
                                if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe().getInfNFeSupl())) {}
554
                                if (VerificadorUtil.naoEstaNulo(nfeProc.getNFe().getSignature())) {}
555
                        }
556
                        if (VerificadorUtil.naoEstaNulo(nfeProc.getProtNFe())) {
557
                                if (VerificadorUtil.naoEstaNulo(nfeProc.getProtNFe().getInfProt())) {
558
                                        this.setChave(nfeProc.getProtNFe().getInfProt().getChNFe());
559
                                        this.setDataHoraEvento(DataUtil.retornarDataApartirString("yyyy-MM-dd'T'HH:mm:ss", nfeProc.getProtNFe().getInfProt().getDhRecbto()));
560
                                        this.setProtocoloAutorizacao(nfeProc.getProtNFe().getInfProt().getNProt());
561
                                        this.setStatusRetorno(nfeProc.getProtNFe().getInfProt().getCStat());
562
                                        this.setMotivoRetorno(nfeProc.getProtNFe().getInfProt().getXMotivo());
563
                                }
564
                        }
565
                }
566
        }
567
 
568
        @Transient
569
        public TNfeProc unmarshal(String stringXml) {
570
        JAXBContext context = null;
571
        try {
572
            context = JAXBContext.newInstance(nfce.java.TNfeProc.class);
573
            Unmarshaller unmarshaller = context.createUnmarshaller();
574
            return (TNfeProc) unmarshaller.unmarshal(new StreamSource(new StringReader(stringXml)));
575
        } catch (JAXBException e) {
576
            e.printStackTrace();
577
        }
578
        return null;
579
    }
580
 
581
}