Z1510   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 162
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 162
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php
2
3
namespace NFePHP\EFD\Elements\ICMSIPI;
4
5
use NFePHP\EFD\Common\Element;
6
use NFePHP\EFD\Common\ElementInterface;
7
use \stdClass;
8
9
class Z1510 extends Element implements ElementInterface
10
{
11
    const REG = '1510';
12
    const LEVEL = 3;
13
    const PARENT = '1500';
14
15
    protected $parameters = [
16
        'NUM_ITEM' => [
17
            'type'     => 'integer',
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'     => 'integer',
32
            'regex'    => '^\d{4}$',
33
            'required' => true,
34
            'info'     => 'Código de classificação do item de energia elétrica, conforme a Tabela 4.4.1',
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'    => '^.{1,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'     => 'integer',
67
            'regex'    => '^\d{3}$',
68
            'required' => true,
69
            'info'     => 'Código da Situação Tributária, conforme a Tabela indicada no item 4.3.1',
70
            'format'   => ''
71
        ],
72
        'CFOP' => [
73
            'type'     => 'integer',
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'     => 'integer',
88
            'regex'    => '^\d{1,6}$',
89
            'required' => false,
90
            'info'     => 'Alíquota do ICMS',
91
            'format'   => ''
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_ST' => [
101
            'type'     => 'numeric',
102
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
103
            'required' => false,
104
            'info'     => 'Valor da base de cálculo referente à substituição tributária',
105
            'format'   => '15v2'
106
        ],
107
        'ALIQ_ST' => [
108
            'type'     => 'numeric',
109
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
110
            'required' => false,
111
            'info'     => 'Alíquota do ICMS da substituição tributária na unidade da federação de destino',
112
            'format'   => '15v2'
113
        ],
114
        'VL_ICMS_ST' => [
115
            'type'     => 'numeric',
116
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
117
            'required' => false,
118
            'info'     => 'Valor do ICMS referente à substituição tributária',
119
            'format'   => '15v2'
120
        ],
121
        'IND_REC' => [
122
            'type'     => 'string',
123
            'regex'    => '^[0|1]$',
124
            'required' => true,
125
            'info'     => 'Indicador do tipo de receita: '
126
            .'0- Receita própria; '
127
            .'1- Receita de terceiros',
128
            'format'   => ''
129
        ],
130
        'COD_PART' => [
131
            'type'     => 'string',
132
            'regex'    => '^.{1,60}$',
133
            'required' => false,
134
            'info'     => 'Código do participante receptor da receita, terceiro da operação "
135
            ."(campo 02 do Registro 0150)',
136
            'format'   => ''
137
        ],
138
        'VL_PIS' => [
139
            'type'     => 'numeric',
140
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
141
            'required' => false,
142
            'info'     => 'Valor do PIS',
143
            'format'   => '15v2'
144
        ],
145
        'VL_COFINS' => [
146
            'type'     => 'numeric',
147
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
148
            'required' => false,
149
            'info'     => 'Valor da COFINS',
150
            'format'   => '15v2'
151
        ],
152
        'COD_CTA' => [
153
            'type'     => 'string',
154
            'regex'    => '^.*$',
155
            'required' => false,
156
            'info'     => 'Código da conta analítica contábil debitada/creditada',
157
            'format'   => ''
158
        ]
159
    ];
160
161
    /**
162
     * Constructor
163
     * @param \stdClass $std
164
     */
165
    public function __construct(\stdClass $std)
166
    {
167
        parent::__construct(self::REG);
168
        $this->std = $this->standarize($std);
169
    }
170
}
171