;**          *******************************************************************
;*  Manutencao c/ Filtro/Todos                                                 *
;*******************************************************************************
;Autor           : Vise Informatica (VISERP)
;Desenvolvido    : 05/12/2008 por Anivel Augusto Rodrigues
;Ultima Alteracao:   /  /     por
;Motivo Alteracao:


;*******************************************************************************
;* Rotina                                                                      *
;*******************************************************************************
Proc SD_Dialog(Disparo,Campo,Evento,Elemento)
Temp=True
TECLA    =""
MSG_CAMPO=""
If Disparo="OPEN"  Then AoCriarShowDialog() EndIf
If Disparo="EVENT" And Evento["Type"]="KEY" Then
   Switch
     Case Evento["KeyCode"] = -59: Dialog_F1()
     Case Evento["KeyCode"] =  27:
          Temp=False
          Switch
            Case Campo="TG_EMPRESA"       : Campo="NO"
            Case Campo="YES" Or Campo="NO": Campo="TG_EMPRESA"
          EndSwitch
     Case (Evento["KeyCode"] <= -104 And Evento["KeyCode"] >= -113) Or 
           Evento["KeyCode"]  = -139 Or  Evento["KeyCode"]  = -140:
           SYS_TECLA_ACIONADA=Evento["KeyCode"]
           Seta_Tecla_Acionada()
           CancelDialog
     Case Evento["KeyCode"] = 13:
          Temp=False
          If Checa_TAG()
             Then Switch
                    Case Campo="TG_EMPRESA"       : Campo="YES"
                  EndSwitch
          EndIf
          RefreshDialog
   EndSwitch
EndIf
Switch
  Case Campo="":
       MSG_CAMPO=""
EndSwitch
Monta_Prompt(MSG_CAMPO,TECLA)
Return Temp
EndProc

;*******************************************************************************
;* ROTINA PRINCIPAL                                                            *
;*******************************************************************************
AutoLib="\\Sistemas\\Cadastro\\Bib_Show,\\Sistemas\\Cadastro\\Bibliot"
LimpAguarde()

VSDGEMPRESA   =""
VSDGCONTA     =""
VSDGNCARREG   =""


VSDGDTINI     =BlankDate()
VSDGDTFIM     =BlankDate()
VSDGTPPAGTO   =""
VSDGREPRESEN  =""
VSDGCOBRADOR  =""

While True

  ShowDialog "Filtro p/ Tˇtulos a Receber" Proc "SD_Dialog"
  Trigger "OPEN","ARRIVE"
  Key "F1","ENTER","ESC",
      -104, -105, -106, -107, -108, -109, -110, -111, -112, -113, -139, -140  
   @ 00,00   Height 21 Width 75

    Label  @ 00,00 "Empresa"  For "TG_EMPRESA"
    Accept @ 01,01 Width 07 "A4"  Picture "[&,#][#*#]" Tag "TG_EMPRESA" To VSDGEMPRESA
    Accept @ 01,09 Width 23 "A20" Picture "!*!" Tag "TG_NOMEMP" To VSDGNOMEMP

    Label  @ 00,35 "Conta"  For "TG_CONTA"
    Accept @ 01,36 Width 07 "A4"  Picture "#*#" Tag "TG_CONTA" To VSDGCONTA
    Accept @ 01,44 Width 28 "A20" Picture "!*!" Tag "TG_NOMCONT" To VSDGNOMCONTA

;-------------------------------------------------------------------------------
    Label  @ 02,00 "Cliente"  For "TG_DESTINAT"
    Accept @ 03,01 Width 07 "A4"  Picture "[&,#][#*#]" Tag "TG_DESTINAT" To VSDGDESTINAT
    Accept @ 03,09 Width 23 "A20" Picture "!*!" Tag "TG_NOMCLI" To VSDGNOMDEST

    Label  @ 02,35 "Representante"  For "TG_REPRESEN"
    Accept @ 03,36 Width 07 "A4"  Picture "[&,#][#*#]" Tag "TG_REPRESEN" To VSDGREPRESEN
    Accept @ 03,44 Width 28 "A20" Picture "!*!" Tag "TG_NOMREPR"  To VSDGNOMREPR
;-------------------------------------------------------------------------------
    Label  @ 08,00 "Tipo do Documento"  For "TG_TPDOCTO"
    Accept @ 09,01 Width 07 "A4"  Picture "!*!" Tag "TG_TPDOCTO" To VSDGTPDOCTO
    Accept @ 09,09 Width 16 "A14" Picture "!*!" Tag "TG_NOMTPDOCTO"  To VSDGNOMTPDOCTO

    Label  @ 08,25 "Tipo de Carteira"  For "TG_TPCART"
    Accept @ 09,26 Width 03 "A1"  Picture "!" Tag "TG_TPCART"  To VSDGTPCART
    Accept @ 09,30 Width 18 "A16" Picture "!*!" Tag "TG_NOMCART" To VSDGNOMCART

    Label  @ 08,48 "Forma de Pagamento"  For "TG_TPPAGTO"
    Accept @ 09,49 Width 05 "A2"  Picture "!*!" Tag "TG_TPPAGTO"    To VSDGTPPAGTO
    Accept @ 09,52 Width 16 "A14" Picture "!*!" Tag "TG_NOMTPPG"    To VSDGNOMTPPAGTO
;-------------------------------------------------------------------------------
    Label  @ 12,00 "Datas "  For "TG_OPDT"
    RadioButtons @ 12,07 Height 3 Width 27
     "~E~miss„o",
     "~V~encto",
     "~P~agto",
     "~I~nclus„o",
     "~D~esprezar"
     Tag "TG_OPDT"
     To VSDGOPDT

    Label  @ 15,00 "Perˇodo Referente " For "TG_DTINI"
    Label  @ 16,00 "de " For "TG_DTINI"
    Accept @ 16,04 Width 13 "D"  Picture "#[#];.##;.##[##]" Tag "TG_DTINI" To VSDGDTINI
    Label  @ 16,17 "at‚" For "TG_DTFIM"
    Accept @ 16,22 Width 13 "D"  Picture "#[#];.##;.##[##]" Tag "TG_DTFIM" To VSDGDTFIM

    Label  @ 12,35 "N§ Carregamento" For "TG_NCARREG"
    Accept @ 13,36 Width 9  "A6"  Picture "#*#" Tag "TG_NCARREG"    To VSDGNCARREG
    Accept @ 13,42 Width 29 "A20" Picture "!*!" Tag "TG_NOMNCARREG" To VSDGNOMNCARREG

    Label  @ 13,35 "Usuario"  For "TG_CHAPA"
    Accept @ 14,36 Width 07 "A4"  Picture "#*#" Tag "TG_CHAPA"     To VSDGCHAPA
    Accept @ 14,43 Width 23 "A20" Picture "!*!" Tag "TG_NOMCHAPA"  To VSDGNOMCHAPA

    Pushbutton @ 18,25 width 11 "~O~k"      OK     Default Value "Ok" Tag "YES" To BottonValue
    Pushbutton @ 18,39 width 11 "~C~ancela" CANCEL                    Tag "NO"  To BottonValue

  EndDialog
  If Not RetVal Then QuitLoop EndIf





EndWhile
ClearAll
Release Vars All
Release Procs All
