<?xml version="1.0" encoding="UTF-8"?>
<part class="form">
  <style>
    <property name="Geometry">{294,62,1022,598}</property>
    <property name="Name">[sccrdup_cli1.scr]</property>
    <property name="Caption">[Compras do Cliente]</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 ztEmi:=0
//skel VARIAVEL ztVc:=0
//skel VARIAVEL ztAv:=0
//skel VARIAVEL ztJurosMulta:=0
//skel VARIAVEL ztSelEmi:=0
//skel VARIAVEL ztSelVc:=0
//skel VARIAVEL ztSelAv:=0
//skel VARIAVEL ztSelJurosMulta:=0
//skel VARIAVEL zbSel:={||_field->fg_fat:="S", ztSelEmi+=cr_saldo, ztSelJurosMulta+=cr_juros, ztSelVc+=if(cr_dt_venc<s_datual,cr_saldo,0), ztSelAv+=if(cr_dt_venc>=s_datual,cr_saldo,0) , RefreshGetList(), d_ob:Refresh() } 
//skel VARIAVEL zbUnSel:={||_field->fg_fat:=" ", ztSelEmi-=cr_saldo, ztSelJurosMulta-=cr_juros, ztSelVc-=if(cr_dt_venc<s_datual,cr_saldo,0), ztSelAv-=if(cr_dt_venc>=s_datual,cr_saldo,0) , RefreshGetList(), d_ob:Refresh() } 

//skel VARIAVEL zbCor = ""
//skel VARIAVEL znAzul0:=16711680
//skel VARIAVEL znAzul1:=10027008
//skel VARIAVEL zAzul2:=16776960
//skel VARIAVEL zWhite:=16777215
//skel VARIAVEL zBlack:=0
//skel VARIAVEL zRed:=255
//skel VARIAVEL zGreen:=32768
//skel VARIAVEL znCinza:=8421504
//skel VARIAVEL zYellow:=65535
//skel VARIAVEL zW:=16777215

//skel VARIAVEL zCorVc := {zRed,zWhite,zWhite,zRed}
//skel VARIAVEL zCorHoje:= {znAzul0,zWhite,zWhite,znAzul0}
//skel VARIAVEL zCorAv:= {8388736,zWhite,zWhite,8388736}
//skel VARIAVEL zCorQtOk:={zGreen,zWhite,zWhite,zGreen}
//skel VARIAVEL zCorBloqueados:={zWhite,zBlack,zYellow,zBlack}

//skel VARIAVEL znil := __SetCentury("on")
//skel VARIAVEL zbCor := {||IF(cr_dt_venc<s_datual,zCorVc, if(cr_dt_venc>s_datual,zCorAv,{d_ob:tcolor,d_ob:bcolor,D_oB:tColorSel,D_oB:bColorSel}) )}
//skel VARIAVEL zbSoAbertas := {|| m_fcli=cr_cod_cli.and.!left(Cr_num_ped,2)$"/CX/CZ/".and.cr_dt_venc<s_datual}
//skel VARIAVEL zbTodas := {|| m_fcli=cr_cod_cli.and.!left(Cr_num_ped,2)$"/CX/CZ/"}
//skel VARIAVEL zbFiltraAbertas := {|| DbSetFilter(zbSoAbertas, "m_fcli=cr_cod_cli"), if(sGuiMode, d_ob:Top(), D_oB:goTop())}
//skel VARIAVEL zbFiltraTodas := {|| DbSetFilter(zbTodas, "m_fcli=cr_cod_cli"), if(sGuiMode, d_ob:top(), D_oB:goTop()) }

//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 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(_DUPLCLI->fObra),cr_fantasi)}

//skel comando saida #TEXTO_FONTE
//skel     se zFgCliClosed entao sccrcli->(DbCloseArea())
//skel     se zFgProdClosed .and. select('se_prod')>0 entao se_prod->(DbCloseArea())
//skel     se zFgMovClosed .and. select('se_movnf')>0  entao se_movnf->(DbCloseArea())
//skel #FIM_TEXTO_FONTE

//skel variavel zbPrtBordCob:=#TEXTO_FONTE
//skel     Private zRecno:=Recno()
//skel     Relat('lst_exec("BORDCOB01")',"nb",,"X")
//skel     DbCloseAll()
//skel     Use ('mem:_duplcli') Alias _DuplCli New Exclusive
//skel     DbGoTo(zRecno)
//skel     DobRefresh()
//skel #FIM_TEXTO_FONTE

_DUPLCLI->( DBEVAL({|| _field->fg_fat:=' ',ztEmi+=cr_saldo, ztJurosMulta+=cr_juros, ztVc+=if(cr_dt_venc<s_datual,cr_saldo,0), ztAv+=if(cr_dt_venc>=s_datual,cr_saldo,0) } , DBGOTOP() ), RefreshGetList() )

d_ob:lEditable = .t.

