GERA_REA;Dados do Romaneio;sys_tbbrow;5; 0;18;79;Romaneio;;eval(zBlDadosAdic);
:SKEL
VARIAVEL zTelaOrig := if(sGuiMode,'',SaveScreen(0,40,4,79))
variavel zBlCli := {|nCli| sccrcli->( if(nCli<>Recno(),DbGoTo(nCli),""), str(nCli,6)+"-"+cr_nome) }
variavel zBlDadosAdic := #TEXTO_FONTE
   Private zcor, zCli:=fCli,zr,zc,zn
   SccrCli->(dbGoto(zCli))
   // debugalert('pesquisando cli:'+str(zcli)+' nome:'+SccrCli->cr_nome)
   zn:=if(ftipoenc=='AV', sccrcli->cr_nome, str(fcli,6)+"-"+cr_nome)
   if !sGuiMode
      (zcor:=SetColor('R/W'),zr:=row(),zc:=col(),Scroll(0,40,4,79,0),DispBox(0,40,4,79))
      if ftipoenc=='AV'
         (DevPos(0,42), DevOut("*SERVICO AVULSO*"))
         (DevPos(2,42), DevOut("Ref.Cupom: "+str(fnumped,6)))
      else
         if sys_segmento<>"locacao"
            ( DevPos(0,42) , DevOut("Pedido:" +str(fnumped,6)+" Valor: "+transform(fval,"@E 999,999.99")))
         endif
         ( DevPos(1,42) , DevOut("Cli: "+left(sccrcli->cr_tip_cli,1)+"."+left(zn,30)))
         ( DevPos(2,42) , DevOut("P.Ref: "+left(sccrcli->cr_pontore,30)) )
         ( DevPos(3,42) , DevOut("Fone: "+sccrcli->cr_fone) )
      endif
      ( SetColor(zcor), devpos(zr,zc) )
   endif
#FIM_TEXTO_FONTE

variavel #TEXTO_FONTE
   //ONINIT
   hwg_TbFi(@D_oB,'Sel;if(reg_SEL="S","*"," ");C;!;1;N;')
   hwg_TbFi(@D_oB,'tr;if(fTipoEnc="AV","Avulso",if(fTipoEnc="VD","Entrega","Devolucao"));P;@S9;9;N;')
   hwg_TbFi(@D_oB,'Hora  Cx;left(FHORA,5)+" "+StrZero(si_caixa,2);C;@S8;8;N;')
   hwg_TbFi(@D_oB,'Bairro;CR_BAIRRO;C;@S15;15;N;')
   hwg_TbFi(@D_oB,'Cliente/Motivo;eval(zBlCli,fCli);C;@S20;20;N;')
   if sys_segmento='locacao'
      hwg_TbFi(@D_oB,'Pedido;fnumped;N;999999;6;N;')
      hwg_TbFi(@D_oB,'Cfop;fCodOp;C;@S5;6;N;')
      hwg_TbFi(@D_oB,'t;fgdev;C;!;1;N;')
   else
      hwg_TbFi(@D_oB,'Cupom;fnumped;N;999999;6;N;')
      hwg_TbFi(@D_oB,'Valor;ftipoenc+str(fvAL,9,2);X;@s11;11;N;')
   endif
   //ENDONINIT   
#FIM_TEXTO_FONTE
COMANDO DEPOIS zNil:=if(sGuiMode,'',RestScreen(0,40,4,79,zTelaOrig))
:TBMT
 13;marca(d_ob);Enter-Seleciona ;
 80;tb_pesq(d_ob);P-Pesquisa ;
 22;tb_insert(D_OB);Ins-Inclui ;