Code Duplication    Length = 153-154 lines in 2 locations

src/Elements/ICMSIPI/D300.php 1 location

@@ 9-162 (lines=154) @@
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9
class D300 extends Element implements ElementInterface
10
{
11
    const REG = 'D300';
12
    const LEVEL = 2;
13
    const PARENT = '';
14
15
    protected $parameters = [
16
        'COD_MOD' => [
17
            'type'     => 'string',
18
            'regex'    => '^[0-9]{2}$',
19
            'required' => true,
20
            'info'     => 'Código do modelo do documento fiscal, conforme a tabela 4.1.1',
21
            'format'   => ''
22
        ],
23
        'SER' => [
24
            'type'     => 'string',
25
            'regex'    => '^[0-9]{4}$',
26
            'required' => true,
27
            'info'     => 'Série do documento fiscal',
28
            'format'   => ''
29
        ],
30
        'SUB' => [
31
            'type'     => 'numeric',
32
            'regex'    => '^[0-9]{4}$',
33
            'required' => true,
34
            'info'     => 'Subsérie do documento fiscal',
35
            'format'   => ''
36
        ],
37
        'NUM_DOC_INI' => [
38
            'type'     => 'numeric',
39
            'regex'    => '^[0-9]{6}$',
40
            'required' => true,
41
            'info'     => 'Número do primeiro documento fiscal emitido (mesmo modelo, série e subsérie)',
42
            'format'   => ''
43
        ],
44
        'NUM_DOC_FIN' => [
45
            'type'     => 'numeric',
46
            'regex'    => '',
47
            'required' => true,
48
            'info'     => 'Número do último documento fiscal emitido (mesmo modelo, série e subsérie)',
49
            'format'   => ''
50
        ],
51
        'CST_ICMS' => [
52
            'type'     => 'numeric',
53
            'regex'    => '',
54
            'required' => true,
55
            'info'     => 'Código da Situação Tributária, conforme a tabela indicada no item 4.3.1',
56
            'format'   => ''
57
        ],
58
        'CFOP' => [
59
            'type'     => 'numeric',
60
            'regex'    => '',
61
            'required' => true,
62
            'info'     => 'Código Fiscal de Operação e Prestação conforme tabela indicada no item 4.2.2',
63
            'format'   => ''
64
        ],
65
        'ALIQ_ICMS' => [
66
            'type'     => 'numeric',
67
            'regex'    => '^[0-9]{6}$',
68
            'required' => true,
69
            'info'     => 'Alíquota do ICMS',
70
            'format'   => ''
71
        ],
72
        'DT_DOC' => [
73
            'type'     => 'numeric',
74
            'regex'    => '',
75
            'required' => true,
76
            'info'     => 'Data da emissão dos documentos fiscais',
77
            'format'   => ''
78
        ],
79
        'VL_OPR' => [
80
            'type'     => 'numeric',
81
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
82
            'required' => true,
83
            'info'     => 'Valor total acumulado das operações correspondentes à combinação de CST_ICMS, CFOP e '
84
            .'alíquota do ICMS, incluídas as despesas acessórias e acréscimos',
85
            'format'   => '15v2'
86
        ],
87
        'VL_DESC' => [
88
            'type'     => 'numeric',
89
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
90
            'required' => true,
91
            'info'     => 'Valor total dos descontos',
92
            'format'   => '15v2'
93
        ],
94
        'VL_SERV' => [
95
            'type'     => 'numeric',
96
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
97
            'required' => true,
98
            'info'     => 'Valor total da prestação de serviço',
99
            'format'   => '15v2'
100
        ],
101
        'VL_SEG' => [
102
            'type'     => 'numeric',
103
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
104
            'required' => true,
105
            'info'     => 'Valor de seguro',
106
            'format'   => '15v2'
107
        ],
108
        'VL_OUTDESP' => [
109
            'type'     => 'numeric',
110
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
111
            'required' => true,
112
            'info'     => 'Valor de outras despesas',
113
            'format'   => '15v2'
114
        ],
115
        'VL_BC_ICMS' => [
116
            'type'     => 'numeric',
117
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
118
            'required' => true,
119
            'info'     => 'Valor total da base de cálculo do ICMS',
120
            'format'   => '15v2'
121
        ],
122
        'VL_ICMS' => [
123
            'type'     => 'numeric',
124
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
125
            'required' => true,
126
            'info'     => 'Valor total do ICMS',
127
            'format'   => '15v2'
128
        ],
129
        'VL_RED_BC' => [
130
            'type'     => 'numeric',
131
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
132
            'required' => true,
133
            'info'     => 'Valor não tributado em função da redução da base de cálculo do ICMS, referente à '
134
            .'combinação de CST_ICMS, CFOP e alíquota do ICMS',
135
            'format'   => '15v2'
136
        ],
137
        'COD_OBS' => [
138
            'type'     => 'string',
139
            'regex'    => '^.{1,6}$',
140
            'required' => true,
141
            'info'     => 'Código da observação do lançamento fiscal (campo 02 do Registro 0460)',
142
            'format'   => ''
143
        ],
144
        'COD_CTA' => [
145
            'type'     => 'string',
146
            'regex'    => '^[0-9]{0}$',
147
            'required' => true,
148
            'info'     => 'Código da conta analítica contábil debitada/creditada',
149
            'format'   => ''
150
        ]
151
    ];
152
153
    /**
154
     * Constructor
155
     * @param \stdClass $std
156
     */
157
    public function __construct(\stdClass $std)
158
    {
159
        parent::__construct(self::REG);
160
        $this->std = $this->standarize($std);
161
    }
162
}
163

