SCCRDUP;Compras do Cliente;sys_tbbrow; 3;1;16;79;psccrdup;;
:SKEL
VARIAVEL w_colsep := chr(179)
VARIAVEL w_headsep := chr(196)
VARIAVEL znil := __SetCentury("on")
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}) )}
VARIAVEL zbSoAbertas := {|| m_fcli=cr_cod_cli.and.!left(Cr_num_ped,2)$"/CX/CZ/".and.DAY(CR_DT_LQD)=0 }
VARIAVEL zbTodas := {|| m_fcli=cr_cod_cli.and.!left(Cr_num_ped,2)$"/CX/CZ/"}
VARIAVEL zbFiltraAbertas := {|| DbSetFilter(zbSoAbertas, "m_fcli=cr_cod_cli"), if(sGuiMode, d_ob:Top(), D_oB:goTop())}
VARIAVEL zbFiltraTodas := {|| DbSetFilter(zbTodas, "m_fcli=cr_cod_cli"), if(sGuiMode, d_ob:top(), D_oB:goTop()) }
VARIAVEL #TEXTO_FONTE
   //ONINIT
   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, 'Emissao;cr_dt_emis;D;; 10;N;')
   if xGetEnv("USA_CORES_NO_BROWSE")="S"
      hwg_TbFi(D_oB, 'Valor;cr_Valor;N;@E 999,999.99; 10;N;zbCor;')
      hwg_TbFi(D_oB, 'Vencto;cr_dt_venc;D;; 10;N;zbCor;')
   ELSE
      hwg_TbFi(D_oB, 'Valor;cr_Valor;N;@E 999,999.99; 10;N;')
      hwg_TbFi(D_oB, 'Vencto;cr_dt_venc;D;; 10;N;')
   ENDIF
   hwg_TbFi(D_oB, 'Val Lqd/Ad;cr_Val_lqd;N;@E 999,999.99; 10;S;')
   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;')
   if fieldpos('cr_cfop')>0
      hwg_TbFi(D_oB, 'CFOP;CR_CFOP;C;XXXXX;5;N;')
   endif
   hwg_TbFi(D_oB, 'DtAlter;cr_data;D;;10;N;')
   hwg_TbFi(D_oB, 'HrAlter;cr_hora;C;xxxxx;5;N;')
   hwg_TbFi(D_oB, 'Usuario;cr_usuario;C;@s8;8;N;')
   if fieldpos('fnum')>0
      hwg_TbFi(D_oB, 'NFs;fnum;N;999999;6;N;')
   endif
   //ENDONINIT
#FIM_TEXTO_FONTE
:TBMT
 92;PrtBordero("RTF", , , "carne.rtf");\-Carnes_rtf ;\ - Carnes_rtf;sembitmap;;;Lucida Bright;-11;&\-Carnes_rtf;;6;
 47;PrtBordero("RTF", , , "duplicata.rtf" );/-Duplicatas_rtf ;/ - Duplicatas_rtf;sembitmap;;;Lucida Bright;-11;&/-Duplicatas_rtf;;6;
 74;PrtBordero("PDF", , , "duplicata.pdf");J-BOLETOS_pdf ;J - BOLETOS_pdf;sembitmap;;;Lucida Bright;-11;&J-BOLETOS_pdf;;6;
 72;PrtBordero("HTM", , , "duplicata.htm");H-BOLETOS_Html ;H - BOLETOS_Html;sembitmap;;;Lucida Bright;-11;&H-BOLETOS_Html ;6;
 47;eVal(zbFiltraTodas);/-Todas ;
 65;eVal(zbFiltraAbertas);A-Abertas ;
 80;tb_pesq(d_ob);P-Pesquisa ;
 84;tb_locate(D_oB);T-Trecho ; 
 67;tb_locate(D_oB);C-Repete_Busca ;
 32;DoGet(D_oB);Barra-Edita ;
 79;tb_index(D_OB);O-Ordena ;
 70;tb_filter(d_ob);F-Filtra ;
 61;doget(D_ob,,.t.);=-Repete_Edicao ;
  7;tb_del(D_ob);DEL-DELeta ;