ALIAS sf_fatf

VARIAVEL #TEXTO_FONTE
   Private zDe:=CtoD( "01."+SubStr(DtoC(S_Datual),4) ) , zAte:=Date(), oQbe, zNfs:=0

      oQbe:=oQbe():New('_fatf')
      
      oQbe:AddFiltro("2;3;Datas de Chegada...:", {||pfdatache}   ,,,{'DeAte',Ctod(''),Ctod('')})
      oQbe:AddFiltro("4;3;Notas do Fornecedor:", {||pffor} ,,,{'psq_brow','psq_brow();sccpfor;psccpfor;N;N;4;35;cp_nome;@s20;',0,'999999',""} ,,, 'm_PfFor')
      oQbe:AddFiltro("6;3;CHECKBOX 'Somente notas de &Compra  '", {||SubStr(pfcodop,3,1)<>'9'}  ,,,{'Checkbox', .t.})
      oQbe:AddFiltro("7;3;CHECKBOX 'Somente Outras &Entradas  '", {||SubStr(pfcodop,3,1)='9'}   ,,,{'Checkbox', .f.})
      
      if .not. oQbe:QuickDialog("Qbe_Lst_SfFatF", "62;9;Selecao de Notas de Entrada")
         Return .f.
      endif

      Abra("0NOIDX",r_siga,"SF_CODOP","SF_CODOP","SF_CODOP","CODOP")
      Abra("0NOIDX",r_siga,"sccpfor","sccpfor")
      DbSelectArea("Sf_FatF")

	   oLst:lOutputFr3 := .f.
	   oLst:cTemplateFr3 := 'skel_' + 'ListaComGrp' +'.fr3'
	   oLst:lPortrait  := .t.

	   oLst:cAlias_DataCols := '_lstmov'
	   oLst:cAliasMaster := oLst:cAlias_DataCols
	   oLst:SetDbLst('mem:_lstmov')

	   oLst:Cab1( "Relacao de Notas de Entrada")
	   se !empty(oQbe:ExpressaoDeFiltragemParaImprimir) entao oLst:Cab3( oQbe:ExpressaoDeFiltragemParaImprimir )
	   oLst:Cab4( 'Emitida em ' + dtoc (s_datual) + ' `as ' + time () + ' horas')
	   oLst:AddCab( '_LINHA_FINA_' )
	   oLst:AddCab( '_CABCOLS_' )
	   oLst:AddCab( '_LINHA_GROSSA_' )

	   oLst:AddCol('DataCheg;pfDataChe;D;99.99.9999;10;;')
	   oLst:AddCol('DataEmis;pfDataEmi;D;99.99.9999;10;;')
	   oLst:AddCol('CodFor;pfFor;N;999999;6;;')
	   oLst:AddCol('Fornecedor;sccpfor->( ++zNfs, dbGoTo(Sf_FatF->PfFor), if(empty(cp_fantasi),cp_nome,cp_fantasi) );P;@S25;25;;')
	   oLst:AddCol('NF;pfnum;N;9999999999;10;S;;Direita;NaoSome;')
	   oLst:AddCol('Valor;pfVal;N;@E 999,999,999.99;14;S;;Direita;Some;')
	   // oLst:AddCol('Mod;fModelo;C;99;3;S;;Direita;NaoSome;')
	   oLst:AddCol('Mod;Cod_Mod;C;XX;3;;')
	   oLst:AddCol('CFOP;pfCodOp;C;9.999;5;;')
	   oLst:AddCol('Operacao;Sf_CodOp->( dbSeek(Sf_Fatf->pfCodop), DescOp);P;@S25;25;;')

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

	   Sf_FatF->( DbGoTop(), oLst:DbEval(,{||oQbe:Filtro_ok()}) )

   	oLst:SetFormatSomaCol(4, {||"** Valor das "+lTrim(Str(zNfs,6))+" Entradas:"})
   	oLst:PrtD('_LINHA_FINA_', {"style"=>"font:Courier-BoldOblique"}, '_SOMACOLS_')

		sccpfor->(DbCloseArea())
	   debugalert('vai run ...')
	   oLst:Run()
	   oLst:End()
   	debugalert('5')

#FIM_TEXTO_FONTE