ALIAS Fp_PtFun
VARIAVEL #TEXTO_FONTE
   Private hReg, m_fNumero:=0, m_fnome:=space(30)
   fp_ptfun->(DbCloseArea())
   Abra ('0NOIDX', r_siga, 'fp_ptfun', 'fp_ptfun', 'fp_ptfun', 'FNUMERO', 'fpptfunn', 'fnome')
   debugalert('Fp_PtFun= '+hb_valtoexp(select('Fp_PtFun')) )
   if .not. QuickDialog("ptth_mnt5", "Impressao de Cracha" ,;
        {{"Matricula (Confirme 0 para imprimir todos):", "@m_fNumero", @m_fNumero,"999999", "", "m_fNumero=0.or.(psq_brow().and.(m_fnome:=fNome,RefreshGetlist()));fp_ptfun;pfpfun;N;S;;"} ,;
         {"Nome..:", "@m_fnome", @m_fnome,   "@S30",    ".f.", ""} } )
         Return
   endif

   oLst:cAliasMaster := 'etq_cracha' 
   oLst:cAlias_DataCols := 'etq_cracha'

   oLst:lOutputFr3 := .t.
   if oLst:lOutputFr3 
      oLst:cReport := 'etq_cracha'
      oLst:cTemplateFr3 := 'skel_' + 'ListaSemGrp' +'.fr3'
      oLst:SetDbLst('mem:etq_cracha')
   endif

   debugalert('5')
      
   oLst:AddCol("Matric;FNUMERO;N;99999;  5;N;")
   oLst:AddCol("Barras;PDIC6;N;9999999999999;  13;N;")
   oLst:AddCol("Nome;FNOME;C;@S30; 30;N;")
   oLst:AddCol("Aniv Admis;left(dtoc(fdtnasc),5)+' '+Dtoc(FdtAdmis);P;@S14;14;N;;Esquerda;NaoSome;Imprima;fdtnasc;")
   oLst:AddCol("Lj;Relogio;N;99;  2;S;")
   oLst:AddCol("Tb;Ftabela;N;99;2;S;")
   oLst:AddCol("HT;Ftabelaht;N;99;2;S;")
   oLst:AddCol("dmt;FFG_DEMIT;L;L;3;S;")
   oLst:AddCol("Dt Rescis;FdtRescis;D;99.99.9999;10;S;")
   oLst:AddCol("Nome Cracha;if(empty(FNOMEGuerr),fNome,FNOMEGuerr);P;@S19; 19;S;;Esquerda;NaoSome;Imprima;FNOMEGuerr;")
   oLst:AddCol("Cargo;Fcargo;C;@S25;25;S;")
   oLst:AddCol("Funcao;FFuncao;C;@S30;30;S;")
   oLst:AddCol("CPF;Fcpf;C;@S14;14;S;")
   oLst:AddCol("Nome Cartao Banco;if(empty(FnomeAbr),fNome,FnomeAbr);P;@s19;15;S;;Esquerda;NaoSome;Imprima;FnomeAbr;")

   oLst:Cab1( "Funcionarios para Crachas" )
   oLst:AddCab( '_LINHA_FINA_' )
   oLst:AddCab( '_CABCOLS_' )
   oLst:AddCab( '_LINHA_GROSSA_' )

   oLst:AddRodape( '_LINHA_FINA_', "", {|| "Pagina "+Str(++pag,4)+" "} )

   debugalert('6')
   
   Fp_PtFun->( dbGoTop(), oLst:DbEval(/*bDurante*/, {||(m_fNumero=0.and.fnumero>0.and.Day(FdtRescis)=0).or.m_fNumero=fNumero} /*bFor*/, /*bWhile*/, /*bStart*/, /*bFinish*/, 'Gerando Relatorio...' /*cMsg*/) )

   debugalert('7')
#FIM_TEXTO_FONTE
