@@ -777,7 +777,6 @@ |
||
777 | 777 | |
778 | 778 | /** |
779 | 779 | * Create tag comb [LA] |
780 | - * @param stdClass $std |
|
781 | 780 | * @return void |
782 | 781 | */ |
783 | 782 | protected function buildLAEntity() |
@@ -16,7 +16,6 @@ |
||
16 | 16 | * @link http://github.com/nfephp-org/sped-nfe for the canonical source repository |
17 | 17 | */ |
18 | 18 | |
19 | -use NFePHP\Common\Strings; |
|
20 | 19 | use NFePHP\CTe\Make; |
21 | 20 | use NFePHP\CTe\Exception\DocumentsException; |
22 | 21 | use stdClass; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function __construct($version = '3.10') |
108 | 108 | { |
109 | 109 | $ver = str_replace('.', '', $version); |
110 | - $path = realpath(__DIR__."/../../storage/txtstructure$ver.json"); |
|
110 | + $path = realpath(__DIR__ . "/../../storage/txtstructure$ver.json"); |
|
111 | 111 | $this->structure = json_decode(file_get_contents($path), true); |
112 | 112 | $this->make = new Make(); |
113 | 113 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if (empty($fields)) { |
139 | 139 | continue; |
140 | 140 | } |
141 | - $metodo = strtolower(str_replace(' ', '', $fields[0])).'Entity'; |
|
141 | + $metodo = strtolower(str_replace(' ', '', $fields[0])) . 'Entity'; |
|
142 | 142 | if (!method_exists(__CLASS__, $metodo)) { |
143 | 143 | //campo não definido |
144 | 144 | throw DocumentsException::wrongDocument(16, $lin); |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | protected static function fieldsToStd($dfls, $struct) |
159 | 159 | { |
160 | 160 | $sfls = explode('|', $struct); |
161 | - $len = count($sfls)-1; |
|
161 | + $len = count($sfls) - 1; |
|
162 | 162 | $std = new \stdClass(); |
163 | 163 | for ($i = 1; $i < $len; $i++) { |
164 | 164 | $name = $sfls[$i]; |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | $this->stdPIS->CST = $std->CST; |
1232 | 1232 | $this->stdPIS->vPIS = $std->vPIS; |
1233 | 1233 | $this->stdPIS->qBCProd = $std->qBCProd; |
1234 | - $this->stdPIS->vAliqProd = $std->vAliqProd; |
|
1234 | + $this->stdPIS->vAliqProd = $std->vAliqProd; |
|
1235 | 1235 | $this->buildQEntity(); |
1236 | 1236 | } |
1237 | 1237 | |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | protected function q10Entity($std) |
1283 | 1283 | { |
1284 | 1284 | $this->stdPIS->qBCProd = $std->qBCProd; |
1285 | - $this->stdPIS->vAliqProd = $std->vAliqProd; |
|
1285 | + $this->stdPIS->vAliqProd = $std->vAliqProd; |
|
1286 | 1286 | $this->buildQEntity(); |
1287 | 1287 | } |
1288 | 1288 |
@@ -19,7 +19,6 @@ |
||
19 | 19 | use NFePHP\Common\Strings; |
20 | 20 | use NFePHP\Common\Signer; |
21 | 21 | use NFePHP\Common\UFList; |
22 | -use NFePHP\CTe\Factories\Events; |
|
23 | 22 | use NFePHP\CTe\Common\Tools as ToolsCommon; |
24 | 23 | use RuntimeException; |
25 | 24 | use InvalidArgumentException; |
@@ -92,7 +92,7 @@ |
||
92 | 92 | /** |
93 | 93 | * Request authorization to issue CTe OS with one document only |
94 | 94 | * @param type $xml |
95 | - * @return type |
|
95 | + * @return string |
|
96 | 96 | */ |
97 | 97 | public function sefazEnviaCTeOS($xml) |
98 | 98 | { |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | . ((strlen($this->config->cnpj)==14) ? |
380 | 380 | "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
381 | 381 | "<CPF>".$this->config->cnpj."</CPF>" |
382 | - ) |
|
382 | + ) |
|
383 | 383 | . $tagNSU."</distDFeInt>"; |
384 | 384 | //valida o xml da requisição |
385 | 385 | $this->isValid($this->urlVersion, $consulta, 'distDFeInt'); |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | . ((strlen($this->config->cnpj)==14) ? |
726 | 726 | "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
727 | 727 | "<CPF>".$this->config->cnpj."</CPF>" |
728 | - ) |
|
728 | + ) |
|
729 | 729 | ."</distDFeInt>"; |
730 | 730 | //valida o xml da requisição |
731 | 731 | $this->isValid($this->urlVersion, $consulta, 'distDFeInt'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if ($compactar) { |
82 | 82 | $gzdata = base64_encode(gzencode($request, 9, FORCE_GZIP)); |
83 | 83 | $body = "<cteDadosMsgZip xmlns=\"$this->urlNamespace\">$gzdata</cteDadosMsgZip>"; |
84 | - $method = $this->urlMethod."Zip"; |
|
84 | + $method = $this->urlMethod . "Zip"; |
|
85 | 85 | $parameters = ['cteDadosMsgZip' => $gzdata]; |
86 | 86 | $body = "<cteDadosMsgZip xmlns=\"$this->urlNamespace\">$gzdata</cteDadosMsgZip>"; |
87 | 87 | } |
@@ -374,13 +374,12 @@ discard block |
||
374 | 374 | } |
375 | 375 | //monta a consulta |
376 | 376 | $consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">" |
377 | - . "<tpAmb>".$this->tpAmb."</tpAmb>" |
|
377 | + . "<tpAmb>" . $this->tpAmb . "</tpAmb>" |
|
378 | 378 | . "<cUFAutor>$cUF</cUFAutor>" |
379 | - . ((strlen($this->config->cnpj)==14) ? |
|
380 | - "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
|
381 | - "<CPF>".$this->config->cnpj."</CPF>" |
|
379 | + . ((strlen($this->config->cnpj) == 14) ? |
|
380 | + "<CNPJ>" . $this->config->cnpj . "</CNPJ>" : "<CPF>" . $this->config->cnpj . "</CPF>" |
|
382 | 381 | ) |
383 | - . $tagNSU."</distDFeInt>"; |
|
382 | + . $tagNSU . "</distDFeInt>"; |
|
384 | 383 | //valida o xml da requisição |
385 | 384 | $this->isValid($this->urlVersion, $consulta, 'distDFeInt'); |
386 | 385 | $this->lastRequest = $consulta; |
@@ -666,7 +665,7 @@ discard block |
||
666 | 665 | $dt = new \DateTime(); |
667 | 666 | $dhEvento = $dt->format('Y-m-d\TH:i:sP'); |
668 | 667 | $sSeqEvento = str_pad($nSeqEvento, 2, "0", STR_PAD_LEFT); |
669 | - $eventId = "ID".$tpEvento.$chave.$sSeqEvento; |
|
668 | + $eventId = "ID" . $tpEvento . $chave . $sSeqEvento; |
|
670 | 669 | $cOrgao = UFList::getCodeByUF($uf); |
671 | 670 | |
672 | 671 | $request = "<eventoCTe xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">" |
@@ -722,9 +721,8 @@ discard block |
||
722 | 721 | ); |
723 | 722 | //monta a consulta |
724 | 723 | $consulta = "<consChNFe><chNFe>$chave</chNFe></consChNFe>" |
725 | - . ((strlen($this->config->cnpj)==14) ? |
|
726 | - "<CNPJ>".$this->config->cnpj."</CNPJ>" : |
|
727 | - "<CPF>".$this->config->cnpj."</CPF>" |
|
724 | + . ((strlen($this->config->cnpj) == 14) ? |
|
725 | + "<CNPJ>" . $this->config->cnpj . "</CNPJ>" : "<CPF>" . $this->config->cnpj . "</CPF>" |
|
728 | 726 | ) |
729 | 727 | ."</distDFeInt>"; |
730 | 728 | //valida o xml da requisição |
@@ -778,8 +776,8 @@ discard block |
||
778 | 776 | . "<indOp>$indOp</indOp>" |
779 | 777 | . "<raizCNPJ>$raizCNPJ</raizCNPJ>" |
780 | 778 | . "<dadosCsc>" |
781 | - . "<idCsc>".$this->config->CSCid."</idCsc>" |
|
782 | - . "<codigoCsc>".$this->config->CSC."</codigoCsc>" |
|
779 | + . "<idCsc>" . $this->config->CSCid . "</idCsc>" |
|
780 | + . "<codigoCsc>" . $this->config->CSC . "</codigoCsc>" |
|
783 | 781 | . "</dadosCsc>" |
784 | 782 | . "</admCscNFCe>"; |
785 | 783 | } |
@@ -810,7 +808,7 @@ discard block |
||
810 | 808 | $dom->loadXML($cte); |
811 | 809 | //verifica a validade no webservice da SEFAZ |
812 | 810 | $tpAmb = $dom->getElementsByTagName('tpAmb')->item(0)->nodeValue; |
813 | - $infCTe = $dom->getElementsByTagName('infCte')->item(0); |
|
811 | + $infCTe = $dom->getElementsByTagName('infCte')->item(0); |
|
814 | 812 | $chCTe = preg_replace('/[^0-9]/', '', $infCTe->getAttribute("Id")); |
815 | 813 | $protocol = $dom->getElementsByTagName('nProt')->item(0)->nodeValue; |
816 | 814 | $digval = $dom->getElementsByTagName('DigestValue')->item(0)->nodeValue; |
@@ -48,9 +48,9 @@ |
||
48 | 48 | */ |
49 | 49 | protected static function validInputData(stdClass $data) |
50 | 50 | { |
51 | - $filejsonschema = __DIR__. "/../../storage/config_json.schema"; |
|
51 | + $filejsonschema = __DIR__ . "/../../storage/config_json.schema"; |
|
52 | 52 | $validator = new JsonValid(); |
53 | - $validator->check($data, (object)['$ref' => 'file://' . $filejsonschema]); |
|
53 | + $validator->check($data, (object) ['$ref' => 'file://' . $filejsonschema]); |
|
54 | 54 | if (!$validator->isValid()) { |
55 | 55 | $msg = ""; |
56 | 56 | foreach ($validator->getErrors() as $error) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | $path = realpath(__DIR__ . "/../../storage"); |
32 | 32 | $json = file_get_contents( |
33 | - $path . '/txtstructure' . ($version*100) . '.json' |
|
33 | + $path . '/txtstructure' . ($version * 100) . '.json' |
|
34 | 34 | ); |
35 | 35 | self::$entities = json_decode($json, true); |
36 | 36 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | if ($default != $count) { |
82 | 82 | self::$errors[] = "ERRO: O número de parâmetros na linha " |
83 | 83 | . "está errado (esperado #$default) -> (encontrado #$count). [ $row ] Esperado [ " |
84 | - . self::$entities[$ref]." ]"; |
|
84 | + . self::$entities[$ref] . " ]"; |
|
85 | 85 | } |
86 | 86 | foreach ($fields as $field) { |
87 | 87 | if ($field != trim($field)) { |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $dtEmi = new DateTime($ide->getElementsByTagName('dhEmi')->item(0)->nodeValue); |
37 | 37 | $ano = $dtEmi->format('y'); |
38 | 38 | $mes = $dtEmi->format('m'); |
39 | - $tpEmis = (string)$contingency->tpEmis; |
|
39 | + $tpEmis = (string) $contingency->tpEmis; |
|
40 | 40 | $emit = $dom->getElementsByTagName('emit')->item(0); |
41 | 41 | $cnpj = $emit->getElementsByTagName('CNPJ')->item(0)->nodeValue; |
42 | 42 |
@@ -114,7 +114,7 @@ |
||
114 | 114 | $type = strtoupper(str_replace('-', '', $type)); |
115 | 115 | |
116 | 116 | if (empty($type)) { |
117 | - $type = (string)$list[$acronym]; |
|
117 | + $type = (string) $list[$acronym]; |
|
118 | 118 | } |
119 | 119 | $this->config = $this->configBuild($dt->getTimestamp(), $motive, $type); |
120 | 120 | return $this->__toString(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | throw DocumentsException::wrongDocument(3, "<protCTe>"); |
130 | 130 | } |
131 | 131 | $infProt = $ret->getElementsByTagName('infProt')->item(0); |
132 | - $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
132 | + $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
133 | 133 | $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
134 | 134 | $dig = $infProt->getElementsByTagName("digVal")->item(0); |
135 | 135 | $digProt = '000'; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | throw DocumentsException::wrongDocument(3, "<protCTe>"); |
187 | 187 | } |
188 | 188 | $infProt = $ret->getElementsByTagName('infProt')->item(0); |
189 | - $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
189 | + $cStat = $infProt->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
190 | 190 | $xMotivo = $infProt->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
191 | 191 | $dig = $infProt->getElementsByTagName("digVal")->item(0); |
192 | 192 | $digProt = '000'; |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | // $resLote = $ret->getElementsByTagName('idLote')->item(0)->nodeValue; |
240 | 240 | //extrai a rag retEvento da resposta (retorno da SEFAZ) |
241 | 241 | $retEv = $ret->getElementsByTagName('retEventoCTe')->item(0); |
242 | - $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
242 | + $cStat = $retEv->getElementsByTagName('cStat')->item(0)->nodeValue; |
|
243 | 243 | $xMotivo = $retEv->getElementsByTagName('xMotivo')->item(0)->nodeValue; |
244 | 244 | $tpEvento = $retEv->getElementsByTagName('tpEvento')->item(0)->nodeValue; |
245 | 245 | $cStatValids = ['135', '136']; |
@@ -389,8 +389,7 @@ |
||
389 | 389 | } |
390 | 390 | |
391 | 391 | /** |
392 | - * @param string $Dom CTe xml content |
|
393 | - * @param string $xml CTe xml content |
|
392 | + * @param string $modal |
|
394 | 393 | * @return string|bool |
395 | 394 | * @todo |
396 | 395 | * Retorna o xml do modal especifico |
@@ -338,7 +338,7 @@ |
||
338 | 338 | $signed = $this->addQRCode($dom); |
339 | 339 | } |
340 | 340 | $this->isValid($this->versao, $signed, $method); |
341 | - $modal = (int)$dom->getElementsByTagName('modal')->item(0)->nodeValue; |
|
341 | + $modal = (int) $dom->getElementsByTagName('modal')->item(0)->nodeValue; |
|
342 | 342 | if ($modelo != 67) { |
343 | 343 | switch ($modal) { |
344 | 344 | case 1: |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | |
1177 | 1177 | $identificador = '#4 <infPercurso> - '; |
1178 | 1178 | $this->infPercurso[] = $this->dom->createElement('infPercurso'); |
1179 | - $posicao = (int)count($this->infPercurso) - 1; |
|
1179 | + $posicao = (int) count($this->infPercurso) - 1; |
|
1180 | 1180 | $this->dom->addChild( |
1181 | 1181 | $this->infPercurso[$posicao], |
1182 | 1182 | 'UFPer', |
@@ -1791,7 +1791,7 @@ discard block |
||
1791 | 1791 | |
1792 | 1792 | $identificador = '#65 <pass> - '; |
1793 | 1793 | $this->pass[] = $this->dom->createElement('pass'); |
1794 | - $posicao = (int)count($this->pass) - 1; |
|
1794 | + $posicao = (int) count($this->pass) - 1; |
|
1795 | 1795 | $this->dom->addChild( |
1796 | 1796 | $this->pass[$posicao], |
1797 | 1797 | 'xPass', |
@@ -2046,7 +2046,7 @@ discard block |
||
2046 | 2046 | $identificador = '#91 <ObsCont> - '; |
2047 | 2047 | if (count($this->obsCont) <= 10) { |
2048 | 2048 | $this->obsCont[] = $this->dom->createElement('ObsCont'); |
2049 | - $posicao = (int)count($this->obsCont) - 1; |
|
2049 | + $posicao = (int) count($this->obsCont) - 1; |
|
2050 | 2050 | $this->obsCont[$posicao]->setAttribute('xCampo', $std->xCampo); |
2051 | 2051 | $this->dom->addChild( |
2052 | 2052 | $this->obsCont[$posicao], |
@@ -2058,9 +2058,9 @@ discard block |
||
2058 | 2058 | return true; |
2059 | 2059 | } |
2060 | 2060 | $this->errors[] = array( |
2061 | - 'tag' => (string)'<ObsCont>', |
|
2062 | - 'desc' => (string)'Campo de uso livre do contribuinte', |
|
2063 | - 'erro' => (string)'Tag deve aparecer de 0 a 10 vezes' |
|
2061 | + 'tag' => (string) '<ObsCont>', |
|
2062 | + 'desc' => (string) 'Campo de uso livre do contribuinte', |
|
2063 | + 'erro' => (string) 'Tag deve aparecer de 0 a 10 vezes' |
|
2064 | 2064 | ); |
2065 | 2065 | return false; |
2066 | 2066 | } |
@@ -2087,7 +2087,7 @@ discard block |
||
2087 | 2087 | $identificador = '#94 <ObsFisco> - '; |
2088 | 2088 | if (count($this->obsFisco) <= 10) { |
2089 | 2089 | $this->obsFisco[] = $this->dom->createElement('ObsFisco'); |
2090 | - $posicao = (int)count($this->obsFisco) - 1; |
|
2090 | + $posicao = (int) count($this->obsFisco) - 1; |
|
2091 | 2091 | $this->obsFisco[$posicao]->setAttribute('xCampo', $std->xCampo); |
2092 | 2092 | $this->dom->addChild( |
2093 | 2093 | $this->obsFisco[$posicao], |
@@ -2099,9 +2099,9 @@ discard block |
||
2099 | 2099 | return true; |
2100 | 2100 | } |
2101 | 2101 | $this->errors[] = array( |
2102 | - 'tag' => (string)'<ObsFisco>', |
|
2103 | - 'desc' => (string)'Campo de uso livre do contribuinte', |
|
2104 | - 'erro' => (string)'Tag deve aparecer de 0 a 10 vezes' |
|
2102 | + 'tag' => (string) '<ObsFisco>', |
|
2103 | + 'desc' => (string) 'Campo de uso livre do contribuinte', |
|
2104 | + 'erro' => (string) 'Tag deve aparecer de 0 a 10 vezes' |
|
2105 | 2105 | ); |
2106 | 2106 | return false; |
2107 | 2107 | } |
@@ -3129,7 +3129,7 @@ discard block |
||
3129 | 3129 | |
3130 | 3130 | $identificador = '#65 <pass> - '; |
3131 | 3131 | $this->comp[] = $this->dom->createElement('Comp'); |
3132 | - $posicao = (int)count($this->comp) - 1; |
|
3132 | + $posicao = (int) count($this->comp) - 1; |
|
3133 | 3133 | $this->dom->addChild( |
3134 | 3134 | $this->comp[$posicao], |
3135 | 3135 | 'xNome', |
@@ -3579,7 +3579,7 @@ discard block |
||
3579 | 3579 | |
3580 | 3580 | $identificador = '#257 <infQ> - '; |
3581 | 3581 | $this->infQ[] = $this->dom->createElement('infQ'); |
3582 | - $posicao = (int)count($this->infQ) - 1; |
|
3582 | + $posicao = (int) count($this->infQ) - 1; |
|
3583 | 3583 | $this->dom->addChild( |
3584 | 3584 | $this->infQ[$posicao], |
3585 | 3585 | 'cUnid', |
@@ -4079,7 +4079,7 @@ discard block |
||
4079 | 4079 | |
4080 | 4080 | $ident = '#319 <infDocRef> - '; |
4081 | 4081 | $this->infDocRef[] = $this->dom->createElement('infDocRef'); |
4082 | - $posicao = (int)count($this->infDocRef) - 1; |
|
4082 | + $posicao = (int) count($this->infDocRef) - 1; |
|
4083 | 4083 | $this->dom->addChild( |
4084 | 4084 | $this->infDocRef[$posicao], |
4085 | 4085 | 'nDoc', |
@@ -4139,7 +4139,7 @@ discard block |
||
4139 | 4139 | |
4140 | 4140 | $identificador = '#345 <emiDocAnt> - '; |
4141 | 4141 | $this->emiDocAnt[] = $this->dom->createElement('emiDocAnt'); |
4142 | - $posicao = (int)count($this->emiDocAnt) - 1; |
|
4142 | + $posicao = (int) count($this->emiDocAnt) - 1; |
|
4143 | 4143 | if ($std->CNPJ != '') { |
4144 | 4144 | $this->dom->addChild( |
4145 | 4145 | $this->emiDocAnt[$posicao], |
@@ -4198,7 +4198,7 @@ discard block |
||
4198 | 4198 | |
4199 | 4199 | $identificador = '#358 <idDocAntEle> - '; |
4200 | 4200 | $this->idDocAntEle[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntEle'); |
4201 | - $posicao = (int)count($this->idDocAntEle[count($this->emiDocAnt) - 1]) - 1; |
|
4201 | + $posicao = (int) count($this->idDocAntEle[count($this->emiDocAnt) - 1]) - 1; |
|
4202 | 4202 | $this->dom->addChild( |
4203 | 4203 | $this->idDocAntEle[count($this->emiDocAnt) - 1][$posicao], |
4204 | 4204 | 'chCTe', |
@@ -4229,7 +4229,7 @@ discard block |
||
4229 | 4229 | |
4230 | 4230 | $identificador = '#360 <seg> - '; |
4231 | 4231 | $this->seg[] = $this->dom->createElement('seg'); |
4232 | - $posicao = (int)count($this->seg) - 1; |
|
4232 | + $posicao = (int) count($this->seg) - 1; |
|
4233 | 4233 | $this->dom->addChild( |
4234 | 4234 | $this->seg[$posicao], |
4235 | 4235 | 'respSeg', |
@@ -4275,7 +4275,7 @@ discard block |
||
4275 | 4275 | |
4276 | 4276 | $identificador = '#358 <idDocAntPap> - '; |
4277 | 4277 | $this->idDocAntPap[count($this->emiDocAnt) - 1][] = $this->dom->createElement('idDocAntPap'); |
4278 | - $posicao = (int)count($this->idDocAntPap[count($this->emiDocAnt) - 1]) - 1; |
|
4278 | + $posicao = (int) count($this->idDocAntPap[count($this->emiDocAnt) - 1]) - 1; |
|
4279 | 4279 | $this->dom->addChild( |
4280 | 4280 | $this->idDocAntPap[count($this->emiDocAnt) - 1][$posicao], |
4281 | 4281 | 'tpDoc', |
@@ -1291,8 +1291,6 @@ discard block |
||
1291 | 1291 | * #35 |
1292 | 1292 | * Nível: 2 |
1293 | 1293 | * |
1294 | - * @param string $toma Tomador do |
|
1295 | - * Serviço |
|
1296 | 1294 | * @param stdClass $std |
1297 | 1295 | * @return \DOMElement |
1298 | 1296 | */ |
@@ -2131,6 +2129,7 @@ discard block |
||
2131 | 2129 | * Os parâmetros para esta função são todos os elementos da tag "ObsCont" do |
2132 | 2130 | * tipo elemento (Ele = E|CE|A) e nível 3 |
2133 | 2131 | * |
2132 | + * @param stdClass $std |
|
2134 | 2133 | * @return boolean |
2135 | 2134 | */ |
2136 | 2135 | public function tagobsCont($std) |
@@ -2172,6 +2171,7 @@ discard block |
||
2172 | 2171 | * Os parâmetros para esta função são todos os elementos da tag "ObsFisco" do tipo |
2173 | 2172 | * elemento (Ele = E|CE|A) e nível 3 |
2174 | 2173 | * |
2174 | + * @param stdClass $std |
|
2175 | 2175 | * @return boolean |
2176 | 2176 | */ |
2177 | 2177 | public function tagobsFisco($std) |
@@ -2213,6 +2213,7 @@ discard block |
||
2213 | 2213 | * Os parâmetros para esta função são todos os elementos da tag "emit" do |
2214 | 2214 | * tipo elemento (Ele = E|CE|A) e nível 2 |
2215 | 2215 | * |
2216 | + * @param stdClass $std |
|
2216 | 2217 | * @return \DOMElement |
2217 | 2218 | */ |
2218 | 2219 | public function tagemit($std) |
@@ -2275,6 +2276,7 @@ discard block |
||
2275 | 2276 | * Os parâmetros para esta função são todos os elementos da tag "enderEmit" do |
2276 | 2277 | * tipo elemento (Ele = E|CE|A) e nível 3 |
2277 | 2278 | * |
2279 | + * @param stdClass $std |
|
2278 | 2280 | * @return \DOMElement |
2279 | 2281 | */ |
2280 | 2282 | public function tagenderEmit($std) |
@@ -2971,6 +2973,7 @@ discard block |
||
2971 | 2973 | * Os parâmetros para esta função são todos os elementos da tag "dest" do |
2972 | 2974 | * tipo elemento (Ele = E|CE|A) e nível 2 |
2973 | 2975 | * |
2976 | + * @param stdClass $std |
|
2974 | 2977 | * @return \DOMElement |
2975 | 2978 | */ |
2976 | 2979 | public function tagdest($std) |
@@ -3073,6 +3076,7 @@ discard block |
||
3073 | 3076 | * Os parâmetros para esta função são todos os elementos da tag "enderDest" do |
3074 | 3077 | * tipo elemento (Ele = E|CE|A) e nível 3 |
3075 | 3078 | * |
3079 | + * @param stdClass $std |
|
3076 | 3080 | * @return \DOMElement |
3077 | 3081 | */ |
3078 | 3082 | public function tagenderDest($std) |
@@ -3252,6 +3256,7 @@ discard block |
||
3252 | 3256 | * Informações relativas ao ICMS |
3253 | 3257 | * #194 |
3254 | 3258 | * |
3259 | + * @param stdClass $std |
|
3255 | 3260 | * @return DOMElement |
3256 | 3261 | */ |
3257 | 3262 | public function tagicms($std) |
@@ -3912,6 +3917,7 @@ discard block |
||
3912 | 3917 | * #297 |
3913 | 3918 | * Nível: 3 |
3914 | 3919 | * |
3920 | + * @param stdClass $std |
|
3915 | 3921 | * @return mixed |
3916 | 3922 | */ |
3917 | 3923 | public function taginfNFe($std) |
@@ -4434,7 +4440,6 @@ discard block |
||
4434 | 4440 | * #366 |
4435 | 4441 | * Nível: 2 |
4436 | 4442 | * |
4437 | - * @param string $versaoModal |
|
4438 | 4443 | * @return DOMElement|\DOMNode |
4439 | 4444 | */ |
4440 | 4445 | public function taginfModal($std) |
@@ -5008,7 +5013,6 @@ discard block |
||
5008 | 5013 | /** |
5009 | 5014 | * CT-e de substituição - tomaICMS |
5010 | 5015 | * |
5011 | - * @param type $std |
|
5012 | 5016 | * @return type |
5013 | 5017 | */ |
5014 | 5018 | public function tagtomaICMS() |
@@ -5020,7 +5024,7 @@ discard block |
||
5020 | 5024 | /** |
5021 | 5025 | * CT-e de substituição - NF-e |
5022 | 5026 | * |
5023 | - * @param type $std |
|
5027 | + * @param stdClass $std |
|
5024 | 5028 | * @return type |
5025 | 5029 | */ |
5026 | 5030 | public function tagrefNFe($std) |
@@ -5050,7 +5054,7 @@ discard block |
||
5050 | 5054 | /** |
5051 | 5055 | * CT-e de substituição - NF |
5052 | 5056 | * |
5053 | - * @param type $std |
|
5057 | + * @param stdClass $std |
|
5054 | 5058 | * @return type |
5055 | 5059 | */ |
5056 | 5060 | public function tagrefNF($std) |
@@ -5140,7 +5144,7 @@ discard block |
||
5140 | 5144 | /** |
5141 | 5145 | * CT-e de substituição - CT-e |
5142 | 5146 | * |
5143 | - * @param type $std |
|
5147 | + * @param stdClass $std |
|
5144 | 5148 | * @return type |
5145 | 5149 | */ |
5146 | 5150 | public function tagrefCTe($std) |
@@ -5455,6 +5459,7 @@ discard block |
||
5455 | 5459 | * Nível: 1 |
5456 | 5460 | * Os parâmetros para esta função são todos os elementos da tag "autXML" |
5457 | 5461 | * |
5462 | + * @param stdClass $std |
|
5458 | 5463 | * @return boolean |
5459 | 5464 | */ |
5460 | 5465 | public function tagautXML($std) |
@@ -5731,7 +5736,7 @@ discard block |
||
5731 | 5736 | * Replace all unsuported chars |
5732 | 5737 | * |
5733 | 5738 | * @param stdClass $std |
5734 | - * @param array $possible |
|
5739 | + * @param string[] $possible |
|
5735 | 5740 | * @return stdClass |
5736 | 5741 | */ |
5737 | 5742 | private function equilizeParameters(stdClass $std, $possible) |
@@ -3286,118 +3286,118 @@ |
||
3286 | 3286 | |
3287 | 3287 | $identificador = 'N01 <ICMSxx> - '; |
3288 | 3288 | switch ($std->cst) { |
3289 | - case '00': |
|
3290 | - $icms = $this->dom->createElement("ICMS00"); |
|
3291 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 00"); |
|
3292 | - $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3293 | - $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3294 | - $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3295 | - break; |
|
3296 | - case '20': |
|
3297 | - $icms = $this->dom->createElement("ICMS20"); |
|
3298 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 20"); |
|
3299 | - $this->dom->addChild( |
|
3300 | - $icms, |
|
3301 | - 'pRedBC', |
|
3302 | - $std->pRedBC, |
|
3303 | - true, |
|
3304 | - "$identificador Percentual da Redução de BC" |
|
3305 | - ); |
|
3306 | - $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3307 | - $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3308 | - $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3309 | - break; |
|
3310 | - case '40': |
|
3311 | - $icms = $this->dom->createElement("ICMS45"); |
|
3312 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 40"); |
|
3313 | - break; |
|
3314 | - case '41': |
|
3315 | - $icms = $this->dom->createElement("ICMS45"); |
|
3316 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 41"); |
|
3317 | - break; |
|
3318 | - case '51': |
|
3319 | - $icms = $this->dom->createElement("ICMS45"); |
|
3320 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 51"); |
|
3321 | - break; |
|
3322 | - case '60': |
|
3323 | - $icms = $this->dom->createElement("ICMS60"); |
|
3324 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 60"); |
|
3325 | - $this->dom->addChild( |
|
3326 | - $icms, |
|
3327 | - 'vBCSTRet', |
|
3328 | - $std->vBCSTRet, |
|
3329 | - true, |
|
3330 | - "$identificador Valor BC do ICMS ST retido" |
|
3331 | - ); |
|
3332 | - $this->dom->addChild( |
|
3333 | - $icms, |
|
3334 | - 'vICMSSTRet', |
|
3335 | - $std->vICMSSTRet, |
|
3336 | - true, |
|
3337 | - "$identificador Valor do ICMS ST retido" |
|
3338 | - ); |
|
3339 | - $this->dom->addChild( |
|
3340 | - $icms, |
|
3341 | - 'pICMSSTRet', |
|
3342 | - $std->pICMSSTRet, |
|
3343 | - true, |
|
3344 | - "$identificador Valor do ICMS ST retido" |
|
3345 | - ); |
|
3346 | - if ($std->vCred > 0) { |
|
3347 | - $this->dom->addChild($icms, 'vCred', $std->vCred, false, "$identificador Valor do Crédito"); |
|
3348 | - } |
|
3349 | - break; |
|
3350 | - case '90': |
|
3351 | - if ($std->outraUF == true) { |
|
3352 | - $icms = $this->dom->createElement("ICMSOutraUF"); |
|
3353 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 90"); |
|
3354 | - if ($std->vICMSOutraUF > 0) { |
|
3355 | - $this->dom->addChild( |
|
3356 | - $icms, |
|
3357 | - 'pRedBCOutraUF', |
|
3358 | - $std->pRedBCOutraUF, |
|
3359 | - false, |
|
3360 | - "$identificador Percentual Red " |
|
3361 | - . "BC Outra UF" |
|
3362 | - ); |
|
3363 | - } |
|
3364 | - $this->dom->addChild($icms, 'vBCOutraUF', $std->vBCOutraUF, true, "$identificador Valor BC ICMS Outra UF"); |
|
3289 | + case '00': |
|
3290 | + $icms = $this->dom->createElement("ICMS00"); |
|
3291 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 00"); |
|
3292 | + $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3293 | + $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3294 | + $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3295 | + break; |
|
3296 | + case '20': |
|
3297 | + $icms = $this->dom->createElement("ICMS20"); |
|
3298 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 20"); |
|
3365 | 3299 | $this->dom->addChild( |
3366 | - $icms, 'pICMSOutraUF', $std->pICMSOutraUF, true, "$identificador Alíquota do " |
|
3367 | - . "imposto Outra UF" |
|
3300 | + $icms, |
|
3301 | + 'pRedBC', |
|
3302 | + $std->pRedBC, |
|
3303 | + true, |
|
3304 | + "$identificador Percentual da Redução de BC" |
|
3368 | 3305 | ); |
3306 | + $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3307 | + $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3308 | + $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3309 | + break; |
|
3310 | + case '40': |
|
3311 | + $icms = $this->dom->createElement("ICMS45"); |
|
3312 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 40"); |
|
3313 | + break; |
|
3314 | + case '41': |
|
3315 | + $icms = $this->dom->createElement("ICMS45"); |
|
3316 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 41"); |
|
3317 | + break; |
|
3318 | + case '51': |
|
3319 | + $icms = $this->dom->createElement("ICMS45"); |
|
3320 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 51"); |
|
3321 | + break; |
|
3322 | + case '60': |
|
3323 | + $icms = $this->dom->createElement("ICMS60"); |
|
3324 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 60"); |
|
3369 | 3325 | $this->dom->addChild( |
3370 | 3326 | $icms, |
3371 | - 'vICMSOutraUF', |
|
3372 | - $std->vICMSOutraUF, |
|
3327 | + 'vBCSTRet', |
|
3328 | + $std->vBCSTRet, |
|
3373 | 3329 | true, |
3374 | - "$identificador Valor ICMS Outra UF" |
|
3330 | + "$identificador Valor BC do ICMS ST retido" |
|
3375 | 3331 | ); |
3376 | - } else { |
|
3377 | - $icms = $this->dom->createElement("ICMS90"); |
|
3378 | - $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 90"); |
|
3379 | - if ($std->pRedBC > 0) { |
|
3332 | + $this->dom->addChild( |
|
3333 | + $icms, |
|
3334 | + 'vICMSSTRet', |
|
3335 | + $std->vICMSSTRet, |
|
3336 | + true, |
|
3337 | + "$identificador Valor do ICMS ST retido" |
|
3338 | + ); |
|
3339 | + $this->dom->addChild( |
|
3340 | + $icms, |
|
3341 | + 'pICMSSTRet', |
|
3342 | + $std->pICMSSTRet, |
|
3343 | + true, |
|
3344 | + "$identificador Valor do ICMS ST retido" |
|
3345 | + ); |
|
3346 | + if ($std->vCred > 0) { |
|
3347 | + $this->dom->addChild($icms, 'vCred', $std->vCred, false, "$identificador Valor do Crédito"); |
|
3348 | + } |
|
3349 | + break; |
|
3350 | + case '90': |
|
3351 | + if ($std->outraUF == true) { |
|
3352 | + $icms = $this->dom->createElement("ICMSOutraUF"); |
|
3353 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 90"); |
|
3354 | + if ($std->vICMSOutraUF > 0) { |
|
3355 | + $this->dom->addChild( |
|
3356 | + $icms, |
|
3357 | + 'pRedBCOutraUF', |
|
3358 | + $std->pRedBCOutraUF, |
|
3359 | + false, |
|
3360 | + "$identificador Percentual Red " |
|
3361 | + . "BC Outra UF" |
|
3362 | + ); |
|
3363 | + } |
|
3364 | + $this->dom->addChild($icms, 'vBCOutraUF', $std->vBCOutraUF, true, "$identificador Valor BC ICMS Outra UF"); |
|
3365 | + $this->dom->addChild( |
|
3366 | + $icms, 'pICMSOutraUF', $std->pICMSOutraUF, true, "$identificador Alíquota do " |
|
3367 | + . "imposto Outra UF" |
|
3368 | + ); |
|
3380 | 3369 | $this->dom->addChild( |
3381 | 3370 | $icms, |
3382 | - 'pRedBC', |
|
3383 | - $std->pRedBC, |
|
3384 | - false, |
|
3385 | - "$identificador Percentual Redução BC" |
|
3371 | + 'vICMSOutraUF', |
|
3372 | + $std->vICMSOutraUF, |
|
3373 | + true, |
|
3374 | + "$identificador Valor ICMS Outra UF" |
|
3386 | 3375 | ); |
3376 | + } else { |
|
3377 | + $icms = $this->dom->createElement("ICMS90"); |
|
3378 | + $this->dom->addChild($icms, 'CST', $std->cst, true, "$identificador Tributação do ICMS = 90"); |
|
3379 | + if ($std->pRedBC > 0) { |
|
3380 | + $this->dom->addChild( |
|
3381 | + $icms, |
|
3382 | + 'pRedBC', |
|
3383 | + $std->pRedBC, |
|
3384 | + false, |
|
3385 | + "$identificador Percentual Redução BC" |
|
3386 | + ); |
|
3387 | + } |
|
3388 | + $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3389 | + $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3390 | + $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3391 | + if ($std->vCred > 0) { |
|
3392 | + $this->dom->addChild($icms, 'vCred', $std->vCred, false, "$identificador Valor do Crédido"); |
|
3393 | + } |
|
3387 | 3394 | } |
3388 | - $this->dom->addChild($icms, 'vBC', $std->vBC, true, "$identificador Valor da BC do ICMS"); |
|
3389 | - $this->dom->addChild($icms, 'pICMS', $std->pICMS, true, "$identificador Alíquota do imposto"); |
|
3390 | - $this->dom->addChild($icms, 'vICMS', $std->vICMS, true, "$identificador Valor do ICMS"); |
|
3391 | - if ($std->vCred > 0) { |
|
3392 | - $this->dom->addChild($icms, 'vCred', $std->vCred, false, "$identificador Valor do Crédido"); |
|
3393 | - } |
|
3394 | - } |
|
3395 | - break; |
|
3396 | - case 'SN': |
|
3397 | - $icms = $this->dom->createElement("ICMSSN"); |
|
3398 | - $this->dom->addChild($icms, 'CST', 90, true, "$identificador Tributação do ICMS = 90"); |
|
3399 | - $this->dom->addChild($icms, 'indSN', '1', true, "$identificador Indica se contribuinte é SN"); |
|
3400 | - break; |
|
3395 | + break; |
|
3396 | + case 'SN': |
|
3397 | + $icms = $this->dom->createElement("ICMSSN"); |
|
3398 | + $this->dom->addChild($icms, 'CST', 90, true, "$identificador Tributação do ICMS = 90"); |
|
3399 | + $this->dom->addChild($icms, 'indSN', '1', true, "$identificador Indica se contribuinte é SN"); |
|
3400 | + break; |
|
3401 | 3401 | } |
3402 | 3402 | $this->imp = $this->dom->createElement('imp'); |
3403 | 3403 | $tagIcms = $this->dom->createElement('ICMS'); |