Skip to content

Commit

Permalink
GNRE
Browse files Browse the repository at this point in the history
  • Loading branch information
luizkim committed Nov 3, 2023
1 parent 5214c50 commit 570e3bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Sped/Gnre/Helper/GnreHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,20 @@ public function __construct($xmlNf)
public static function getGuiaGnre($xmlNf): Guia
{
$xml = self::parseNf($xmlNf);

$guia = new Guia();

$guia = new Guia();
$guia->c04_docOrigem = $xml->NrNf;
$guia->c28_tipoDocOrigem = $xml->TipoDoc;
$guia->c21_cepEmitente = $xml->CEPEmpresa;
$guia->c16_razaoSocialEmitente = $xml->NmEmpresa;
$guia->c18_enderecoEmitente = $xml->EnderecoEmpresa;
$guia->c19_municipioEmitente = $xml->CdMunicipioEmpresa;
$guia->c19_municipioEmitente = $xml->MunicipioEmpresa;
$guia->c20_ufEnderecoEmitente = $xml->UfEmpresa;
$guia->c17_inscricaoEstadualEmitente = $xml->NrIEEmpresa;
$guia->c22_telefoneEmitente = $xml->TelefoneEmpresa;
$guia->c01_UfFavorecida = $xml->IdUfCliente;
$guia->c36_inscricaoEstadualDestinatario = $xml->NrIECliente;
$guia->c37_razaoSocialDestinatario = $xml->NmCliente;
$guia->c38_municipioDestinatario = $xml->CdMunicipioCliente;

$guia->c38_municipioDestinatario = $xml->MunicipioCliente;

return $guia;
}
Expand All @@ -83,16 +80,19 @@ public static function parseNf($xmlNf): stdClass
$parsed->CEPEmpresa = $xml->NFe->infNFe->emit->enderEmit->CEP;
$parsed->EnderecoEmpresa = $xml->NFe->infNFe->emit->enderEmit->xLgr;
$parsed->CdMunicipioEmpresa = $xml->NFe->infNFe->emit->enderEmit->cMun;
$parsed->MunicipioEmpresa = $xml->NFe->infNFe->emit->enderEmit->xMun;
$parsed->UfEmpresa = $xml->NFe->infNFe->emit->enderEmit->UF;
$parsed->TelefoneEmpresa = $xml->NFe->infNFe->emit->enderEmit->fone;
$parsed->NrIEEmpresa = $xml->NFe->infNFe->emit->IE;
$parsed->NmEmpresa = $xml->NFe->infNFe->emit->xNome;
$parsed->NrDocumentoCliente = $xml->NFe->infNFe->dest->CNPJ ?: $xml->NFe->infNFe->dest->CPF;

$parsed->NrIECliente = $xml->NFe->infNFe->dest->IE;
$parsed->NmCliente = $xml->NFe->infNFe->dest->xNome;
$parsed->NmCidade = $xml->NFe->infNFe->dest->enderDest->xMun;
$parsed->IdUfCliente = $xml->NFe->infNFe->dest->enderDest->UF;
$parsed->CdMunicipioCliente = $xml->NFe->infNFe->dest->enderDest->cMun;
$parsed->MunicipioCliente = $xml->NFe->infNFe->dest->enderDest->xMun;
$parsed->ISUFCliente = $xml->NFe->infNFe->dest->ISUF;
$parsed->TipoDoc = $xml->NFe->infNFe->ide->tpDoc;
$parsed->NrChaveNFe = $xml->protNFe->infProt->chNFe;
Expand Down

0 comments on commit 570e3bb

Please sign in to comment.