Skip to content

Commit

Permalink
[UPD] #damdfe - Correçao na impressao do damdfe, estava pegando o cpf…
Browse files Browse the repository at this point in the history
… do motorista e atachando ao cabeçalho do MDFe
  • Loading branch information
evandrogdn committed Apr 23, 2020
1 parent b0d6574 commit 53bc4ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MDFe/Damdfe.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ public function __construct(
$this->mdfeProc = $this->dom->getElementsByTagName("mdfeProc")->item(0);
$this->infMDFe = $this->dom->getElementsByTagName("infMDFe")->item(0);
$this->emit = $this->dom->getElementsByTagName("emit")->item(0);
if ($this->dom->getElementsByTagName("CPF")->item(0)) {
$this->CPF = $this->dom->getElementsByTagName("CPF")->item(0)->nodeValue;
if ($this->dom->getElementsByTagName("emit")->item(0)->getElementsByTagName("CPF")->item(0)) {
$this->CPF = $this->dom->getElementsByTagName("emit")->item(0)->getElementsByTagName("CPF")->item(0)->nodeValue;
} else {
$this->CNPJ = $this->dom->getElementsByTagName("CNPJ")->item(0)->nodeValue;
$this->CNPJ = $this->dom->getElementsByTagName("emit")->item(0)->getElementsByTagName("CNPJ")->item(0)->nodeValue;
}
$this->IE = $this->dom->getElementsByTagName("IE")->item(0)->nodeValue;
$this->xNome = $this->dom->getElementsByTagName("xNome")->item(0)->nodeValue;
Expand Down

0 comments on commit 53bc4ca

Please sign in to comment.