• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

wmixvideo / nfe / #6582

17 Jul 2025 09:30PM UTC coverage: 51.231% (+24.2%) from 26.996%
#6582

push

web-flow
Adequação do mapeamento de infLocalCarrega e infLocalDescarrega ao xs:choice do schema MDF-e (#1054)

* Adequação do mapeamento de infLocalCarrega e infLocalDescarrega ao xs:choice do schema MDF-e

* Adequação do mapeamento de infLocalCarrega e infLocalDescarrega ao xs:choice do schema MDF-e

14006 of 27339 relevant lines covered (51.23%)

0.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

90.14
/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfo.java
1
package com.fincatto.documentofiscal.nfe400.classes.nota;
2

3
import com.fincatto.documentofiscal.DFBase;
4
import com.fincatto.documentofiscal.nfe400.classes.NFTipo;
5
import com.fincatto.documentofiscal.validadores.DFBigDecimalValidador;
6
import com.fincatto.documentofiscal.validadores.DFListValidador;
7
import com.fincatto.documentofiscal.validadores.DFStringValidador;
8
import org.simpleframework.xml.*;
9

10
import java.math.BigDecimal;
11
import java.util.List;
12

13
@Root(name = "infNFe")
14
@Namespace(reference = "http://www.portalfiscal.inf.br/nfe")
15
public class NFNotaInfo extends DFBase {
1✔
16
    private static final long serialVersionUID = 4569152242139670228L;
17

18
    public static final String IDENT = "NFe";
19
    
20
    @Attribute(name = "Id")
21
    private String identificador;
22
    
23
    @Attribute(name = "versao")
24
    private String versao;
25
    
26
    @Element(name = "ide")
27
    private NFNotaInfoIdentificacao identificacao;
28
    
29
    @Element(name = "emit")
30
    private NFNotaInfoEmitente emitente;
31

32
    @Element(name = "avulsa", required = false)
33
    private NFNotaInfoAvulsa avulsa;
34

35
    @Element(name = "dest", required = false)
36
    private NFNotaInfoDestinatario destinatario;
37

38
    @Element(name = "retirada", required = false)
39
    private NFNotaInfoLocal retirada;
40

41
    @Element(name = "entrega", required = false)
42
    private NFNotaInfoLocal entrega;
43

44
    @ElementList(entry = "autXML", inline = true, required = false)
45
    private List<NFPessoaAutorizadaDownloadNFe> pessoasAutorizadasDownloadNFe;
46
    
47
    @ElementList(entry = "det", inline = true)
48
    private List<NFNotaInfoItem> itens;
49
    
50
    @Element(name = "total")
51
    private NFNotaInfoTotal total;
52
    
53
    @Element(name = "transp")
54
    private NFNotaInfoTransporte transporte;
55

56
    @Element(name = "cobr", required = false)
57
    private NFNotaInfoCobranca cobranca;
58

59
    @Element(name = "pag")
60
    private NFNotaInfoPagamento pagamento;
61
    
62
    @Element(name="infIntermed", required = false)
63
    private NFInformacaoIntermediador infIntermed;
64

65
    @Element(name = "infAdic", required = false)
66
    private NFNotaInfoInformacoesAdicionais informacoesAdicionais;
67

68
    @Element(name = "exporta", required = false)
69
    private NFNotaInfoExportacao exportacao;
70

71
    @Element(name = "compra", required = false)
72
    private NFNotaInfoCompra compra;
73

74
    @Element(name = "cana", required = false)
75
    private NFNotaInfoCana cana;
76

77
    @Element(name="infRespTec", required = false)
78
    private NFNotaInfoResponsavelTecnico informacaoResposavelTecnico;
79

80
    @Element(name="infSolicNFF", required = false)
81
    private NFInfoSolicitacaoNFF informacaoSolicitacaoNFF;
82

83
    /**
84
     * Pega a chave de acesso a partir do identificador.
85
     * @return Chave de acesso.
86
     */
87
    public String getChaveAcesso() {
88
        return this.identificador.replace(NFNotaInfo.IDENT, "");
1✔
89
    }
90

91
    public void setIdentificador(final String identificador) {
92
        DFStringValidador.exatamente44N(identificador, "Identificador");
1✔
93
        this.identificador = NFNotaInfo.IDENT + identificador;
1✔
94
    }
1✔
95

96
    public String getIdentificador() {
97
        return this.identificador;
1✔
98
    }
99

100
    public void setVersao(final BigDecimal versao) {
101
        this.versao = DFBigDecimalValidador.tamanho4Com2CasasDecimais(versao, "Versao");
1✔
102
    }
1✔
103

104
    public NFNotaInfoIdentificacao getIdentificacao() {
105
        return this.identificacao;
1✔
106
    }
107

108
    public void setIdentificacao(final NFNotaInfoIdentificacao identificacao) {
109
        this.identificacao = identificacao;
1✔
110
    }
1✔
111

112
    public void setEmitente(final NFNotaInfoEmitente emitente) {
113
        this.emitente = emitente;
1✔
114
    }
1✔
115

116
    public void setAvulsa(final NFNotaInfoAvulsa avulsa) {
117
        this.avulsa = avulsa;
1✔
118
    }
1✔
119

120
    public NFNotaInfoDestinatario getDestinatario() {
121
        return this.destinatario;
1✔
122
    }
123

124
    public void setDestinatario(final NFNotaInfoDestinatario destinatario) {
125
        this.destinatario = destinatario;
1✔
126
    }
1✔
127

128
    public void setItens(final List<NFNotaInfoItem> itens) {
129
        DFListValidador.tamanho990(itens, "Itens da Nota");
1✔
130
        this.itens = itens;
1✔
131
    }
1✔
132

133
    public void setRetirada(final NFNotaInfoLocal retirada) {
134
        this.retirada = retirada;
1✔
135
    }
1✔
136

137
    public void setEntrega(final NFNotaInfoLocal entrega) {
138
        this.entrega = entrega;
1✔
139
    }
1✔
140

141
    public void setCobranca(final NFNotaInfoCobranca cobranca) {
142
        this.cobranca = cobranca;
1✔
143
    }
1✔
144

145
    public void setTotal(final NFNotaInfoTotal total) {
146
        this.total = total;
1✔
147
    }
1✔
148

149
    public void setTransporte(final NFNotaInfoTransporte transporte) {
150
        this.transporte = transporte;
1✔
151
    }
1✔
152

153
    public void setInformacoesAdicionais(final NFNotaInfoInformacoesAdicionais informacoesAdicionais) {
154
        this.informacoesAdicionais = informacoesAdicionais;
1✔
155
    }
1✔
156

157
    public void setExportacao(final NFNotaInfoExportacao exportacao) {
158
        this.exportacao = exportacao;
1✔
159
    }
1✔
160

161
    public void setCompra(final NFNotaInfoCompra compra) {
162
        this.compra = compra;
1✔
163
    }
1✔
164

165
    public void setCana(final NFNotaInfoCana cana) {
166
        this.cana = cana;
1✔
167
    }
1✔
168

169
    public void setPessoasAutorizadasDownloadNFe(final List<NFPessoaAutorizadaDownloadNFe> pessoasAutorizadasDownloadNFe) {
170
        DFListValidador.tamanho10(pessoasAutorizadasDownloadNFe, "Pessoas Autorizadas Download NFe");
1✔
171
        this.pessoasAutorizadasDownloadNFe = pessoasAutorizadasDownloadNFe;
1✔
172
    }
1✔
173

174
    public void setPagamento(final NFNotaInfoPagamento pagamento) {
175
        this.pagamento = pagamento;
1✔
176
    }
1✔
177
    
178
    public void setInfIntermed(final NFInformacaoIntermediador infIntermed) {
179
                this.infIntermed = infIntermed;
1✔
180
        }
1✔
181

182
    public NFNotaInfo setInformacaoResposavelTecnico(NFNotaInfoResponsavelTecnico informacaoResposavelTecnico) {
183
        this.informacaoResposavelTecnico = informacaoResposavelTecnico;
×
184
        return this;
×
185
    }
186

187
    public void setInformacaoSolicitacaoNFF(NFInfoSolicitacaoNFF informacaoSolicitacaoNFF) {
188
        this.informacaoSolicitacaoNFF = informacaoSolicitacaoNFF;
×
189
    }
×
190

191
    public String getVersao() {
192
        return this.versao;
1✔
193
    }
194

195
    public NFNotaInfoEmitente getEmitente() {
196
        return this.emitente;
1✔
197
    }
198

199
    public NFNotaInfoAvulsa getAvulsa() {
200
        return this.avulsa;
1✔
201
    }
202

203
    public NFNotaInfoLocal getRetirada() {
204
        return this.retirada;
1✔
205
    }
206

207
    public NFNotaInfoLocal getEntrega() {
208
        return this.entrega;
1✔
209
    }
210

211
    public List<NFPessoaAutorizadaDownloadNFe> getPessoasAutorizadasDownloadNFe() {
212
        return this.pessoasAutorizadasDownloadNFe;
1✔
213
    }
214

215
    public List<NFNotaInfoItem> getItens() {
216
        return this.itens;
1✔
217
    }
218

219
    public NFNotaInfoTotal getTotal() {
220
        return this.total;
1✔
221
    }
222

223
    public NFNotaInfoTransporte getTransporte() {
224
        return this.transporte;
1✔
225
    }
226

227
    public NFNotaInfoCobranca getCobranca() {
228
        return this.cobranca;
1✔
229
    }
230

231
    public NFNotaInfoPagamento getPagamento() {
232
        return this.pagamento;
1✔
233
    }
234
    
235
    public NFInformacaoIntermediador getInfIntermed() {
236
                return infIntermed;
×
237
        }
238

239
    public NFNotaInfoInformacoesAdicionais getInformacoesAdicionais() {
240
        return this.informacoesAdicionais;
1✔
241
    }
242

243
    public NFNotaInfoExportacao getExportacao() {
244
        return this.exportacao;
1✔
245
    }
246

247
    public NFNotaInfoCompra getCompra() {
248
        return this.compra;
1✔
249
    }
250

251
    public NFNotaInfoCana getCana() {
252
        return this.cana;
1✔
253
    }
254

255
    public NFNotaInfoResponsavelTecnico getInformacaoResposavelTecnico() {
256
        return this.informacaoResposavelTecnico;
×
257
    }
258

259
    public NFInfoSolicitacaoNFF getInformacaoSolicitacaoNFF() {
260
        return informacaoSolicitacaoNFF;
×
261
    }
262

263
    @Override
264
    public String toString() {
265
        if (this.getDestinatario() != null && this.getIdentificacao() != null && this.getDestinatario().getIndicadorIEDestinatario().equals(NFIndicadorIEDestinatario.NAO_CONTRIBUINTE) && this.getIdentificacao().getOperacaoConsumidorFinal().equals(NFOperacaoConsumidorFinal.NAO) && this.getIdentificacao().getTipo().equals(NFTipo.SAIDA) && !this.getIdentificacao().getIdentificadorLocalDestinoOperacao().equals(NFIdentificadorLocalDestinoOperacao.OPERACAO_COM_EXTERIOR)) {
1✔
266
            throw new IllegalStateException("Opera\u00E7\u00E3o com n\u00E3o contribuinte deve indicar opera\u00E7\u00E3o com consumidor final");
1✔
267
        }
268
        return super.toString();
1✔
269
    }
270
        
271
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc