estou com o mesmo problema, descomentei o código e não gerou a tag
procedure NotaFiscal.Assinar; var XMLAss: String; ArqXML: String; Leitor: TLeitor; i : integer; begin if NaoEstaVazio(FXMLAssinado) then exit;
ArqXML := GerarXML;
// XML já deve estar em UTF8, para poder ser assinado // ArqXML := ConverteXMLtoUTF8(ArqXML); FXMLOriginal := ArqXML;
with TACBrNFe(TNotasFiscais(Collection).ACBrNFe) do begin XMLAss := SSL.Assinar(ArqXML, 'NFe', 'infNFe'); FXMLAssinado := XMLAss; FXMLOriginal := XMLAss;
// Remove header, pois podem existir várias Notas no XML // //TODO: Verificar se precisa //XMLAss := StringReplace(XMLAss, '<' + ENCODING_UTF8_STD + '>', '', [rfReplaceAll]); //XMLAss := StringReplace(XMLAss, '<' + XML_V01 + '>', '', [rfReplaceAll]);
Leitor := TLeitor.Create; try leitor.Grupo := XMLAss; NFe.signature.URI := Leitor.rAtributo('Reference URI='); NFe.signature.DigestValue := Leitor.rCampo(tcStr, 'DigestValue'); NFe.signature.SignatureValue := Leitor.rCampo(tcStr, 'SignatureValue'); NFe.signature.X509Certificate := Leitor.rCampo(tcStr, 'X509Certificate'); finally Leitor.Free; end;
//*********************************************************************************** // Atenção o código comentado abaixo não pode ser excluido pois será descomentado // quando as alterações no XML definidas em NT 2015/002 versão 1.00 entrar em vigor. // Homologação: 01/10/2015 // Produção: 03/11/2015 //***********************************************************************************
// Gera o QR-Code para adicionar no XML antes de ser validado e salvo // somente para a NFC-e.
if Configuracoes.Geral.ModeloDF = moNFCe then begin with TACBrNFe(TNotasFiscais(Collection).ACBrNFe) do begin NFe.infNFeSupl.qrCode := GetURLQRCode(NFe.Ide.cUF, NFe.Ide.tpAmb, onlyNumber(NFe.infNFe.ID), NFe.Dest.CNPJCPF, NFe.Ide.dEmi, NFe.Total.ICMSTot.vNF, NFe.Total.ICMSTot.vICMS, NFe.signature.DigestValue); end;
i := pos('<Signature ', XMLAss); XMLAss := Copy(XMLAss, 1, i -1) + '<infNFeSupl>' + '<qrCode>' + '<![CDATA[' + NFe.infNFeSupl.qrCode + ']]>' + '</qrCode>' + '</infNFeSupl>' + Copy(XMLAss, i, length(XMLAss)); end;
if Configuracoes.Arquivos.Salvar then begin if NaoEstaVazio(NomeArq) then Gravar(NomeArq, XMLAss) else Gravar(CalcularNomeArquivoCompleto(), XMLAss); end; end; end;