ALIAS HELP
VARIAVEL #TEXTO_FONTE

   Private zIdRecibo:=0, zFgQuerReimprimir:=.t., hReg

   se type('zRecnBrw')<>'U' entao (zIdRecibo:=zRecnBrw, zFgQuerReimprimir:=.f.)
   
   se select('SCCPFOR')=0 entao abra_arq("SCCPFOR")
   se select('SCCPPED')=0 entao abra_arq("SCCPPED")
   
   if zIdRecibo=0 .and..not. QuickDialog("recibo_sccpped_fr3", "30;4;Reimpressao de Recibos", { ;
         {"2;2;Id do Recibo:", "@zIdRecibo",  @zIdRecibo,  "999999", "", "psq_brow;sccpped;psccpped;N;N;"} } )
      Return
   endif

   Select SccpPed
   DbGoTo(zIdRecibo)
   
   wCab1:="RECIBO"
   wCab2:="Numero "+lTrim(Str(zIdRecibo,10))
   
   oLst:lOutputPdf      := .f.
   oLst:lOutputFr3      := .t.
   oLst:cAliasMaster    := '_recibo' 
   oLst:cAlias_DataCols := '_recibo'
   oLst:cReport         := 'recibo_sccpped'

   SccpFor->(DbGoTo(SccpPed->CP_COD_FOR))
   oLst:PutRsFr3("_forn", sccpfor->(Scatter()) )
   oLst:PutRsFr3("_ped", sccpped->(Scatter()) )
   
   hReg:={=>}
   hReg['REFERENTE']  := sccpped->cp_desc
   hReg['CP_NUM_PED'] := sccpped->cp_num_ped
   hReg['VALOR']      := sccpped->cp_valor
   hReg['DATA']       := sccpped->cp_dt_emis
   hReg['RECEBEDOR']  := sccpfor->cp_nome

   hReg['TP_CNPJCPF']  := ""
   hReg['REC_CNPJ']  := ""
   se Cgc_Ok(sccpfor->cp_cgc) entao hReg['TP_CNPJCPF'] := "CNPJ" senao se Cpf_Ok(sccpfor->cp_cgc) entao hReg['TP_CNPJCPF'] := "CPF" 
   se hReg['TP_CNPJCPF']=="CNPJ" entao hReg['REC_CNPJ'] := FormataCnpjCpf(sccpfor->cp_cgc,,,.t.)
   se hReg['TP_CNPJCPF']=="CPF"  entao hReg['REC_CNPJ'] := FormataCnpjCpf(sccpfor->cp_cgc,,,,.t. )
   
   // hReg['OBS']       := '(Obs: '+hReg['OBS']+')'
   
   oLst:PutRsFr3('_recibo', hReg )

   debugalert('7 vai :run e :end')

   _recibo->( oLst:Run() )
   oLst:End()
   
   dbCloseAll()
   dbDrop('mem:_recibo')
   dbDrop('mem:_forn')
   dbDrop('mem:_ped')

#FIM_TEXTO_FONTE
