Para correção somente via scrip pelo banco de dados.


1º Consultar
select * from t0122
where f0122idnotafiscal = 6749 and f0059idserie = '5' and f0002idestab = 201
2º  Consultar nfce pela SEFAZ.


3º Pegar as informações da nota autorizada na sefaz e inserir abaixo.
update t0122
set f0122protocoloautorizacaonfe = '152170818660290',
f0122dtaautorizacaonfe = '2017-08-21' ,
f0122digestvalueautorizacaonfe = 'I2vCkuJT5o0q57S6HeCcsyyIcd4=',
f0122statusautorizacaonfe = 100
where f0122idnotafiscal = 2557 and f0059idserie = '15' and f0002idestab = 1

4º Consultar dados da nota pelo NFE.
select * from CbanetNfe.. NotasFiscais
where chaveacesso = '52170803903500000121650150000025571172620080'

5º Inserir os dados acima que foi pego pelo site da sefaz.

update  PetrowayNfe.. NotasFiscais
set digestvalue = 'I2vCkuJT5o0q57S6HeCcsyyIcd4='
where chaveacesso = '52170803903500000121650150000025571172620080'