<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{308,132,1022,598}</property>
    <property name="Name">[sx_caixa.scr]</property>
    <property name="Caption">[Tesouraria: Entradas x Saidas]</property>
    <property name="AlwaysOnTop">.F.</property>
    <property name="AutoCenter">.T.</property>
    <property name="Font">
      <font name="Verdana" width="0" height="-13" weight="400"/>
    </property>
    <property name="FormType">[dlgModal]</property>
    <property name="Modal">.F.</property>
    <property name="ScopeVarObj">[Private]</property>
    <property name="lClipper">.T.</property>
    <property name="lExitOnEnter">.F.</property>
    <property name="lExitOnESC">.T.</property>
    <property name="FromStyle">[Center]</property>
    <property name="Clipsiblings">.F.</property>
    <property name="Clipchildren">.F.</property>
    <property name="TitleBar">.T.</property>
    <property name="StyleBorder">[3 - Sizable (Default)]</property>
    <property name="nBackColor">14215660</property>
    <property name="Icon">[]</property>
    <property name="Bitmap">[icon\tela.jpg]</property>
    <property name="NoIcon">.F.</property>
    <property name="SystemMenu">.T.</property>
    <property name="Minimizebox">.F.</property>
    <property name="Maximizebox">.T.</property>
    <property name="AbsAlignment">.T.</property>
    <property name="WindowState">[1 - Normal (Default)]</property>
    <property name="minHeight">-1</property>
    <property name="maxHeight">-1</property>
    <property name="minWidth">-1</property>
    <property name="maxWidth">-1</property>
    <property name="ScrollBars">[0 - None (Default)]</property>
    <property name="DSControl">.F.</property>
  </style>
  <method name="onDlgInit">
    <![CDATA[parameters oDlg

//skel VARIAVEL w_colsep = " "+chr(179)
//skel VARIAVEL Z_DATUAL = ctod("")
//skel VARIAVEL zCta    = "000"
//skel VARIAVEL zGrupoLan = " "
//---skel variavel zbZerarRegistro := {||_field->desc:=repl("0",len(desc)),_field->valor:=0,_field->data:=ctod(""),_field->datadig:=ctod(""),_field->cp_divisao:=0,_field->cp_subdiv:="00000", d_ob:RefreshLine(), RedrawWindow(d_ob:handle,12), Millisec(1000)}
//---- skel variavel zbZerarRegistro := {||_field->desc:=repl("0",len(desc)),_field->valor:=0,_field->data:=ctod(""),_field->datadig:=ctod(""),_field->cp_divisao:=0,_field->cp_subdiv:="00000", DbCommit(), D_oB:active:=.t., DobRefresh(), d_ob:RefreshLine(), RedrawWindow(d_ob:handle,12), Alert("Registro Zerado")}
//skel variavel zbZerarRegistro := {||_field->tipo:="0",_field->desc:=repl("0",len(desc)),_field->valor:=0,_field->data:=ctod(""),_field->cp_divisao:=0,_field->cp_subdiv:="00000", DbCommit(), D_oB:active:=.t., DobRefresh(), Alert("Registro Zerado e Excluido")}
//skel variavel zFiltro:=""
//skel variavel znDel:=0
//skel variavel zbDelSelecao:={|| DbGoTop(), DbEval({||++znDel, RegLock(),_field->tipo:="0",_field->desc:=repl("0",len(desc)),_field->valor:=0,_field->data:=ctod(""),_field->cp_divisao:=0,_field->cp_subdiv:="00000", DbDelete()}),DbCommit(),DbUnlock(), if(empty(zFiltro),NIL,DBSETFILTER( &("{||"+zFiltro+"}"),zFiltro)), DbGoTop(), DobRefresh(), Alert("Foram Zerados e Excluidos "+lTrim(Str(znDel,6))+" Registros!") }
d_ob:lEditable := .t.
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,'22;tb_insert(D_OB);Ins-Inclui ;Ins-Inclui;cadastrar.ico;;;;;Inclui;;;')
hwg_TbMt(oToolbar,'65;tb_update(D_OB);A-Altera ;A-Altera;alterar.ico;;;;;&A-Altera;;;')
hwg_TbMt(oToolbar,'7;tb_del(D_ob,,,,zbZerarRegistro);DEL-DELeta ;DEL-Deleta;deletar.ico;;;;;Deleta;;;')
hwg_TbMt(oToolbar,'80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')
hwg_TbMt(oToolbar,'79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;')
hwg_TbMt(oToolbar,'73;lst_alias(D_OB);I-Imprime ;I-Imprime;impressora.ico;;;;;&I-Imprime;;;')
hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,' 32;tb_cons();Barra-Exibe ;Barra-Exibe;sembitmap;;;Lucida Bright;-11;Exibe;;6;')
hwg_TbMt(oToolbar,' 13;doget(D_ob);Enter-Edita ;Enter - Edita;sembitmap;;;Lucida Bright;-11;Edita;;6;')
hwg_TbMt(oToolbar,' 61;doget(D_ob,,.t.);=-Repete_Edicao ;= - Repete_Edicao;sembitmap;;;Lucida Bright;-11;&=-Repete_Edicao;;6;')
hwg_TbMt(oToolbar,' 84;tb_locate(D_oB);T-Busca_Trecho ;T-Pesquisa Trecho na coluna do cursor;sembitmap;;;Lucida Bright;-11;&T-Trecho;;6;')
hwg_TbMt(oToolbar,' 76;tb_locate(D_oB);L-Busca_Iniciais ;L-Busca pelas Iniciais na coluna do cursor;sembitmap;;;Lucida Bright;-11;&L-Iniciais;;6;')
hwg_TbMt(oToolbar,' 67;tb_locate(D_oB);C-Repete_Busca ;C-Repete Busca na coluna do cursor;sembitmap;;;Lucida Bright;-11;&C-Continua;;6;')
hwg_TbMt(oToolbar,' 70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;6;')