oContextMenu:=Hwg_ContextMenu()
hwg_Btn(oToolbar,5,5,64,64)
hwg_TbMt(oToolbar,'13;if(fg_fat=" ",eVal(zbSel), eVal(zbUnSel));Enter-Seleciona;Enter-Seleciona;;;;Lucida Bright;-11;Seleciona;;;')
hwg_TbMt(oToolbar,'73;eval(zbPrtBordCob);I-Imprime ;I - Imprime;impressora.jpg;;;Lucida Bright;-11;&I-Imprime;;;')
// hwg_TbMt(oToolbar,' 32;if(fg_fat=" ",eVal(zbSel), eVal(zbUnSel));Barra-Seleciona;Barra - Seleciona;sembitmap;;;Lucida Bright;-11;Seleciona;;6;')
// 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_Btn(oToolbar,10,544,70,24)
//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-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,' 92;PrtBordero("RTF", , , "carne.rtf");\-Carnes_rtf ;\ - Carnes_rtf;sembitmap;;;Lucida Bright;-11;&\-Carnes_rtf;;6;')
hwg_TbMt(oToolbar,' 65;eVal(zbFiltraAbertas);V-Vencidas ;V- Exibe apenas titulos Vencidos;sembitmap;;;Lucida Bright;-11;&V-Vencidas;;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,' 47;eVal(zbFiltraTodas);/-Todas ;/ - Todas;sembitmap;;;Lucida Bright;-11;&/-Todas;;6;')
//hwg_TbMt(oToolbar,' 72;PrtBordero("HTM", , , "duplicata.htm");H-BOLETOS_Html ;H - BOLETOS_Html;sembitmap;;;Lucida Bright;-11;&H-BOLETOS_Html ;6;6;')
//hwg_TbMt(oToolbar,' 47;PrtBordero("RTF", , , "duplicata.rtf" );/-Duplicatas_rtf ;/ - Duplicatas_rtf;sembitmap;;;Lucida Bright;-11;&/-Duplicatas_rtf;;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()

//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">{11,99,1000,433}</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, '*;fg_fat;C;x;1;N;')

hwg_TbFi(D_oB, 'Cupom;cr_num_ped;C;999999xx;  8;N;')
hwg_TbFi(D_oB, 'Vd;cr_zona;C;99;  2;N;')
hwg_TbFi(D_oB, 'Vencto;cr_dt_venc;D;; 10;N;')
hwg_TbFi(D_oB, 'Correcao;cr_juros;P;@E 999,999.99; 10;S;')
hwg_TbFi(D_oB, 'Vl.Principal;cr_Valor;N;@E 999,999.99; 10;N;')
hwg_TbFi(D_oB, 'Vl.Atual;cr_saldo;N;@E 999,999.99; 10;S;')
hwg_TbFi(D_oB, 'Adiant/Lqd;cr_Val_lqd;N;@E 999,999.99; 10;S;')
hwg_TbFi(D_oB, 'Emissao;cr_dt_emis;D;; 10;N;')

   IF sys_segmento='locacao'
      hwg_TbFi(D_oB, 'NFs;fnum;N;999999;6;N;')
      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;')
      hwg_TbFi(D_oB, 'Controle;fNumPed;N;999999999;9;N;')
   else
      hwg_TbFi(D_oB, 'CFOP;CR_CFOP;C;XXXXX;5;N;')
   endif

hwg_TbFi(D_oB, 'TipoDoc;SxNomeFormaPag(CR_TIP_DUP);C;@S8;8;N;')
hwg_TbFi(D_oB, 'Dt Lqd;cr_dt_lqd;D;; 10;S;')
hwg_TbFi(D_oB, 'Hora;cr_hora;C;99:99;5;N;')
hwg_TbFi(D_oB, 'Obs;cr_obs;C;@s25;25;S;')
hwg_TbFi(D_oB, 'Cli;CR_COD_CLI;N;999999;6;N;')
hwg_TbFi(D_oB, 'Usuario;cr_usuario;C;@s8;8;N;')
hwg_TbFi(D_oB, 'Td;CR_TIP_DUP;C;!!;  2;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, '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, '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, '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.,"_DUPLCLI",.F.,.T.,{||.T.} }
AADD(aBrowses,{D_oB,D_oB:Alias,{||.f.},{|| .T.},})]]>
    </method>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{444,0,103,22}</property>
      <property name="Name">[oztEmi]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztEmi]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{444,22,103,22}</property>
      <property name="Name">[oztVc]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztVc]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{444,67,103,22}</property>
      <property name="Name">[oztJurosMulta]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztJurosMulta]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{759,0,103,22}</property>
      <property name="Name">[oztSelEmi]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztSelEmi]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{759,22,103,22}</property>
      <property name="Name">[oztSelVc]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztSelVc]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{759,44,103,22}</property>
      <property name="Name">[oztSelAv]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztSelAv]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{444,44,103,22}</property>
      <property name="Name">[oztAv]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztAv]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="editbox">
    <style>
      <property name="Geometry">{759,67,103,22}</property>
      <property name="Name">[oztSelJurosMulta]</property>
      <property name="_InitValue">[0]</property>
      <property name="varName">[ztSelJurosMulta]</property>
      <property name="cPicture">[999999999.99]</property>
      <property name="TabIndex">7</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{318,0,107,19}</property>
      <property name="Name">[oLabel1]</property>
      <property name="Caption">[Debito Total:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{317,22,107,19}</property>
      <property name="Name">[oLabel2]</property>
      <property name="Caption">[Total Vencido:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{318,44,107,19}</property>
      <property name="Name">[oLabel3]</property>
      <property name="Caption">[Total a Vencer:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{600,4,145,19}</property>
      <property name="Name">[oLabel4]</property>
      <property name="Caption">[Debito Selecionado:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{600,27,145,19}</property>
      <property name="Name">[oLabel5]</property>
      <property name="Caption">[Selecionado Vencido:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{600,49,145,19}</property>
      <property name="Name">[oLabel6]</property>
      <property name="Caption">[Selecionado Vencer:]</property>
      <property name="TabIndex">8</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{318,66,107,19}</property>
      <property name="Name">[oLabel7]</property>
      <property name="Caption">[Multa+Juros:]</property>
      <property name="TabIndex">9</property>
    </style>
  </part>
  <part class="label">
    <style>
      <property name="Geometry">{600,73,145,19}</property>
      <property name="Name">[oLabel8]</property>
      <property name="Caption">[Multa+Juros Selec:]</property>
      <property name="TabIndex">9</property>
    </style>
  </part>
</part>
