;** MDFE_DESF ******************************************************************
;*  Cancela/Desfaz Manifesto                                                   *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 08/04/2014 por Andrey Fillipe 
;Ultima Alteracao: 03/06/2016 por Anivel Augusto Rodrigues
;Motivo Alteracao: Ajustes DESFAZER        

;*******************************************************************************
;* Rotina p/ Desfazer ou Cancelar                                              *
;*******************************************************************************
Proc Desfaz_Cancela_encerra()

Switch
  Case TIPO="DESFAZER":
    ;; Manifesto
    Moveto "Mdfe_C"
    
    [Modelo do Documento   ] = ""
    [Numero do Documento   ] = ""
    [Serie do Documento    ] = ""
    [Docto Manifesto       ] = ""
    
    [Forma Emissao Manifesto]=""
    [Descricao Forma Emissao]=""
    [Chave Acesso Manifesto ]=""
    [Situacao               ]=""

  Case TIPO="CANCELAR":
    ;; Manifesto
    Moveto "Mdfe_C" 
    [Situacao                ]="C"
  Case TIPO="ENCERRAR":
    ;; Manifesto
    Moveto "Mdfe_C" 
    [Situacao                ]="E"  
EndSwitch

Do_It!

CoeditKey
Mensagem("Opera‡Æo Finalizada!")

EndProc ; Desfaz_Cancela_encerra()

;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************
UnLockRecord
KeyPress "F7"
IsLockRecord()

Desfaz_Cancela_encerra()

KeyPress "F7"
UnLockRecord

Release Vars TIPO
             
Release Procs Desfaz_Cancela_encerra