• 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

75.0
/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoCana.java
1
package com.fincatto.documentofiscal.nfe400.classes.nota;
2

3
import com.fincatto.documentofiscal.DFBase;
4
import com.fincatto.documentofiscal.validadores.DFBigDecimalValidador;
5
import com.fincatto.documentofiscal.validadores.DFListValidador;
6
import com.fincatto.documentofiscal.validadores.DFStringValidador;
7
import org.simpleframework.xml.Element;
8
import org.simpleframework.xml.ElementList;
9

10
import java.math.BigDecimal;
11
import java.util.List;
12
import java.util.regex.Matcher;
13
import java.util.regex.Pattern;
14

15
public class NFNotaInfoCana extends DFBase {
1✔
16
    private static final long serialVersionUID = 5219843108064204554L;
17
    
18
    @Element(name = "safra")
19
    private String safra;
20
    
21
    @Element(name = "ref")
22
    private String referencia;
23
    
24
    @ElementList(entry = "forDia", inline = true)
25
    private List<NFNotaInfoCanaFornecimentoDiario> fornecimentosDiario;
26

27
    @ElementList(entry = "deduc", inline = true, required = false)
28
    private List<NFNotaInfoCanaDeducao> deducoes;
29
    
30
    @Element(name = "qTotMes")
31
    private String quantidadeTotalMes;
32
    @Element(name = "qTotAnt")
33
    private String quantidadeTotalAnterior;
34
    @Element(name = "qTotGer")
35
    private String quantidadeTotalGeral;
36
    @Element(name = "vFor")
37
    private String valorFornecimento;
38
    @Element(name = "vTotDed")
39
    private String valorTotalDeducao;
40
    @Element(name = "vLiqFor")
41
    private String valorLiquidoFornecimento;
42

43
    public void setSafra(final String safra) {
44
        if (safra.length() != 4 && safra.length() != 9) {
1✔
45
            throw new IllegalStateException("Tamanho invalido");
1✔
46
        }
47

48
        final Pattern pattern = safra.length() == 4 ? Pattern.compile("[0-9]{4}") : Pattern.compile("[0-9]{4}/[0-9]{4}");
1✔
49
        final Matcher matcher = pattern.matcher(safra);
1✔
50
        if (!matcher.find()) {
1✔
51
            throw new IllegalStateException("Padrao invalido");
1✔
52
        }
53

54
        this.safra = safra;
1✔
55
    }
1✔
56

57
    public void setReferencia(final String referencia) {
58
        DFStringValidador.mmaaaa(referencia);
1✔
59
        this.referencia = referencia;
1✔
60
    }
1✔
61

62
    public void setFornecimentosDiario(final List<NFNotaInfoCanaFornecimentoDiario> fornecimentosDiario) {
63
        DFListValidador.tamanho31Obrigatorio(fornecimentosDiario, "Fornecimento Diario");
1✔
64
        this.fornecimentosDiario = fornecimentosDiario;
1✔
65
    }
1✔
66

67
    public void setDeducoes(final List<NFNotaInfoCanaDeducao> deducoes) {
68
        DFListValidador.tamanho10(deducoes, "Deducoes");
1✔
69
        this.deducoes = deducoes;
1✔
70
    }
1✔
71

72
    public void setQuantidadeTotalMes(final BigDecimal quantidadeTotalMes) {
73
        this.quantidadeTotalMes = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalMes, "Quantidade Total Mes");
1✔
74
    }
1✔
75

76
    public void setQuantidadeTotalAnterior(final BigDecimal quantidadeTotalAnterior) {
77
        this.quantidadeTotalAnterior = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalAnterior, "Quantidade Total Anterior");
1✔
78
    }
1✔
79

80
    public void setQuantidadeTotalGeral(final BigDecimal quantidadeTotalGeral) {
81
        this.quantidadeTotalGeral = DFBigDecimalValidador.tamanho21ComAte10CasasDecimais(quantidadeTotalGeral, "Quantidade Total Geral");
1✔
82
    }
1✔
83

84
    public void setValorFornecimento(final BigDecimal valorFornecimento) {
85
        this.valorFornecimento = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorFornecimento, "Valor Fornecimento");
1✔
86
    }
1✔
87

88
    public void setValorTotalDeducao(final BigDecimal valorTotalDeducao) {
89
        this.valorTotalDeducao = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorTotalDeducao, "Valor Total Deducao");
1✔
90
    }
1✔
91

92
    public void setValorLiquidoFornecimento(final BigDecimal valorLiquidoFornecimento) {
93
        this.valorLiquidoFornecimento = DFBigDecimalValidador.tamanho15Com2CasasDecimais(valorLiquidoFornecimento, "Valor Liquido Fornecimento");
1✔
94
    }
1✔
95

96
    public String getSafra() {
97
        return this.safra;
×
98
    }
99

100
    public String getReferencia() {
101
        return this.referencia;
×
102
    }
103

104
    public List<NFNotaInfoCanaFornecimentoDiario> getFornecimentosDiario() {
105
        return this.fornecimentosDiario;
×
106
    }
107

108
    public List<NFNotaInfoCanaDeducao> getDeducoes() {
109
        return this.deducoes;
×
110
    }
111

112
    public String getQuantidadeTotalMes() {
113
        return this.quantidadeTotalMes;
×
114
    }
115

116
    public String getQuantidadeTotalAnterior() {
117
        return this.quantidadeTotalAnterior;
×
118
    }
119

120
    public String getQuantidadeTotalGeral() {
121
        return this.quantidadeTotalGeral;
×
122
    }
123

124
    public String getValorFornecimento() {
125
        return this.valorFornecimento;
×
126
    }
127

128
    public String getValorTotalDeducao() {
129
        return this.valorTotalDeducao;
×
130
    }
131

132
    public String getValorLiquidoFornecimento() {
133
        return this.valorLiquidoFornecimento;
×
134
    }
135
}
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