<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{263,64,1021,598}</property>
    <property name="Name">[cr_recfx.scr]</property>
    <property name="Caption">[Lancamento de Receita Recorrente]</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 zAreaCrRecFx := Select("Cr_RecFx")
//skel VARIAVEL zbRec={||ABRA("0NOIDX",R_Siga,"CR_RECFX", "CR_RECFX"), DbSetFilter({||cr_valor>0},"cr_valor>0"), DbGoTop() }
//skel VARIAVEL zbCli={||ABRA("0NOIDX",R_Siga,"Sccrcli", "Sccrcli")}
//skel VARIAVEL zbMov={||Abra("0NOIDX",r_siga,"se_movnf","se_movnf","se_movnf","mfnum")}
//skel VARIAVEL zbProd={||Abra("0NOIDX",r_siga,"se_prod","se_prod","seip_c","pcod")}
//skel VARIAVEL zbFat={||Abra("0NOIDX",r_siga,"sf_fatnf","sf_fatnf","sffatnf2","pfnum")}
//skel VARIAVEL zbDup={||ABRA ("0NOIDX", r_siga, "SCCRDUP", "SCCRDUP", "SCRID_ND", "CR_NUM_PED")}
//skel VARIAVEL zBlkPrd = {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
//skel VARIAVEL zBlkClif = {|x_cli| sccrcli->(DbGoto(x_cli)),sccrcli->Cr_fantasi}
//skel VARIAVEL zBlkCli = {|x_cli| sccrcli->(DbGoto(x_cli)),sccrcli->Cr_nome}

//skel VARIAVEL zbReopenAll = {||DbCloseAll(), eVal(zbCli), eVal(zbProd), eVal(zbMov), eVal(zbFat), eVal(zbDup), eVal(zbRec) }
//skel VARIAVEL Z_NIL = eVal(zbReopenAll)

//skel COMANDO DEPOIS z_nil = Sccrcli->( DbCloseArea() )
//skel COMANDO DEPOIS z_nil = Se_movnf->( DbCloseArea() )
//skel COMANDO DEPOIS z_nil = Se_prod->( DbCloseArea() )

//skel VARIAVEL zbPrtRelat := {|| zrecn:=recno(), Relat('lst_exec("CR_RECFX")',"nb",,"X"), eVal(zbReopenAll), DbGoTo(zRecn) }
//skel VARIAVEL zbPrtGED := {|| zrecn:=recno(), Relat('lst_exec("CR_RECFX_GED")',"nb",,"X"), eVal(zbReopenAll), DbGoTo(zRecn) }
//skel VARIAVEL zbPrtGEDCli := {|| zrecn:=recno(), Relat('lst_exec("CR_RECFX_GED_CLI")',"nb",,"X"), eVal(zbReopenAll), DbGoTo(zRecn) }
//skel VARIAVEL zBlZ={||DbClearFilter(),DbGoTop(),D_ob:Refresh()}

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);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;eVal(zbPrtRelat);I-Conferente;I-Imprime o Conferente de Receitas Recorrentes;impressora.ico;;;;;&I-Conferente;;;')
hwg_TbMt(oToolbar,' 71;eVal(zbPrtGED);G-GED;G-Lista relacao de aditivos Digitalizados/Pendentes;impressora.ico;;;;;&G-GED;;;')
hwg_TbMt(oToolbar,' 72;eVal(zbPrtGEDCli);H-GEDCLI;G-Clientes com Autorizacoes de Fornecimento Digitalizados/Pendentes;impressora.ico;;;;;&h-GEDCLI;;;')

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,' 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,' 76;eVal(zBlZ);L-Todas ;L-Exibe todos os contratos, inclusive os ja devolvidos;sembitmap;;;Lucida Bright;-11;&L-Todos;;6;')

