@@ -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; |