NFePHP\NFe\MakeNFe::tagenderDest PHP Method

tagenderDest() public method

tagenderDest Endereço do Destinatário da NF-e E05 pai E01 tag NFe/infNFe/dest/enderDest (opcional para modelo 65) Os dados do destinatário devem ser inseridos antes deste método
public tagenderDest ( string $xLgr = '', string $nro = '', string $xCpl = '', string $xBairro = '', string $cMun = '', string $xMun = '', string $siglaUF = '', string $cep = '', string $cPais = '', string $xPais = '', string $fone = '' ) : DOMElement
$xLgr string
$nro string
$xCpl string
$xBairro string
$cMun string
$xMun string
$siglaUF string
$cep string
$cPais string
$xPais string
$fone string
return DOMElement
    public function tagenderDest($xLgr = '', $nro = '', $xCpl = '', $xBairro = '', $cMun = '', $xMun = '', $siglaUF = '', $cep = '', $cPais = '', $xPais = '', $fone = '')
    {
        $identificador = 'E05 <enderDest> - ';
        if (empty($this->dest)) {
            throw new RuntimeException('A TAG dest deve ser criada antes do endereço do mesmo.');
        }
        $this->enderDest = $this->dom->createElement("enderDest");
        $this->dom->addChild($this->enderDest, "xLgr", $xLgr, true, $identificador . "Logradouro do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "nro", $nro, true, $identificador . "Número do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "xCpl", $xCpl, false, $identificador . "Complemento do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "xBairro", $xBairro, true, $identificador . "Bairro do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "cMun", $cMun, true, $identificador . "Código do município do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "xMun", $xMun, true, $identificador . "Nome do município do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "UF", $siglaUF, true, $identificador . "Sigla da UF do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "CEP", $cep, false, $identificador . "Código do CEP do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "cPais", $cPais, false, $identificador . "Código do País do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "xPais", $xPais, false, $identificador . "Nome do País do Endereço do Destinatário");
        $this->dom->addChild($this->enderDest, "fone", $fone, false, $identificador . "Telefone do Endereço do Destinatário");
        $node = $this->dest->getElementsByTagName("indIEDest")->item(0);
        if (!isset($node)) {
            $node = $this->dest->getElementsByTagName("IE")->item(0);
        }
        $this->dest->insertBefore($this->enderDest, $node);
        return $this->enderDest;
    }

Usage Example

Example #1
0
 /**
  * e05Entity
  * Cria a tag enderDest
  *
  * @param array $aCampos
  */
 protected function e05Entity($aCampos)
 {
     //E05|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|CEP|cPais|xPais|fone|
     $this->make->tagenderDest($aCampos[1], $aCampos[2], $aCampos[3], $aCampos[4], $aCampos[5], $aCampos[6], $aCampos[7], $aCampos[8], $aCampos[9], $aCampos[10], $aCampos[11]);
 }
All Usage Examples Of NFePHP\NFe\MakeNFe::tagenderDest