hwg_TbMt(oToolbar,' 76;Lanca_RecFx(cr_cod_cli,Fnum);B-Boleto ;B-Gera boleto referente a Re-Locacao Mensal;sembitmap;;;Lucida Bright;-11;&B-Boleto;;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('w_fcli')<>"U".AND.w_fcli>0 .and. !EMPTY(ORDKEY())
//   IF EMPTY(ORDKEY())
//      cr_recfx->(DBCLOSEAREA(), Abra (LTRIM(STR(zAreaCrRecFx,4))+"NOIDX",r_siga, "cr_recfx", "cr_recfx" , "cr_recfx", "str(cr_cod_cli,6)+str(fobra,3)+fgacumula+str(pcod,6)") )
//   endif
   DBSEEK( STR(w_fCli,6) )
ENDIF
]]>
  </method>
  <method name="onPaint">
    <![CDATA[Parameters oCtrl,hDC
oCtrl:bpaint:=NIL
D_oB:setFocus()]]>
  </method>
  <part class="status">
    <style>
      <property name="Geometry">{0,568,1021,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,211}</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="onPosChange">
      <![CDATA[ofObs:Refresh() 
oBrwItens:Refresh()
oBrwFat:Refresh()]]>
    </method>
    <method name="onInit">
      <![CDATA[hwg_TbFi(D_oB, 'Cli;Cr_COD_cli;N;999999;6;;')
hwg_TbFi(D_oB, 'Nome_Cli;eval(zBlkCli,cr_cod_cli);P;@s30;30;N;')
hwg_TbFi(D_oB, 'Obs;Cr_obs;C;@S20;20;;')
hwg_TbFi(D_oB, 'Valor;Cr_VALOR;N;99999.99;  8;;')
hwg_TbFi(D_oB, '%dReloc;fDscReloc;N;999.99%;7;;')
hwg_TbFi(D_oB, 'f;FgFixoVar;C;X;1;;')
hwg_TbFi(D_oB, 'Contrato;fnum;N;99999999;  8;;')
hwg_TbFi(D_oB, 'Dt_Inicial;Cr_dataini;N;99.99.9999;10;;')
hwg_TbFi(D_oB, 'Fantasia;eval(zBlkClif,cr_cod_cli);P;@s30;20;N;')
hwg_TbFi(D_oB, 'DEmis;CP_DIAEMIS;N;99;  5;;')
hwg_TbFi(D_oB, 'DVenc;CP_DIAVENC;N;99;  5;;')
hwg_TbFi(D_oB, 'Gr;GrupoCli;C;9;1;S;')
hwg_TbFi(D_oB, 'Rc;Cr_zona;N;99;  2;;')
hwg_TbFi(D_oB, 'PzVen;CP_PZ_VENC;N;99;  5;;')
hwg_TbFi(D_oB, "Obra;fobra;N;9999;4;S;")
hwg_TbFi(D_oB, "iObra;fobraNoCli;N;999;4;S;")
hwg_TbFi(D_oB, "iAditivo;fAditivo;N;999;4;S;")


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.,"CR_RECFX",.F.,.T.,{||.T.} }
sHwgKeyEdit:= 61
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})
]]>
    </method>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{607,0,286,47}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Aditivos Ativos]</property>
      <property name="Justify">[Right]</property>
      <property name="font">
        <font name="Arial" width="0" height="-37" weight="700"/>
      </property>
      <property name="Transparent">.T.</property>
      <property name="TabIndex">5</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{1020,296,338,236}</property>
      <property name="Name">[ofObs]</property>
      <property name="varName">[fObs]</property>
      <property name="Anchor">6</property>
      <property name="Multiline">.T.</property>
      <property name="TabIndex">6</property>
    </style>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{10,296,378,236}</property>
      <property name="Name">[oBrwItens]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-12" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[DbSelectArea( 'se_movnf' )
