Post date: Apr 8, 2011 2:35:51 PM
COMANDO 1.
/*Identificar o numero da nota fiscal no sistema*/
select nota_fiscal from nota_fiscal_situacao where nota_fiscal in (select grid from nota_fiscal where numero_nota = 'NUM. NOTA'); /*NUMERO NOTA = Numero impresso no DANFe*/
COMANDO 2.
/*Identifica os CÓDIGOS DE SITUAÇÃO existentes no sistema*/
select * from nota_fiscal_tipo_situacao;
COMANDO 3.
/*SQL para alterar status*/
begin;
update nota_fiscal_situacao set situacao='COMANDO 2' where nota_fiscal = RESULTADO COMANDO 1;
commit;
ALTERAR MENSAGEM DE RETORNO
COMANDO 1.
/*Identifica os códigos de RETORNO existentes no sistema*/
select * from nfe_mensagem_retorno;
COMANDO 2.
/*Altera o código de retorno*/
update nfe set retorno = 'COMANDO 1' where nota_fiscal in (select grid from nota_fiscal where numero_nota = NUMERO NOTA); /*NUMERO NOTA = Numero impresso no DANFe*/
commit;
TAGs: nf-e aprovada rejeitado status