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
|
|
|
/** |
10
|
|
|
* REGISTRO C114: CUPOM FISCAL REFERENCIADO |
11
|
|
|
* Este registro será utilizado para informar, detalhadamente, nas operações de saídas, cupons fiscais que tenham sido |
12
|
|
|
* mencionados nas informações complementares do documento que está sendo escriturado no registro C100. Nas operações de |
13
|
|
|
* entradas, somente informar quando o emitente do cupom fiscal for o próprio informante do arquivo. |
14
|
|
|
* @package NFePHP\EFD\Elements\ICMSIPI |
15
|
|
|
*/ |
16
|
|
View Code Duplication |
class C114 extends Element implements ElementInterface |
|
|
|
|
17
|
|
|
{ |
18
|
|
|
const REG = 'C114'; |
19
|
|
|
const LEVEL = 4; |
20
|
|
|
const PARENT = 'C110'; |
21
|
|
|
|
22
|
|
|
protected $parameters = [ |
23
|
|
|
'COD_MOD' => [ |
24
|
|
|
'type' => 'string', |
25
|
|
|
'regex' => '^(02|2D|2E)+$', |
26
|
|
|
'required' => true, |
27
|
|
|
'info' => 'Código do modelo do documento fiscalValor total do estoque', |
28
|
|
|
'format' => '' |
29
|
|
|
], |
30
|
|
|
'ECF_FAB' => [ |
31
|
|
|
'type' => 'string', |
32
|
|
|
'regex' => '^[A-z0-9]{1,21}+$', |
33
|
|
|
'required' => true, |
34
|
|
|
'info' => 'Número de série de fabricação do ECF', |
35
|
|
|
'format' => '' |
36
|
|
|
], |
37
|
|
|
'ECF_CX' => [ |
38
|
|
|
'type' => 'numeric', |
39
|
|
|
'regex' => '^[1-9]{1}([0-9]{1,2})?+$', |
40
|
|
|
'required' => true, |
41
|
|
|
'info' => 'Número do caixa atribuído ao ECF', |
42
|
|
|
'format' => '' |
43
|
|
|
], |
44
|
|
|
'NUM_DOC' => [ |
45
|
|
|
'type' => 'numeric', |
46
|
|
|
'regex' => '^[1-9]{1}([0-9]{1,8})?+$', |
47
|
|
|
'required' => true, |
48
|
|
|
'info' => 'Número do documento fiscal', |
49
|
|
|
'format' => '' |
50
|
|
|
], |
51
|
|
|
'DT_DOC' => [ |
52
|
|
|
'type' => 'string', |
53
|
|
|
'regex' => '^(0[1-9]|[1-2][0-9]|31(?!(?:0[2469]|11))|30(?!02))(0[1-9]|1[0-2])([12]\d{3})$', |
54
|
|
|
'required' => true, |
55
|
|
|
'info' => 'Data da emissão do documento fiscal', |
56
|
|
|
'format' => '' |
57
|
|
|
], |
58
|
|
|
]; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* Constructor |
62
|
|
|
* @param \stdClass $std |
63
|
|
|
*/ |
64
|
|
|
public function __construct(\stdClass $std) |
65
|
|
|
{ |
66
|
|
|
parent::__construct(self::REG); |
67
|
|
|
$this->std = $this->standarize($std); |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
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.