oBrwItens:Alias := 'se_movnf'
oBrwItens:bColorSel:= RGB(3,23,133)
oBrwItens:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwItens, 'Descricao;eVal(zBlkPrd,pcod);P;@S20;20;;')
hwg_TbFi(@oBrwItens, 'Quant;mQuant;N;999999;6;S;')
hwg_TbFi(@oBrwItens, 'Devol;mQdevol;N;999999;6;S;')
hwg_TbFi(@oBrwItens, 'Saldo;mQuant-mQdevol;P;999999;6;;')
hwg_TbFi(@oBrwItens, 'Prod;Pcod;N;999999;6;;;')
hwg_TbFi(@oBrwItens, 'Locacao;pValLoca;N;9999.99;7;;')
hwg_TbFi(@oBrwItens, 'Un;se_prod->pUNIDADE;P;XXX;3;;')
hwg_TbFi(@oBrwItens, 'VlIndeniz;mValor;N;999999.99;9;;')
hwg_TbFi(@oBrwItens, 'Barra;se_prod->pdic6;P;9999999999999;13;;')
hwg_TbFi(@oBrwItens, 'ST;se_prod->pCATEGORIA;P;XXX;3;;')
hwg_TbFi(@oBrwItens, 'NCM;se_prod->pcodclafis;P;99999999;8;;')
hwg_TbFi(@oBrwItens, 'l;mFgEs;C;X;1;;')
hwg_TbFi(@oBrwItens, '*;if(mTipoVen="C","Cancelado","");P;@S9;9;;')
// alert('vai definir filtros oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
oBrwItens:lFilter := .T.
oBrwItens:bFirst := {|| se_movnf->( DBSEEK( Cr_RecFx->fnum, .F. ) ) } 
oBrwItens:bLast  := {|| se_movnf->( DBSEEK( Cr_RecFx->fnum , .F., .T. ) ) }
oBrwItens:bWhile := {|| se_movnf->mfnum = Cr_RecFx->fnum }
oBrwItens:Refresh()
DbSelectArea( 'Cr_RecFx' )
// alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
]]>
    </method>
  </part>
  <part class="browse">
    <style>
      <property name="Geometry">{399,296,610,236}</property>
      <property name="Name">[oBrwFat]</property>
      <property name="Anchor">6</property>
      <property name="font">
        <font name="Arial" width="0" height="-12" weight="400"/>
      </property>
      <property name="Border">.F.</property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[DbSelectArea( 'sf_fatnf' )
oBrwFat:Alias := 'sf_fatnf'
oBrwFat:bColorSel:= RGB(3,23,133)
oBrwFat:tColorSel:= RGB(255,255,255)
hwg_TbFi(@oBrwFat, 'Fatura;fnum;N;999999;6;;;')
hwg_TbFi(@oBrwFat, 'Oper;if(FgDev="E","Devol",if(FgDev="R","Reloc",FgDev));P;@S5;5;;;')
hwg_TbFi(@oBrwFat, 'Valor;fValLoca;N;999999.99;9;;;')
hwg_TbFi(@oBrwFat, 'DtRef;fDataRef;D;99.99.99;8;S;;')
hwg_TbFi(@oBrwFat, 'Dias;pDiasLoca;N;9999;4;S;;')
hwg_TbFi(@oBrwFat, 'Referencia;Dtoc(fDataRet-pDiasLoca+1)+" a "+Dtoc(fDataRet);P;@S19;19;;')
hwg_TbFi(@oBrwFat, 'Duplicata;SccrDup->(IF(DBSEEK(STRZERO(sf_FatNf->fNumPed,6)),"Venc:"+DTOC(cr_dt_venc)+" Lqd:"+Dtoc(Cr_Dt_Lqd)+" ValDp:"+STR(Cr_Valor,10,2), "*Sem Duplicata/Cancelada*"));P;@S27;27;S;;')
hwg_TbFi(@oBrwFat, 'DtRetorno;fDataRet;D;99.99.99;8;S;;')
hwg_TbFi(@oBrwFat, 'Cliente;fCli;N;999999;6;S;;')
hwg_TbFi(@oBrwFat, 'NF_REF;pfnum;N;999999;6;;;')
hwg_TbFi(@oBrwFat, 'Sit;fg_fat;C;X;3;S;;')
hwg_TbFi(@oBrwFat, 'Op;fgdev;C;X;3;S;;')
hwg_TbFi(@oBrwFat, 'Emissao;fDataEmi;D;;8;;;')

oBrwFat:lFilter := .T.
oBrwFat:bFirst := {|| sf_fatnf->( DBSEEK( Cr_RecFx->fnum, .F. ) ) } 
oBrwFat:bLast  := {|| sf_fatnf->( DBSEEK( Cr_RecFx->fnum , .F., .T. ) ) }
oBrwFat:bWhile := {|| sf_fatnf->pfnum = Cr_RecFx->fnum }
oBrwFat:Refresh()
DbSelectArea( 'Cr_RecFx' )
// alert('definiu oBrwItens:alias '+oBrwItens:alias+' Sf_FatNf->fnum '+str(Sf_FatNf->fnum,6)+ ' oBrwItens:nColumns '+str(oBrwItens:nColumns,4) )
]]>
    </method>
  </part>
</part>
