NFePHP\NFe\MakeNFe::tagdest PHP Метод

tagdest() публичный Метод

tagdest Identificação do Destinatário da NF-e E01 pai A01 tag NFe/infNFe/dest (opcional para modelo 65)
public tagdest ( string $cnpj = '', string $cpf = '', string $idEstrangeiro = '', string $xNome = '', string $indIEDest = '', string $numIE = '', string $isUF = '', string $numIM = '', string $email = '' ) : DOMElement
$cnpj string
$cpf string
$idEstrangeiro string
$xNome string
$indIEDest string
$numIE string
$isUF string
$numIM string
$email string
Результат DOMElement
    public function tagdest($cnpj = '', $cpf = '', $idEstrangeiro = '', $xNome = '', $indIEDest = '', $numIE = '', $isUF = '', $numIM = '', $email = '')
    {
        $identificador = 'E01 <dest> - ';
        $flagNome = true;
        //marca se xNome é ou não obrigatório
        $this->dest = $this->dom->createElement("dest");
        if (($numIE == 'ISENTO' || $numIE == '') && $indIEDest == '1') {
            $indIEDest = '2';
        }
        if ($this->mod == '65') {
            $indIEDest = '9';
            if ($xNome == '') {
                $flagNome = false;
                //marca se xNome é ou não obrigatório
            }
        }
        if ($this->tpAmb == '2') {
            $xNome = 'NF-E EMITIDA EM AMBIENTE DE HOMOLOGACAO - SEM VALOR FISCAL';
            //a exigência do CNPJ 99999999000191 não existe mais
            //removido modelo 55
        }
        if ($cnpj != '') {
            $this->dom->addChild($this->dest, "CNPJ", $cnpj, true, $identificador . "CNPJ do destinatário");
        } elseif ($cpf != '') {
            $this->dom->addChild($this->dest, "CPF", $cpf, true, $identificador . "CPF do destinatário");
        } else {
            $this->dom->addChild($this->dest, "idEstrangeiro", $idEstrangeiro, true, $identificador . "Identificação do destinatário no caso de comprador estrangeiro");
            $indIEDest = '9';
        }
        $this->dom->addChild($this->dest, "xNome", $xNome, $flagNome, $identificador . "Razão Social ou nome do destinatário");
        $this->dom->addChild($this->dest, "indIEDest", $indIEDest, true, $identificador . "Indicador da IE do Destinatário");
        if ($numIE != '' && $numIE != 'ISENTO') {
            $this->dom->addChild($this->dest, "IE", $numIE, true, $identificador . "Inscrição Estadual do Destinatário");
        }
        $this->dom->addChild($this->dest, "ISUF", $isUF, false, $identificador . "Inscrição na SUFRAMA do destinatário");
        $this->dom->addChild($this->dest, "IM", $numIM, false, $identificador . "Inscrição Municipal do Tomador do Serviço do destinatário");
        $this->dom->addChild($this->dest, "email", $email, false, $identificador . "Email do destinatário");
        return $this->dest;
    }

Usage Example

Пример #1
0
 /**
  * zLinhaEEntity
  * Cria a tag dest
  *
  * @param array $aCampos
  */
 protected function zLinhaEEntity($aCampos)
 {
     //Exx|xNome|indIEDest|IE|ISUF|IM|email|CNPJ/CPF/idExtrangeiro
     $this->make->tagdest($aCampos[7], $aCampos[8], $aCampos[9], $aCampos[1], $aCampos[2], $aCampos[3], $aCampos[4], $aCampos[5], $aCampos[6]);
 }
All Usage Examples Of NFePHP\NFe\MakeNFe::tagdest