<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{160,114,1022,598}</property>
    <property name="Name">[sccrdup_selfat.scr]</property>
    <property name="Caption">[Duplicatas dos Clientes]</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[//skel VARIAVEL w_colsep=" "+chr(179)
//skel VARIAVEL znil=__SetCentury("on")
//skel VARIAVEL zbCor=" "
//skel VARIAVEL zbCli={|nCodCli|sccrcli->(DbGoto(nCodCli),cr_nome)}
//skel VARIAVEL zFgCliClosed := (Select("SCCRCLI")=0)
//skel VARIAVEL zFgProdClosed := (Select("SE_PROD")=0)
//skel VARIAVEL zFgMovClosed := (Select("SE_MOVNF")=0)
//skel VARIAVEL znAzul0:=16711680
//skel VARIAVEL znAzul1:=10027008
//skel VARIAVEL zAzul2:=16776960
//skel VARIAVEL zW:=16777215
//skel VARIAVEL zBlack:=0
//skel VARIAVEL zRed:=255
//skel VARIAVEL zGreen:=32768
//skel VARIAVEL znCinza:=8421504
//skel VARIAVEL zYellow:=65535
//skel VARIAVEL zRecno := Recno()
//skel VARIAVEL zFgUsaCores:=(xGetEnv("USA_CORES_NO_BROWSE")<>"N")
//skel VARIAVEL zBlkPrd := {|nPcod| se_prod->(dbseek(nPcod)), se_prod->pdesc }
//skel VARIAVEL zBfVencidas:={||DbSetFilter({||day(cr_dt_lqd)=0.and.cr_dt_venc<s_datual},"day(cr_dt_lqd)=0.and.cr_dt_venc<s_datual"),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zBfHoje:={||DbSetFilter({||day(cr_dt_lqd)=0.and.cr_dt_venc=s_datual},"day(cr_dt_lqd)=0.and.cr_dt_venc=s_datual"),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zBfLocacao:={||DbSetFilter({||'RR NFS'$cr_obs},"'RR NFS'$cr_obs"),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zBfTodas:={||DbClearFilter(),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
//skel VARIAVEL zbObra={||vb_pref->(DbGoTo(_dupls->fObra),cr_fantasi)}
//skel variavel z1BOpenAll:=#TEXTO_FONTE
//skel    se select('vb_pref')=0 entao Abra ('0NOIDX',r_siga, 'vb_pref','vb_pref')
//skel    se select('se_prod')=0 entao Abra ("0NOIDX",r_siga, "se_prod", "se_prod", "seip_c", "pcod")
//skel    se select('sccrcli')=0 entao Abra ("0NOIDX",r_siga, "sccrcli","sccrcli")
//skel    se select('se_movnf')=0 entao Abra ('0NOIDX', r_siga, SE_MOV, 'SE_MOVNF', Seim_p, 'FNUMPED') 
//skel            //Abra ("0NOIDX",r_siga,"se_movnf","se_movnf","se_movnf","mfnum")
//skel    DbSelectArea("_dupls")
//skel    DbGoTo( zRecno )
//skel #FIM_TEXTO_FONTE
//skel variavel znil = eVal( z1BOpenAll )
//skel comando saida #TEXTO_FONTE
//skel     se zFgCliClosed entao sccrcli->(DbCloseArea())
//skel     se zFgProdClosed entao se_prod->(DbCloseArea())
//skel     se zFgMovClosed entao se_movnf->(DbCloseArea())
//skel #FIM_TEXTO_FONTE
oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,'80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;')
d_ob:lEditable = .t.
hwg_TbMt(oToolbar,'79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;')
hwg_Btn(oToolbar,10,544,70,24)
hwg_TbMt(oToolbar,'13;doget(D_ob);Enter-Edita ;Enter - Edita;sembitmap;;;Lucida Bright;-11;Edita;;6;')
hwg_TbMt(oToolbar,'70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;6;')
hwg_TbMt(oToolbar,'92;PrtBordero("RTF", , , "carne.rtf");\-Carnes_rtf ;\ - Carnes_rtf;sembitmap;;;Lucida Bright;-11;&\-Carnes_rtf;;6;')
hwg_TbMt(oToolbar,'74;PrtBordero("PDF", , , "duplicata.pdf");J-BOLETOS_pdf ;J - BOLETOS_pdf;sembitmap;;;Lucida Bright;-11;&J-BOLETOS_pdf;;6;')
hwg_TbMt(oToolbar,'86;Eval(zBfVencidas);V-Vencidas;V - Exibe apenas titulos VENCIDOS;sembitmap;;;Lucida Bright;-11;&V-Vencidas;;6;')
hwg_TbMt(oToolbar,'47;PrtBordero("RTF", , , "duplicata.rtf" );/-Duplicatas_rtf ;/ - Duplicatas_rtf;sembitmap;;;Lucida Bright;-11;&/-Duplicatas_rtf;;6;')
hwg_TbMt(oToolbar,'72;Eval(zBfHoje);H-Para Hoje;H - Exibe apenas titulos para HOJE;sembitmap;;;Lucida Bright;-11;&H-Hoje;;6;')
hwg_TbMt(oToolbar,'32;cp_confere(d_ob,.t.);Barra-Exclui_da_Fatura ;Barra - Exclui_da_Fatura;sembitmap;;;Lucida Bright;-11;Exclui_da_Fatura;;6;')
hwg_TbMt(oToolbar,'84;Eval(zBfTodas);T-Todos;H - Exibe todos os Titulos;sembitmap;;;Lucida Bright;-11;&T-Todos;;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
oBrwIt:Refresh()

oDlg:Maximize()]]>
  </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,76,1000,255}</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[oBrwIt:Refresh()]]>
    </method>
    <method name="onInit">
      <![CDATA[   hwg_TbFi(D_oB, '*;Cp_Status;C;x;1;S;')
   hwg_TbFi(D_oB, 'Dt Venc;CR_DT_VENC;D;99/99/9999; 10;S;')
   hwg_TbFi(D_oB, 'Val Emis;CR_VALOR;N;9999999.99; 10;N;')
   hwg_TbFi(D_oB, 'CFOP;CR_CFOP;C;XXXXIF5;N;')
   hwg_TbFi(D_oB, 'TipoDoc;SxNomeFormaPag(CR_TIP_DUP);C;@S8;8;N;')
   hwg_TbFi(D_oB, 'Dt Emis;CR_DT_EMIS;D;99/99/9999; 10;N;')
   hwg_TbFi(D_oB, 'NFs;fnum;N;999999;6;N;')
   IF sys_segmento='locacao'
      hwg_TbFi(D_oB, 'Frete NF;fValFrete;N;9999999.99; 10;N;')
      hwg_TbFi(D_oB, 'Obra;fObra;N;999999;6;S;')
      hwg_TbFi(D_oB, 'iObra;fObraNoCli;N;999;7;S;')
      hwg_TbFi(D_oB, 'NomeObra;eVal(zbObra);P;@S25;25;S;')
      hwg_TbFi(D_oB, 'CFOP;cr_cfop+"-"+if(left(cr_cfop,1)$"12","DEVOL",if(left(cr_cfop,3)="5.9","LOCACAO","VENDA"));P;@s13;13;N;')
   endif
   hwg_TbFi(D_oB, 'Dt Lqd;CR_DT_LQD;D;99/99/9999; 10;N;')
   hwg_TbFi(D_oB, 'Cli;CR_COD_CLI;N;999999;6;N;')
   if zFgUsaCores
      zbCor:={||IF(DAY(cr_dt_lqd)=0,IF(cr_dt_venc<s_datual,{zRed,zW,zW,zRed},if(cr_dt_venc=s_datual,{znAzul0,zW,zW,znAzul0},{zBlack,zW,zW,zBlack})),{zGreen,zW,zW,zGreen})}
      hwg_TbFi(D_oB, 'NomeCli;eVal(zbCli,CR_COD_CLI);P;@S25;25;N;zbCor;')
   ELSE
      hwg_TbFi(D_oB, 'NomeCli;eVal(zbCli,CR_COD_CLI);P;@S25;25;N;;')
   ENDIF
   hwg_TbFi(D_oB, 'Val Lqd;CR_VAL_LQD;N;9999999.99; 10;N;')

   hwg_TbFi(D_oB, 'Controle;fNumPed;N;999999999;9;N;')
   hwg_TbFi(D_oB, 'NumDp;CR_NUM_PED;C;@S9;9;N;')
   hwg_TbFi(D_oB, 'NumFec;Si_NumFech;N;999999;6;N;')
   hwg_TbFi(D_oB, 'Obs;CR_OBS;C;@S15; 15;S;')
   hwg_TbFi(D_oB, 'Td;CR_TIP_DUP;C;!!;  2;N;')
   hwg_TbFi(D_oB, 'Cxa;Si_Caixa;N;999;3;N;')
   hwg_TbFi(D_oB, 'Dt Chq;CR_DT_DOC;D;99/99/9999; 10;S;')
   hwg_TbFi(D_oB, 'ChqCrt;CR_NUM_DOC;N;999999;  6;S;')
   hwg_TbFi(D_oB, 'CtoBco;banco;N;999999;  6;S;')
   hwg_TbFi(D_oB, 'Cx;si_caixa;N;99;  2;N;')
   hwg_TbFi(D_oB, 'L;CR_TIP_LQD;C;x;  1;N;')
   hwg_TbFi(D_oB, 'J;CR_HA_JURO;C;x;  1;N;')
   hwg_TbFi(D_oB, 'Descont;CR_DESCONT;N;9999999.99; 10;N;')
   hwg_TbFi(D_oB, 'Vd;CR_ZONA;C;xx;  2;N;')
   hwg_TbFi(D_oB, 'S;CR_SITUAC;C;x;  1;N;')
   hwg_TbFi(D_oB, 'Pr;CR_LOCAL;C;xx;  2;N;')
   hwg_TbFi(D_oB, 'Dt Ger;CR_DATA;D;;  8;N;')
   hwg_TbFi(D_oB, 'Hora Ger;CR_HORA;C;@S8;  8;N;')
   hwg_TbFi(D_oB, 'Us;CR_USUARIO;N;9;  1;N;')
   hwg_TbFi(D_oB, 'NumFec;Si_NumFech;N;999999;6;N;')
   hwg_TbFi(D_oB, 'Cxa;Si_Caixa;N;999;3;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.,"SCCRDUP",.F.,.T.,{||.T.} }
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">[Duplicatas dos Clientes]</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="browse">
    <style>
      <property name="Geometry">{11,334,1003,193}</property>
      <property name="Name">[oBrwIt]</property>
      <property name="Anchor">14</property>
      <property name="font">
        <font name="Arial" width="0" height="-13" weight="400"/>
      </property>
      <property name="TabIndex">6</property>
    </style>
    <method name="onInit">
      <![CDATA[oBrwIt:Alias := 'se_movnf'
oBrwIt:bColorSel:= RGB(3,23,133)
oBrwIt:tColorSel:= RGB(255,255,255)
DbSelectArea( 'se_movnf' )
hwg_TbFi(@oBrwIt, 'Prod;pCod;N;999999;6;;')
hwg_TbFi(@oBrwIt, 'Descricao;eVal(zBlkPrd,pCod);C;@S35;35;;')

hwg_TbFi(@oBrwIt, '*;if(mfges="S","Locacao",if(mfges="M","Relocacao",if(mfges="E","Devolucao",mfges)));P;@S15;15;;')

hwg_TbFi(@oBrwIt, 'Quant;mQuant+if(mfges="S",0,mqDevol);P;999999;6;;')
hwg_TbFi(@oBrwIt, 'Devolvida;mqDevol;N;999999;9;S;')

hwg_TbFi(@oBrwIt, 'Aditivo;mfnum;N;9999999999;10;N;')

hwg_TbFi(@oBrwIt, 'PrUnLocMes;pValLoca;N;999999.99;11;;')
hwg_TbFi(@oBrwIt, 'VlTotMes;mQuant*pValLoca;P;999999999.99;12;;')

hwg_TbFi(@oBrwIt, 'VlUnitIndnz;mValor/mQuant;P;999999999.99;12;;')
hwg_TbFi(@oBrwIt, 'VlTotIdnz;mValor;N;999999999.99;12;;')
hwg_TbFi(@oBrwIt, 'Dias1aLoca;pDiasLoca;N;999;13;;')

oBrwIt:lFilter := .T.
oBrwIt:bFirst := {|| se_movnf->( DBSEEK( _dupls->fNum, .F. ) ) } 
oBrwIt:bLast  := {|| se_movnf->( DBSEEK( _dupls->fNum, .F., .T. ) ) }
oBrwIt:bWhile := {|| se_movnf->mfNum = _dupls->fNum}

oBrwIt:Refresh()   
DBSELECTAREA( '_dupls' )
]]>
    </method>
  </part>
</part>
