public function tagide($cUF = '', $cNF = '', $natOp = '', $indPag = '', $mod = '', $serie = '', $nNF = '', $dhEmi = '', $dhSaiEnt = '', $tpNF = '', $idDest = '', $cMunFG = '', $tpImp = '', $tpEmis = '', $cDV = '', $tpAmb = '', $finNFe = '', $indFinal = '0', $indPres = '', $procEmi = '', $verProc = '', $dhCont = '', $xJust = '')
{
$this->tpAmb = $tpAmb;
$identificador = 'B01 <ide> - ';
$ide = $this->dom->createElement("ide");
$this->dom->addChild($ide, "cUF", $cUF, true, $identificador . "Código da UF do emitente do Documento Fiscal");
$this->dom->addChild($ide, "cNF", $cNF, true, $identificador . "Código Numérico que compõe a Chave de Acesso");
$this->dom->addChild($ide, "natOp", $natOp, true, $identificador . "Descrição da Natureza da Operaçãoo");
$this->dom->addChild($ide, "indPag", $indPag, true, $identificador . "Indicador da forma de pagamento");
$this->dom->addChild($ide, "mod", $mod, true, $identificador . "Código do Modelo do Documento Fiscal");
$this->dom->addChild($ide, "serie", $serie, true, $identificador . "Série do Documento Fiscal");
$this->dom->addChild($ide, "nNF", $nNF, true, $identificador . "Número do Documento Fiscal");
if ($dhEmi == '') {
$dhEmi = DateTime::convertTimestampToSefazTime();
}
$this->dom->addChild($ide, "dhEmi", $dhEmi, true, $identificador . "Data e hora de emissão do Documento Fiscal");
if ($mod == '55' && $dhSaiEnt != '') {
$this->dom->addChild($ide, "dhSaiEnt", $dhSaiEnt, false, $identificador . "Data e hora de Saída ou da Entrada da Mercadoria/Produto");
}
$this->dom->addChild($ide, "tpNF", $tpNF, true, $identificador . "Tipo de Operação");
$this->dom->addChild($ide, "idDest", $idDest, true, $identificador . "Identificador de local de destino da operação");
$this->dom->addChild($ide, "cMunFG", $cMunFG, true, $identificador . "Código do Município de Ocorrência do Fato Gerador");
$this->dom->addChild($ide, "tpImp", $tpImp, true, $identificador . "Formato de Impressão do DANFE");
$this->dom->addChild($ide, "tpEmis", $tpEmis, true, $identificador . "Tipo de Emissão da NF-e");
$this->dom->addChild($ide, "cDV", $cDV, true, $identificador . "Dígito Verificador da Chave de Acesso da NF-e");
$this->dom->addChild($ide, "tpAmb", $tpAmb, true, $identificador . "Identificação do Ambiente");
$this->dom->addChild($ide, "finNFe", $finNFe, true, $identificador . "Finalidade de emissão da NF-e");
$this->dom->addChild($ide, "indFinal", $indFinal, true, $identificador . "Indica operação com Consumidor final");
$this->dom->addChild($ide, "indPres", $indPres, true, $identificador . "Indicador de presença do comprador no estabelecimento comercial no momento da operação");
$this->dom->addChild($ide, "procEmi", $procEmi, true, $identificador . "Processo de emissão da NF-e");
$this->dom->addChild($ide, "verProc", $verProc, true, $identificador . "Versão do Processo de emissão da NF-e");
if ($dhCont != '' && $xJust != '') {
$this->dom->addChild($ide, "dhCont", $dhCont, true, $identificador . "Data e Hora da entrada em contingência");
$this->dom->addChild($ide, "xJust", $xJust, true, $identificador . "Justificativa da entrada em contingência");
}
$this->mod = $mod;
$this->ide = $ide;
return $ide;
}