;*******************************************************************************
;* Desenvolvido: 09/03/2020 por Kamila Gomes                                   *
;*******************************************************************************
Autolib="\\Sistemas\\Cadastro\\Bibliot,\\Sistemas\\Cadastro\\Bib_Show"

DATAM_DATA   = DateVal("29.02.2020")
DATAM_VERSAO = "2020.B"
 
DATAM_EXECUTA = "SYS_DATAM"
Play "\\Sistemas\\Cadastro\\EXEC_DAT"

If Not DATAM_EXECUTA 
   Then Exit
   Else DATAM_ROTINA  = "Estoque"
        DATAM_EXECUTA = "SYS_DATAM_MENSAGEM"
        Play "\\Sistemas\\Cadastro\\EXEC_DAT"
        If Not DATAM_EXECUTA
           Then Exit
        EndIf
EndIf 

;*******************************************************************************
;Rotina Corre‡Æo de Tabelas                                                    *
;*******************************************************************************
Proc Correcao_Tabelas_Estoque()

;* Desenvolvido: 03/02/2020 por Bruno Carvalho 
If IsTable("Iten_Tec")
   Then ok=False
        {Modify} {Restructure} {Iten_Tec}
        Moveto [Field Name]
        Locate "Importado"
        If Not RetVal
           Then End Down
                "Importado"  Enter  "A20" Enter
        EndIf
        Do_It!
        ClearAll        
        
        {Tools} {Copy} {JustFamily} TypeIn "\\Base\\Sistemas\\Estoque\\Iten_Tec" Enter TypeIn "Iten_Tec" Enter {Replace}
        {Tools} {Copy} {JustFamily} TypeIn "\\Base\\Sistemas\\Estoque\\Itens"    Enter TypeIn "Itens"    Enter {Replace}   
EndIf

EndProc ;Correcao_Tabelas_Estoque()
                                            
;*******************************************************************************
;Rotina Principal                                                              *
;*******************************************************************************
Aguarde("Atualizando Sistema")
Password("t01avivcl")
Password("FechaSys")

View "SysTable"
SYS_CODIGO_CLIENTE = [Codigo do Cliente]
ClearAll

;-------------------------------------------------------------------------------

DATAM_ROTINA   = "ESTOQUE"
DATAM_FECHAMES = ""
DATAM_EXECUTA  = "DATAM_SETDIR"
Play "\\Sistemas\\Cadastro\\EXEC_DAT" 

{Tools} {More} {Directory} {\\Sistemas\\Cadastro\\}

DATAM_EXECUTA  = "DATAM_SYSTABLE"
Play "\\Sistemas\\Cadastro\\EXEC_DAT" 

UnPassword("t01avivcl")
UnPassword("FechaSys")
LimpAguarde()
FastMsg("Fim da atualiza‡Æo !")

DATAM_EXECUTA  = "DATAM_RELEASE"
Play "\\Sistemas\\Cadastro\\EXEC_DAT"

Release Vars DATAM_EXECUTA      
