ALIAS FP_PTFUN
INDEX FP_PTFU2 Fnome 
OUTROARQ LOJAS LOJAS CR_LOCAL 

VARIAVEL #TEXTO_FONTE
   Private zDtRef:=s_datual, zLj:=0, zNf:=0, wOpt:=1, vOpcoes:={ {'&1. Lista p/ Crachas',1},{'&2. Lista Simples',2} }
  
   if .not. QuickDialog("fp04rf", "41;6;Relacao de Funcionarios", { ;
         {"1;2;Numero da Loja....:","@zLj", @zLj,  "99", "", "" },;
         {"2;2;Data de Referencia:","@zDtRef", @zDtRef,  "99.99.9999", "", "" },;
         {"3;2;Funcionarios a Listar:","@wOpt", @wOpt,  "9", "", "RADIOGROUP vOpcoes" } } )
      Return .f.
   endif

   oLst:cAlias_DataCols := '_fpfun'
   oLst:cAliasMaster := '_fpfun'
   oLst:lPortrait := .t.

   // oLst:AddDbFr3('fp_ptfun',  'fp_ptfun' ,  'fp_ptfu2') 
   // oLst:AddMasterDetailFr3(StrTran(wDbCpDup+'g','mem:','') , StrTran(wDbCpDup+'gs','mem:',''), 'cp_divisao') 
   
   oLst:lGeraDbTmp := .f.
   oLst:lOutputFr3 := .t.
   oLst:lOutputPdf := .t.
   oLst:SetDbLst('mem:_fpfun')
   oLst:cTemplateFr3 := 'skel_' + 'ListaSemGrp' +'.fr3'
   
   oLst:Cab1( wCab1:="Relacao de Funcionarios" )
   oLst:Cab2( "" )
   oLst:Cab3( wCab2:="impressa em "+Dtoc(s_datual)+" as "+time() )
   oLst:AddCab( '_LINHA_FINA_' )
   oLst:AddCab( '_CABCOLS_' )
   oLst:AddCab( '_LINHA_GROSSA_' )

   oLst:AddCol('Matric;fnumero;N;999999;6;;')
   oLst:AddCol('Nome;fnome;P;@s35;35;;') 

   if wOpt=1
      // oLst:AddCol('Barras;PDIC6;N;9999999999999;  13;N;;Direita;NaoSome;NaoImprima;PDIC6;)
      oLst:AddCol('Barras;PDIC6;N;9999999999999; 13;N;;Direita;NaoSome;Imprima;PDIC6;')
      oLst:AddCol('Cargo;FCARGO;C;@S20;20;;') 
      oLst:AddCol('Funcao;FFuncao;C;@S20;20;;') 
      oLst:AddCol('CPF;Fcpf;C;@S14;14;S;')
      oLst:AddCol('Nome Cracha;FNOMEGuerr;C;@S19; 19;S;')
      oLst:AddCol('Nome Banco;FnomeAbr;C;@s19;15;S;')
   else
      oLst:AddCol('Lj;Relogio;N;99;2;S;') 
      oLst:AddCol('Tab;ftabela;N;999;3;;') 
      oLst:AddCol('*;if(FFG_DEMIT,"*"," ");P;X;3;;') 
      oLst:AddCol('DtNasc;fdtnasc;D;99.99.9999;10;;') 
      oLst:AddCol('Admis;fdtadmis;D;99.99.9999;10;;') 
   endif
   
   fp_ptfun->( DbGoTop(), oLst:DbEval(,{||relogio=zlj.and.(Day(fDtRescis)=0.or.fDtRescis<=zDtRef)}) )

   debugalert('finalizou cr_recfx...')
 
#FIM_TEXTO_FONTE

