SCCRDUP;Selecao de Duplicatas;sys_tbbrow; 5; 0;20;79;sccrdup;;
:SKEL
VARIAVEL zbPrtConferente := {|| z_recno:=recno(), Relat('lst_exec("CONCILIA")',"nb"), eVal(zbOpenAll) }
//VARIAVEL w_colsep = chr(179)
//VARIAVEL w_headsep = chr(196)
VARIAVEL w_colsep=" "+chr(179)
VARIAVEL znil=__SetCentury("on")
VARIAVEL zbCor=" "
VARIAVEL zbCli={|nCodCli|sccrcli->(DbGoto(nCodCli),cr_nome)}
VARIAVEL zFgCliClosed := (Select("SCCRCLI")=0)

VARIAVEL znAzul0:=16711680
VARIAVEL znAzul1:=10027008
VARIAVEL zAzul2:=16776960
VARIAVEL zW:=16777215
VARIAVEL zBlack:=0
VARIAVEL zRed:=255
VARIAVEL zGreen:=32768
VARIAVEL znCinza:=8421504
VARIAVEL zYellow:=65535
VARIAVEL zFgUsaCores:=(xGetEnv("USA_CORES_NO_BROWSE")="S")
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()}
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()}
VARIAVEL zBfLocacao:={||DbSetFilter({||'RR NFS'$cr_obs},"'RR NFS'$cr_obs"),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}
VARIAVEL zBfTodas:={||DbClearFilter(),DbGoTop(),d_ob:Refresh(),d_ob:SetFocus()}

comando antes znil=if(zFgCliClosed,Abra_arq("sccrcli"), "")
comando saida znil=if(zFgCliClosed.and.Select("sccrcli")>0, sccrcli->(DbCloseArea()), "")

// if sys_segmento='locacao'
// 84;Eval(zBfLocacao);2-Locacoes;H - Exibe somente Titulos de Locacao;sembitmap;;;Lucida Bright;-11;&2-Locacao;;6;
// endif

variavel #TEXTO_FONTE
   //ONINIT
   hwg_TbFi(D_oB, '*;Cp_Status;C;x;1;S;')
   hwg_TbFi(D_oB, 'Cli;CR_COD_CLI;N;999999;6;N;')
   if zFgUsaCores
      // cor laranja=33023. Uma definicao de cores pega 4 parametros: {textColor, backColor, textColorSelecionado, backColorSelecionado}
      // Para colocar uma coluna colorida, defina um criterio de cores e adicione no fim da linha a zbCor: hwg_TbFi(D_oB, 'Cod;cr_cod_cli;N;999999;6;N;zbCor;')
      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, 'TipoDoc;SxNomeFormaPag(CR_TIP_DUP);C;@S8;8;N;')
   hwg_TbFi(D_oB, 'Val Emis;CR_VALOR;N;9999999.99; 10;N;')
   hwg_TbFi(D_oB, 'Dt Emis;CR_DT_EMIS;D;99/99/9999; 10;N;')
   hwg_TbFi(D_oB, 'Dt Venc;CR_DT_VENC;D;99/99/9999; 10;S;')
   if sys_segmento='locacao'
      hwg_TbFi(D_oB, 'Dt Lqd;CR_DT_LQD;D;99/99/9999; 10;S;')
      hwg_TbFi(D_oB, 'Val Lqd;CR_VAL_LQD;N;9999999.99; 10;S;')
   ELSE
      hwg_TbFi(D_oB, 'Dt Lqd;CR_DT_LQD;D;99/99/9999; 10;N;')
      hwg_TbFi(D_oB, 'Val Lqd;CR_VAL_LQD;N;9999999.99; 10;N;')
   endif
   hwg_TbFi(D_oB, 'Obs;CR_OBS;C;@S15; 15;S;')
   hwg_TbFi(D_oB, 'Controle;CR_NUM_PED;C;@S9;9;N;')
   hwg_TbFi(D_oB, 'NumFec;Si_NumFech;N;999999;6;N;')
   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, 'CFOP;CR_CFOP;C;XXXXX;5;N;')
   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;')
   //ENDONINIT
#FIM_TEXTO_FONTE
:TBMT
13;cp_confere(d_ob);Enter-Confere/DesMarca;Barra-Confere/DesMarca;sembitmap;;;Lucida Bright;-11;Seleciona;;6;
32;doget(D_ob);Barra-Edita ;Enter - Edita;sembitmap;;;Lucida Bright;-11;Edita;;6;
73;eVal(zbPrtConferente);I-Imprime ;I-Imprime Conferente da Selecao de Titulos;impressora.ico;;;;;&I-Imprime;;;
65;tb_update(D_OB);A-Altera ;A-Altera;alterar.ico;;;;;&A-Altera;;;
7;tb_del(d_ob);Del-Apaga ;Del-Deleta;deletar.ico;;;;;Deleta;;;
80;tb_pesq(D_OB);P-Pesquisa ;P-Pesquisa na coluna do cursor;pesquisa.ico;;;;;&P-Pesquisa;;;
79;tb_index(D_OB);O-Ordena ;O-Ordena a coluna do cursor;ordenar.ico;;;;;&O-Ordena;;;
70;tb_filter(d_ob);F-Filtra ;F-Filtra Cursor;sembitmap;;;Lucida Bright;-11;&F-Filtra;;6;
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;
86;Eval(zBfVencidas);V-Vencidas;V - Exibe apenas titulos VENCIDOS;sembitmap;;;Lucida Bright;-11;&V-Vencidas;;6;
72;Eval(zBfHoje);H-Para Hoje;H - Exibe apenas titulos para HOJE;sembitmap;;;Lucida Bright;-11;&H-Hoje;;6;
84;Eval(zBfTodas);T-Todos;H - Exibe todos os Titulos;sembitmap;;;Lucida Bright;-11;&T-Todos;;6;