@@ 9-81 (lines=73) @@ | ||
6 | use NFePHP\EFD\Common\ElementInterface; |
|
7 | use \stdClass; |
|
8 | ||
9 | class C601 extends Element implements ElementInterface |
|
10 | { |
|
11 | const REG = 'C601'; |
|
12 | const LEVEL = 4; |
|
13 | const PARENT = 'C600'; |
|
14 | ||
15 | protected $parameters = [ |
|
16 | 'CST_PIS' => [ |
|
17 | 'type' => 'numeric', |
|
18 | 'regex' => '^((0[1-9])|49|99)$', |
|
19 | 'required' => false, |
|
20 | 'info' => 'Código da Situação Tributária referente ao PIS/PASEP', |
|
21 | 'format' => '' |
|
22 | ], |
|
23 | 'VL_ITEM' => [ |
|
24 | 'type' => 'numeric', |
|
25 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
26 | 'required' => false, |
|
27 | 'info' => 'Valor total dos itens', |
|
28 | 'format' => '15v2' |
|
29 | ], |
|
30 | 'VL_BC_PIS' => [ |
|
31 | 'type' => 'numeric', |
|
32 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
33 | 'required' => false, |
|
34 | 'info' => 'Valor da base de cálculo do PIS/PASEP', |
|
35 | 'format' => '15v2' |
|
36 | ], |
|
37 | 'ALIQ_PIS' => [ |
|
38 | 'type' => 'numeric', |
|
39 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
40 | 'required' => false, |
|
41 | 'info' => 'Alíquota do PIS/PASEP (em percentual)', |
|
42 | 'format' => '8v4' |
|
43 | ], |
|
44 | 'VL_PIS' => [ |
|
45 | 'type' => 'numeric', |
|
46 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
47 | 'required' => false, |
|
48 | 'info' => 'Valor do PIS/PASEP', |
|
49 | 'format' => '15v2' |
|
50 | ], |
|
51 | 'COD_CTA' => [ |
|
52 | 'type' => 'string', |
|
53 | 'regex' => '^.{0,255}$', |
|
54 | 'required' => false, |
|
55 | 'info' => 'Código da conta analítica contábil debitada/creditada', |
|
56 | 'format' => '' |
|
57 | ], |
|
58 | ||
59 | ]; |
|
60 | ||
61 | /** |
|
62 | * Constructor |
|
63 | * @param \stdClass $std |
|
64 | */ |
|
65 | public function __construct(\stdClass $std) |
|
66 | { |
|
67 | parent::__construct(self::REG); |
|
68 | $this->std = $this->standarize($std); |
|
69 | $this->postValidation(); |
|
70 | } |
|
71 | ||
72 | public function postValidation() |
|
73 | { |
|
74 | $multiplicacao = $this->values->vl_bc_pis * $this->values->aliq_pis; |
|
75 | if (number_format($this->values->vl_pis, 2) != number_format($multiplicacao/100, 2)) { |
|
76 | throw new \InvalidArgumentException("[" . self::REG . "] " . |
|
77 | "O campo VL_PIS deve de ser o calculo da multiplicacao " . |
|
78 | "da base de calculo do PIS com a aliquota do PIS, o resultado dividido por 100"); |
|
79 | } |
|
80 | } |
|
81 | } |
|
82 |
@@ 9-81 (lines=73) @@ | ||
6 | use NFePHP\EFD\Common\ElementInterface; |
|
7 | use \stdClass; |
|
8 | ||
9 | class C605 extends Element implements ElementInterface |
|
10 | { |
|
11 | const REG = 'C605'; |
|
12 | const LEVEL = 4; |
|
13 | const PARENT = 'C600'; |
|
14 | ||
15 | protected $parameters = [ |
|
16 | 'CST_COFINS' => [ |
|
17 | 'type' => 'numeric', |
|
18 | 'regex' => '^((5[0-6])|(6[0-6])|(7[0-5])|98|99)$', |
|
19 | 'required' => false, |
|
20 | 'info' => 'Código da Situação Tributária referente a COFINS', |
|
21 | 'format' => '' |
|
22 | ], |
|
23 | 'VL_ITEM' => [ |
|
24 | 'type' => 'numeric', |
|
25 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
26 | 'required' => false, |
|
27 | 'info' => 'Valor total dos itens', |
|
28 | 'format' => '15v2' |
|
29 | ], |
|
30 | 'VL_BC_COFINS' => [ |
|
31 | 'type' => 'numeric', |
|
32 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
33 | 'required' => false, |
|
34 | 'info' => 'Valor da base de cálculo da COFINS', |
|
35 | 'format' => '15v2' |
|
36 | ], |
|
37 | 'ALIQ_COFINS' => [ |
|
38 | 'type' => 'numeric', |
|
39 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
40 | 'required' => false, |
|
41 | 'info' => 'Alíquota da COFINS (em percentual)', |
|
42 | 'format' => '8v4' |
|
43 | ], |
|
44 | 'VL_COFINS' => [ |
|
45 | 'type' => 'numeric', |
|
46 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
47 | 'required' => false, |
|
48 | 'info' => 'Valor da COFINS', |
|
49 | 'format' => '15v2' |
|
50 | ], |
|
51 | 'COD_CTA' => [ |
|
52 | 'type' => 'string', |
|
53 | 'regex' => '^.{0,255}$', |
|
54 | 'required' => false, |
|
55 | 'info' => 'Código da conta analítica contábil debitada/creditada', |
|
56 | 'format' => '' |
|
57 | ], |
|
58 | ||
59 | ]; |
|
60 | ||
61 | /** |
|
62 | * Constructor |
|
63 | * @param \stdClass $std |
|
64 | */ |
|
65 | public function __construct(\stdClass $std) |
|
66 | { |
|
67 | parent::__construct(self::REG); |
|
68 | $this->std = $this->standarize($std); |
|
69 | $this->postValidation(); |
|
70 | } |
|
71 | ||
72 | public function postValidation() |
|
73 | { |
|
74 | $multiplicacao = $this->values->vl_bc_cofins * $this->values->aliq_cofins; |
|
75 | if (number_format($this->values->vl_cofins, 2) != number_format($multiplicacao / 100, 2)) { |
|
76 | throw new \InvalidArgumentException("[" . self::REG . "] " . |
|
77 | "O campo VL_PIS deve de ser o calculo da multiplicacao " . |
|
78 | "da base de calculo do cofins com a aliquota do cofins, o resultado dividido por 100"); |
|
79 | } |
|
80 | } |
|
81 | } |
|
82 |
@@ 8-80 (lines=73) @@ | ||
5 | use NFePHP\EFD\Common\Element; |
|
6 | use NFePHP\EFD\Common\ElementInterface; |
|
7 | ||
8 | class D201 extends Element implements ElementInterface |
|
9 | { |
|
10 | const REG = 'D201'; |
|
11 | const LEVEL = 4; |
|
12 | const PARENT = 'D200'; |
|
13 | ||
14 | protected $parameters = [ |
|
15 | 'CST_PIS' => [ |
|
16 | 'type' => 'string', |
|
17 | 'regex' => '^((0[1-9])|49|99)$', |
|
18 | 'required' => false, |
|
19 | 'info' => 'Código da Situação Tributária referente ao PIS/PASEP ', |
|
20 | 'format' => '' |
|
21 | ], |
|
22 | 'VL_ITEM' => [ |
|
23 | 'type' => 'numeric', |
|
24 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
25 | 'required' => false, |
|
26 | 'info' => 'Valor total dos itens ', |
|
27 | 'format' => '15v2' |
|
28 | ], |
|
29 | 'VL_BC_PIS' => [ |
|
30 | 'type' => 'numeric', |
|
31 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
32 | 'required' => false, |
|
33 | 'info' => 'Valor da base de cálculo do PIS/PASEP ', |
|
34 | 'format' => '15v2' |
|
35 | ], |
|
36 | 'ALIQ_PIS' => [ |
|
37 | 'type' => 'numeric', |
|
38 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
39 | 'required' => false, |
|
40 | 'info' => 'Alíquota do PIS/PASEP (em percentual) ', |
|
41 | 'format' => '8v4' |
|
42 | ], |
|
43 | 'VL_PIS' => [ |
|
44 | 'type' => 'numeric', |
|
45 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
46 | 'required' => false, |
|
47 | 'info' => 'Valor do PIS/PASEP ', |
|
48 | 'format' => '15v2' |
|
49 | ], |
|
50 | 'COD_CTA' => [ |
|
51 | 'type' => 'string', |
|
52 | 'regex' => '^.{0,255}$', |
|
53 | 'required' => false, |
|
54 | 'info' => 'Código da conta analítica contábil debitada/creditada ', |
|
55 | 'format' => '' |
|
56 | ], |
|
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 | $this->postValidation(); |
|
69 | } |
|
70 | ||
71 | public function postValidation() |
|
72 | { |
|
73 | $multiplicacao = $this->values->vl_bc_pis * $this->values->aliq_pis; |
|
74 | if (number_format($this->values->vl_pis, 2) != number_format($multiplicacao / 100, 2)) { |
|
75 | throw new \InvalidArgumentException("[" . self::REG . "] " . |
|
76 | "O campo VL_PIS deve de ser o calculo da multiplicacao " . |
|
77 | "da base de calculo do PIS com a aliquota do PIS, o resultado dividido por 100"); |
|
78 | } |
|
79 | } |
|
80 | } |
|
81 |
@@ 8-80 (lines=73) @@ | ||
5 | use NFePHP\EFD\Common\Element; |
|
6 | use NFePHP\EFD\Common\ElementInterface; |
|
7 | ||
8 | class D205 extends Element implements ElementInterface |
|
9 | { |
|
10 | const REG = 'D205'; |
|
11 | const LEVEL = 4; |
|
12 | const PARENT = 'D200'; |
|
13 | ||
14 | protected $parameters = [ |
|
15 | 'CST_COFINS' => [ |
|
16 | 'type' => 'string', |
|
17 | 'regex' => '^((0[1-9])|49|99)$', |
|
18 | 'required' => false, |
|
19 | 'info' => 'Código da Situação Tributária referente a COFINS. ', |
|
20 | 'format' => '' |
|
21 | ], |
|
22 | 'VL_ITEM' => [ |
|
23 | 'type' => 'numeric', |
|
24 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
25 | 'required' => false, |
|
26 | 'info' => 'Valor total dos itens ', |
|
27 | 'format' => '15v2' |
|
28 | ], |
|
29 | 'VL_BC_COFINS' => [ |
|
30 | 'type' => 'numeric', |
|
31 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
32 | 'required' => false, |
|
33 | 'info' => 'Valor da base de cálculo da COFINS ', |
|
34 | 'format' => '15v2' |
|
35 | ], |
|
36 | 'ALIQ_COFINS' => [ |
|
37 | 'type' => 'numeric', |
|
38 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
39 | 'required' => false, |
|
40 | 'info' => 'Alíquota da COFINS (em percentual) ', |
|
41 | 'format' => '8v4' |
|
42 | ], |
|
43 | 'VL_COFINS' => [ |
|
44 | 'type' => 'numeric', |
|
45 | 'regex' => '^\d+(\.\d*)?|\.\d+$', |
|
46 | 'required' => false, |
|
47 | 'info' => 'Valor da COFINS ', |
|
48 | 'format' => '15v2' |
|
49 | ], |
|
50 | 'COD_CTA' => [ |
|
51 | 'type' => 'string', |
|
52 | 'regex' => '^.{0,255}$', |
|
53 | 'required' => false, |
|
54 | 'info' => 'Código da conta analítica contábil debitada/creditada ', |
|
55 | 'format' => '' |
|
56 | ], |
|
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 | $this->postValidation(); |
|
69 | } |
|
70 | ||
71 | public function postValidation() |
|
72 | { |
|
73 | $multiplicacao = $this->values->vl_bc_cofins * $this->values->aliq_cofins; |
|
74 | if (number_format($this->values->vl_cofins, 2) != number_format($multiplicacao / 100, 2)) { |
|
75 | throw new \InvalidArgumentException("[" . self::REG . "] " . |
|
76 | "O campo VL_COFINS deve de ser o calculo da multiplicacao " . |
|
77 | "da base de calculo do cofins com a aliquota do cofins, o resultado dividido por 100"); |
|
78 | } |
|
79 | } |
|
80 | } |
|
81 |