NFePHP\NFe\MakeNFe::tagentrega PHP Method

tagentrega() public method

tagentrega Identificação do Local de entrega G01 pai A01 tag NFe/infNFe/entrega (opcional)
public tagentrega ( string $cnpj = '', string $cpf = '', string $xLgr = '', string $nro = '', string $xCpl = '', string $xBairro = '', string $cMun = '', string $xMun = '', string $siglaUF = '' ) : DOMElement
$cnpj string
$cpf string
$xLgr string
$nro string
$xCpl string
$xBairro string
$cMun string
$xMun string
$siglaUF string
return DOMElement
    public function tagentrega($cnpj = '', $cpf = '', $xLgr = '', $nro = '', $xCpl = '', $xBairro = '', $cMun = '', $xMun = '', $siglaUF = '')
    {
        $identificador = 'G01 <entrega> - ';
        $this->entrega = $this->dom->createElement("entrega");
        if ($cnpj != '') {
            $this->dom->addChild($this->entrega, "CNPJ", $cnpj, true, $identificador . "CNPJ do Cliente da Entrega");
        } else {
            $this->dom->addChild($this->entrega, "CPF", $cpf, true, $identificador . "CPF do Cliente da Entrega");
        }
        $this->dom->addChild($this->entrega, "xLgr", $xLgr, true, $identificador . "Logradouro do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "nro", $nro, true, $identificador . "Número do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "xCpl", $xCpl, false, $identificador . "Complemento do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "xBairro", $xBairro, true, $identificador . "Bairro do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "cMun", $cMun, true, $identificador . "Código do município do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "xMun", $xMun, true, $identificador . "Nome do município do Endereco do Cliente da Entrega");
        $this->dom->addChild($this->entrega, "UF", $siglaUF, true, $identificador . "Sigla da UF do Endereco do Cliente da Entrega");
        return $this->entrega;
    }

Usage Example

Example #1
0
 /**
  * zLinhaGEntity
  * Cria tag entrega
  *
  * @param array $aCampos
  */
 protected function zLinhaGEntity($aCampos)
 {
     //Gxx|xLgr|nro|xCpl|xBairro|cMun|xMun|UF|CNPJ|CPF
     $this->make->tagentrega($aCampos[8], $aCampos[9], $aCampos[1], $aCampos[2], $aCampos[3], $aCampos[4], $aCampos[5], $aCampos[6], $aCampos[7]);
 }