;** Rm_1511D *******************************************************************
;* Acerto Remessa/Industrializacao II                                          *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 24/07/2020 por Anivel Augusto Rodrigues
;Ultima Alteracao:   /  /     por 
;Motivo Alteracao: 

;*******************************************************************************
;* Data de Acerto                                                              *
;*******************************************************************************
Proc RM_1511D_Data_Acerto()
Private NUMDOCACERTO, SERIEDOCACERTO, CODEMPACERTO

Do_It!
ClearAll

View "NotaC"
Coedit Tabela

Scan
  CODEMPACERTO  =[Codigo da Empresa  ]
  NUMDOCACERTO  =[Numero do Documento]
  SERIEDOCACERTO=[Serie do Documento ]
  
  Moveto "NotaC" 
  Moveto [Codigo da Empresa]
  Locate CODEMPACERTO, NUMDOCACERTO, SERIEDOCACERTO 
  If RetVal
     Then while islockrecord() endwhile
          [Data de Acerto]=VSDGDTREFERENTE
          unlockrecord
  EndIf
  
  Moveto Tabela  
EndScan
Do_It!
ClearAll

EndProc ;Data_Acerto()

;*******************************************************************************
;* Processo p/ gerar a comiss„o liquida no contas a pagar                      * 
;*******************************************************************************
Proc RM_1511D_Atualiza_Acerto()

TELA = 3

VSDGDTREFERENTE=BlankDate()                              
Echo Normal
Echo Off
While True
  ShowDialog "Informe a Data de Finaliza‡Æo/Acerto" Proc "SD_Dialog"
    Trigger "OPEN","ARRIVE"
    Key "F1","ENTER","ESC","TAB",
      -104, -105, -106, -107, -108, -109, -110, -111, -112, -113, -139, -140
     @ 05,12   Height 06 Width 77
                        
      Label  @ 00,00 "Data Referente: " For "TG_DATAREFERENTE"
      Accept @ 00,18 Width 13 "D"  Picture "#[#];.##;.##[##]" Tag "TG_DATAREFERENTE" To VSDGDTREFERENTE
     
      Pushbutton @ 02,22 width 11 "~O~k"      OK     Default Value "Ok" Tag "YES" To BottonValue
      Pushbutton @ 02,36 width 11 "~C~ancela" CANCEL                    Tag "NO"  To BottonValue   
     
    EndDialog                    
    If Not RetVal 
       Then Return False
    EndIf   

   If VSDGDTREFERENTE<>BlankDate()
      Then RM_1511D_Data_Acerto()
           Mensagem("Opera‡Æo Realizada!")
   EndIF
   QuitLoop
EndWhile

Return True
            
TELA = 1

Return True
                          
EndProc ;Atualiza_Acerto()

;*******************************************************************************
;* Rotina Principal                                                            *
;*******************************************************************************

RM_1511D_Atualiza_Acerto()
  
Release Procs RM_1511D_Data_Acerto, RM_1511D_Atualiza_Acerto
