C815::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 5
loc 5
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NFePHP\EFD\Elements\ICMSIPI;
4
5
use NFePHP\Common\Keys;
6
use NFePHP\EFD\Common\Element;
7
use NFePHP\EFD\Common\ElementInterface;
8
use \stdClass;
9
10
/**
11
 * REGISTRO C815: INFORMAÇÕES  COMPLEMENTARES  DAS  OPERAÇÕES  DE  SAÍDA  DE  MERCADORIAS SUJEITAS À SUBSTITUIÇÃO
12
 * TRIBUTÁRIA (CF-E-SAT) (CÓDIGO 59)
13
 * @package NFePHP\EFD\Elements\ICMSIPI
14
 */
15 View Code Duplication
class C815 extends Element implements ElementInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    const REG = 'C815';
18
    const LEVEL = 3;
19
    const PARENT = 'C800';
20
    
21
    protected $parameters = [
22
        'COD_MOT_REST_COMPL' => [
23
            'type'     => 'string',
24
            'regex'    => '^[0-9]{0}$',
25
            'required' => true,
26
            'info'     => '',
27
            'format'   => ''
28
        ],
29
        'QUANT_CONV' => [
30
            'type'     => 'numeric',
31
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
32
            'required' => true,
33
            'info'     => 'Quantidade do item',
34
            'format'   => '15v6'
35
        ],
36
        'UNID' => [
37
            'type'     => 'string',
38
            'regex'    => '^[0-9]{0}$',
39
            'required' => true,
40
            'info'     => 'Unidade adotada para informar o campo QUANT_CONV.',
41
            'format'   => ''
42
        ],
43
        'VL_UNIT_ICMS_NA_OPERACAO_CONV' => [
44
            'type'     => 'numeric',
45
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
46
            'required' => true,
47
            'info'     => 'Valor unitário para o ICMS na operação, caso não houvesse a ST, considerando unidade '
48
            .'utilizada para informar o campo QUANT_CONV, aplicando-se a mesma redução da base de cálculo do '
49
            .'ICMS ST na tributação, se houver.',
50
            'format'   => '15v6'
51
        ],
52
        'VL_UNIT_ICMS_OP_CONV' => [
53
            'type'     => 'numeric',
54
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
55
            'required' => true,
56
            'info'     => 'Valor unitário correspondente ao ICMS OP utilizado no cálculo do ressarcimento / '
57
            .'restituição, no desfazimento da substituição tributária,calculado conforme a legislação de cada UF, '
58
            .'considerando a unidade utilizada para informar o campo QUANT_CONV.',
59
            'format'   => '15v6'
60
        ],
61
        'VL_UNIT_ICMS_OP_ESTOQUE_CONV' => [
62
            'type'     => 'numeric',
63
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
64
            'required' => true,
65
            'info'     => 'Valor médio unitário do ICMS que o contribuinte teria se creditado referente à operação '
66
            .'de entrada das mercadorias em estoque caso estivesse submetida ao regime comum de tributação, calculado '
67
            .'conforme a legislação de cada UF, considerando a unidade utilizada para informar o campo QUANT_CONV',
68
            'format'   => '15v6'
69
        ],
70
        'VL_UNIT_ICMS_ST_ESTOQUE_CONV' => [
71
            'type'     => 'numeric',
72
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
73
            'required' => true,
74
            'info'     => 'Valor médio unitário do ICMS/ST, incluindo FCP ST, das mercadorias em estoque, considerando'
75
            .' unidade utilizada para informar o campo QUANT_CONV.',
76
            'format'   => '15v6'
77
        ],
78
        'VL_UNIT_FCP_ICMS_ST_ESTOQUE_CONV' => [
79
            'type'     => 'string',
80
            'regex'    => '^[0-9]{0}$',
81
            'required' => true,
82
            'info'     => '',
83
            'format'   => ''
84
        ],
85
        'VL_UNIT_ICMS_ST_CONV_REST' => [
86
            'type'     => 'numeric',
87
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
88
            'required' => true,
89
            'info'     => 'Valor unitário do total do ICMS/ST, incluindo FCP ST, a ser restituído/ressarcido, '
90
            .'calculado conforme a legislação de cada UF, considerando a unidade utilizada para informar '
91
            .'o campo QUANT_CONV.',
92
            'format'   => '15v6'
93
        ],
94
        'VL_UNIT_FCP_ST_CONV_REST' => [
95
            'type'     => 'numeric',
96
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
97
            'required' => true,
98
            'info'     => 'Valor unitário correspondente à parcela de ICMS FCP ST que compõe o campo '
99
            .'VL_UNIT_ICMS_ST_CONV_REST, considerando a unidade utilizada para informar o campo QUANT_CONV.',
100
            'format'   => '15v6'
101
        ],
102
        'VL_UNIT_ICMS_ST_CONV_COMPL' => [
103
            'type'     => 'numeric',
104
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
105
            'required' => true,
106
            'info'     => 'Valor unitário do complemento do ICMS, incluindo FCP ST, considerando a unidade '
107
            .'utilizada para informar o campo QUANT_CONV.',
108
            'format'   => '15v6'
109
        ],
110
        'VL_UNIT_FCP_ST_CONV_COMPL' => [
111
            'type'     => 'numeric',
112
            'regex'    => '^\d+(\.\d*)?|\.\d+$',
113
            'required' => true,
114
            'info'     => 'Valor unitário correspondente à parcela de ICMS FCP ST que compõe o campo '
115
            .'VL_UNIT_ICMS_ST_CONV_COMPL, considerando unidade utilizada para informar o campo QUANT_CONV.',
116
            'format'   => '15v6'
117
        ]
118
    ];
119
120
    /**
121
     * Constructor
122
     * @param \stdClass $std
123
     */
124
    public function __construct(\stdClass $std)
125
    {
126
        parent::__construct(self::REG);
127
        $this->std = $this->standarize($std);
128
    }
129
}
130