Skip to content

Commit

Permalink
[PRS] Ajustes.
Browse files Browse the repository at this point in the history
  • Loading branch information
icompsoftcleiton committed Oct 30, 2019
1 parent dd77faf commit 4239abf
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
6 changes: 2 additions & 4 deletions src/Complements.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ protected static function addInutCTeProtocol($request, $response)
$retserie = $retInfInut->getElementsByTagName('serie')->item(0)->nodeValue;
$retnCTIni = $retInfInut->getElementsByTagName('nCTIni')->item(0)->nodeValue;
$retnCTFin = $retInfInut->getElementsByTagName('nCTFin')->item(0)->nodeValue;
if (
$versao != $retversao ||
if ($versao != $retversao ||
$tpAmb != $rettpAmb ||
$cUF != $retcUF ||
$ano != $retano ||
Expand Down Expand Up @@ -303,8 +302,7 @@ public static function cancelRegister($cte, $cancelamento)
$tpEvento = $infEvento->getElementsByTagName('tpEvento')
->item(0)
->nodeValue;
if (
in_array($cStat, ['135', '136', '155'])
if (in_array($cStat, ['135', '136', '155'])
&& $tpEvento == '110111'
&& $chaveEvento == $chaveCTe
) {
Expand Down
6 changes: 4 additions & 2 deletions src/Make.php
Original file line number Diff line number Diff line change
Expand Up @@ -3691,7 +3691,8 @@ public function taginfNF($std)
$infNF,
'mod',
$std->mod,
true, $identificador . 'Modelo da Nota Fiscal'
true,
$identificador . 'Modelo da Nota Fiscal'
);
$this->dom->addChild(
$infNF,
Expand Down Expand Up @@ -3733,7 +3734,8 @@ public function taginfNF($std)
'vBCST',
$std->vBCST,
true,
$identificador . 'Valor da Base de Cálculo do ICMS ST');
$identificador . 'Valor da Base de Cálculo do ICMS ST'
);
$this->dom->addChild(
$infNF,
'vST',
Expand Down
19 changes: 9 additions & 10 deletions src/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function sefazEnviaLote(
$body = "<cteDadosMsg xmlns=\"$this->urlNamespace\">$request</cteDadosMsg>";
$method = $this->urlMethod;
if ($compactar) {
$gzdata = base64_encode(gzencode($cons, 9, FORCE_GZIP));
$gzdata = base64_encode(gzencode($request, 9, FORCE_GZIP));
$body = "<cteDadosMsgZip xmlns=\"$this->urlNamespace\">$gzdata</cteDadosMsgZip>";
$method = $this->urlMethod."Zip";
$parameters = ['cteDadosMsgZip' => $gzdata];
Expand All @@ -88,7 +88,7 @@ public function sefazEnviaLote(
$this->lastResponse = $this->sendRequest($body, $parameters);
return $this->lastResponse;
}

/**
* Request authorization to issue CTe OS with one document only
* @param type $xml
Expand Down Expand Up @@ -376,8 +376,8 @@ public function sefazDistDFe(
$consulta = "<distDFeInt xmlns=\"$this->urlPortal\" versao=\"$this->urlVersion\">"
. "<tpAmb>".$this->tpAmb."</tpAmb>"
. "<cUFAutor>$cUF</cUFAutor>"
. ((strlen($this->config->cnpj)==14) ?
"<CNPJ>".$this->config->cnpj."</CNPJ>" :
. ((strlen($this->config->cnpj)==14) ?
"<CNPJ>".$this->config->cnpj."</CNPJ>" :
"<CPF>".$this->config->cnpj."</CPF>"
)
. $tagNSU."</distDFeInt>";
Expand Down Expand Up @@ -720,14 +720,13 @@ public function sefazDownload($chave)
$this->tpAmb,
true
);
$cUF = UFList::getCodeByUF($this->config->siglaUF);
$tagChave = "<consChNFe><chNFe>$chave</chNFe></consChNFe>";
//monta a consulta
. ((strlen($this->config->cnpj)==14) ?
"<CNPJ>".$this->config->cnpj."</CNPJ>" :
$consulta = "<consChNFe><chNFe>$chave</chNFe></consChNFe>"
. ((strlen($this->config->cnpj)==14) ?
"<CNPJ>".$this->config->cnpj."</CNPJ>" :
"<CPF>".$this->config->cnpj."</CPF>"
)
. $tagChave."</distDFeInt>";
."</distDFeInt>";
//valida o xml da requisição
$this->isValid($this->urlVersion, $consulta, 'distDFeInt');
$this->lastRequest = $consulta;
Expand Down Expand Up @@ -872,7 +871,7 @@ public function sefazCE(
) {
$uf = $this->validKeyByUF($chave);
$tpEvento = 110180;

/* relaciona as chaves das NFes */
$infEntrega = '';
foreach ($aNFes as $NFe) {
Expand Down

1 comment on commit 4239abf

@erickmff
Copy link

@erickmff erickmff commented on 4239abf Jun 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ao construir a variável $consulta, na linha 724, a tag distDFeInt não tem um início, ocasionando erro no soap.

Please sign in to comment.