src/Elements/ICMSIPI/D510.php 1 location

@@ 9-161 (lines=153) @@
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9
class D510 extends Element implements ElementInterface
10
{
11
    const REG = 'D510';
12
    const LEVEL = 3;
13
    const PARENT = '';
14
15
    protected $parameters = [
16
        'NUM_ITEM' => [
17
            'type' => 'numeric',
18
            'regex' => '^(\d{1,3})$',
19
            'required' => true,
20
            'info' => 'Número sequencial do item no documento fiscal',
21
            'format' => ''
22
        ],
23
        'COD_ITEM' => [
24
            'type' => 'string',
25
            'regex' => '^.{1,60}$',
26
            'required' => true,
27
            'info' => 'Código do item (campo 02 do Registro 0200)',
28
            'format' => ''
29
        ],
30
        'COD_CLASS' => [
31
            'type' => 'numeric',
32
            'regex' => '^(\d{4})$',
33
            'required' => false,
34
            'info' => 'Código de classificação do item do serviço de comunicação ou de telecomunicação',
35
            'format' => ''
36
        ],
37
        'QTD' => [
38
            'type' => 'numeric',
39
            'regex' => '^\d+(\.\d*)?|\.\d+$',
40
            'required' => false,
41
            'info' => 'Quantidade do item',
42
            'format' => '15v3'
43
        ],
44
        'UNID' => [
45
            'type' => 'string',
46
            'regex' => '^.{0,6}$',
47
            'required' => false,
48
            'info' => 'Unidade do item (Campo 02 do registro 0190)',
49
            'format' => ''
50
        ],
51
        'VL_ITEM' => [
52
            'type' => 'numeric',
53
            'regex' => '^\d+(\.\d*)?|\.\d+$',
54
            'required' => true,
55
            'info' => 'Valor do item',
56
            'format' => '15v2'
57
        ],
58
        'VL_DESC' => [
59
            'type' => 'numeric',
60
            'regex' => '^\d+(\.\d*)?|\.\d+$',
61
            'required' => false,
62
            'info' => 'Valor total do desconto',
63
            'format' => '15v2'
64
        ],
65
        'CST_ICMS' => [
66
            'type' => 'numeric',
67
            'regex' => '^(\d{3})$',
68
            'required' => true,
69
            'info' => 'Código da Situação Tributária',
70
            'format' => ''
71
        ],
72
        'CFOP' => [
73
            'type' => 'numeric',
74
            'regex' => '^(\d{4})$',
75
            'required' => true,
76
            'info' => 'Código Fiscal de Operação e Prestação',
77
            'format' => ''
78
        ],
79
        'VL_BC_ICMS' => [
80
            'type' => 'numeric',
81
            'regex' => '^\d+(\.\d*)?|\.\d+$',
82
            'required' => false,
83
            'info' => 'Valor da base de cálculo do ICMS',
84
            'format' => '15v2'
85
        ],
86
        'ALIQ_ICMS' => [
87
            'type' => 'numeric',
88
            'regex' => '^\d+(\.\d*)?|\.\d+$',
89
            'required' => false,
90
            'info' => 'Alíquota do ICMS',
91
            'format' => '6v2'
92
        ],
93
        'VL_ICMS' => [
94
            'type' => 'numeric',
95
            'regex' => '^\d+(\.\d*)?|\.\d+$',
96
            'required' => false,
97
            'info' => 'Valor do ICMS creditado/debitado',
98
            'format' => '15v2'
99
        ],
100
        'VL_BC_ICMS_UF' => [
101
            'type' => 'numeric',
102
            'regex' => '^\d+(\.\d*)?|\.\d+$',
103
            'required' => false,
104
            'info' => 'Valor da base de cálculo do ICMS de outras UFs',
105
            'format' => '15v2'
106
        ],
107
        'VL_ICMS_UF' => [
108
            'type' => 'numeric',
109
            'regex' => '^\d+(\.\d*)?|\.\d+$',
110
            'required' => false,
111
            'info' => 'Valor do ICMS de outras UFs',
112
            'format' => '15v2'
113
        ],
114
        'IND_REC' => [
115
            'type' => 'string',
116
            'regex' => '^(0|1|2|3|4|5|9)$',
117
            'required' => true,
118
            'info' => 'Indicador do tipo de receita',
119
            'format' => ''
120
        ],
121
        'COD_PART' => [
122
            'type' => 'string',
123
            'regex' => '^.{0,60}$',
124
            'required' => false,
125
            'info' => 'Código do participante receptor da receita',
126
            'format' => ''
127
        ],
128
        'VL_PIS' => [
129
            'type' => 'numeric',
130
            'regex' => '^\d+(\.\d*)?|\.\d+$',
131
            'required' => false,
132
            'info' => 'Valor do PIS',
133
            'format' => '15v2'
134
        ],
135
        'VL_COFINS' => [
136
            'type' => 'numeric',
137
            'regex' => '^\d+(\.\d*)?|\.\d+$',
138
            'required' => false,
139
            'info' => 'Valor da COFINS',
140
            'format' => '15v2'
141
        ],
142
        'COD_CTA' => [
143
            'type' => 'string',
144
            'regex' => '(.*)',
145
            'required' => false,
146
            'info' => 'Código da conta analítica contábil debitada/creditada',
147
            'format' => ''
148
        ],
149
150
    ];
151
152
    /**
153
     * Constructor
154
     * @param \stdClass $std
155
     */
156
    public function __construct(\stdClass $std)
157
    {
158
        parent::__construct(self::REG);
159
        $this->std = $this->standarize($std);
160
    }
161
}
162