hwg_TbMt(oToolbar,' 69;tb_filter(d_ob,"Exp",,.t.);E-Seleciona_Varios ;E-Seleciona Registros contendo expressao;sembitmap;;;Lucida Bright;-11;&E-Selecao;;6;')

hwg_TbMt(oToolbar,'90;if(zFiltro=dbFilter(),Alert("Voce deve primeiramente selecionar registros"),if(SimNao(24,0,"Confirma Zerar Registros da Selecao ?"," Sim "," Nao ",2,79),eVal(zbDelSelecao),Alert("Operacao nao Confirmada")) );Z-DELeta Selecao ;Z-Apaga toda a Selecao;sembitmap;;;Lucida Bright;-11;&Z-ZeraTodos;;6;')


SetDlgKey(oDlg,8,26,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"UP"))})
SetDlgKey(oDlg,8,28,{|| (aBrowses[nBrwAtivo,2])->(moveRec(aBrowses[nBrwAtivo,1],"DOWN"))})
Hwg_EndMenu()
if type("oDlgStatusBar")="B"
   oDlgStatusBar:Anchor:=14
endif

//sfgdebugalert:=.t.
if QuickDialog("SxCaixa", "Exibir lancamentos",{{"Conta da Tesouraria.:","@zCta",@zCta,"999","",""},{"Data dos Lancamentos:","@Z_DATUAL",@Z_DATUAL,"99.99.9999","",""},{"Tipo Lancamentos:","@zGrupoLan",@zGrupoLan,"9","",""}} )
   // debugalert('1 zFiltro ='+zFiltro )
   zFiltro := IF(VAL(zCta)>0,"sx_conta="+zCta,"")
   // debugalert('2 zFiltro ='+zFiltro )
   se DAY(z_datual)>0 entao zFiltro += IF(EMPTY(zfiltro),"",".and.") + "data=ctod('"+DTOC(z_datual)+"')"
   // debugalert('3 zFiltro ='+zFiltro )
   se .NOT. EMPTY(zGrupoLan) entao zFiltro += IF(EMPTY(zfiltro),"",".and.") + "grupo="+zGrupoLan
   // debugalert('4 zFiltro ='+zFiltro )
   // DbSetFilter( {||(val(zCta)=0.or.val(zCta)=sx_conta).and.(day(z_datual)=0.or.z_datual=data)}, "(val(zCta)=0.or.val(zCta)=sx_conta).and.(day(z_datual)=0.or.z_datual=data)")
   se .not. EMPTY(zFiltro) entao DBSETFILTER( &("{||"+zFiltro+"}"), zFiltro)
   // debugalert('5 zFiltro ='+zFiltro )
   dbsetorder(0)
   se VAL(zCta)>0 entao DBGOTOP() senao (DBGOBOTTOM(), DbSkip(-7))
ENDIF
// sfgdebugalert:=.f.
]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,568,1022,30}</property>
      <property name="Name">[oDlgStatusBar]</property>
      <property name="aParts">{608,152,0}</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,77,1000,458}</property>
      <property name="Name">[D_oB]</property>
      <property name="Anchor">15</property>
      <property name="font">
        <font name="Lucida Sans Unicode" width="0" height="-16" weight="400"/>
      </property>
      <property name="GridLinesSepColor">0</property>
      <property name="TabIndex">4</property>
    </style>
    <method name="onGetFocus">
      <![CDATA[nBrwAtivo:=1]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'Partida;sx_conta;N;999;7;S;')
hwg_TbFi(D_oB, '*;TIPO;C;x;  1;S;')
hwg_TbFi(D_oB, 'Descricao;DESC;C;@S31;31;S;')
hwg_TbFi(D_oB, 'Valor;VALOR;N;9999999.99; 10;S;')
hwg_TbFi(D_oB, 'DATA;DATA;D;;  8;S;')
hwg_TbFi(D_oB, 'Div;CP_DIVISAO;N;999;  3;S;')
hwg_TbFi(D_oB, 'ContraP;CP_COD_FOR;N;9999;7;S;')
hwg_TbFi(D_oB, 'SubD;cp_SUBDIV;C;xxxxx;5;S;')
hwg_TbFi(D_oB, 'Duplic;cp_duplic;C;@S10; 10;S;')
hwg_TbFi(D_oB, 'Gr;GRUPO;N;9; 1;S;')
hwg_TbFi(D_oB, 'Acesso;sx_ACESSO;N;999999;  6;N;')
hwg_TbFi(D_oB, 'DataDig;DATADig;D;;  8;N;')
hwg_TbFi(D_oB, 'HoraDig;horaDig;C;;  5;N;')
D_oB:bColorSel:= RGB(3,23,233)
D_oB:tColorSel:= RGB(255,255,255)
D_oB:Alias := alias()
D_oB:lDisableVScrollPos := .t.
D_oB:bKeyDown := {|self, wParam| (aBrowses[nBrwAtivo,2])->(hwg_oDlgKey(self, wparam,1)) , .T. }
D_oB:bOther:={|o,m,wp,lp| MessagesBrowse(o,m,wp,lp)}
D_oB:cargo:={.T.,.T.,"SX_CAIXA",.F.,.T.,{||.T.} }
sHwgKeyEdit:= 61
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{410,0,483,47}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Tesouraria: Entradas x Saidas]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-29" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
</part>
