SE_PROD;Produtos Disponiveis;sys_tbbrow;8;0;23;79;pseprodv;xpsq(d_ob);eval(z_blockppo);
:SKEL
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
VARIAVEL Z_COR:=SetColor("B/W")
VARIAVEL Z_Xtela = if(.not.sGuiMode, SaveScreen(0,16,4,79), )
VARIAVEL z_blockppo=#TEXTO_FONTE
   if sys_segmento='farma'
      (Scroll(0,16,4,79,0),DispBox(0,16,4,79))
      ( DevPos(0,17),DevOut(Padc("(Cod:"+Str(pcod,6)+") "+alltrim(pdesc)+" (Saldo: "+ltrim(Str(peatual,4))+")",58)) )
      ( DevPos(1,17),DevOut(Padc("(%DscBloq:"+Alltrim(pbloqvenda)+") (Portaria:"+Alltrim(pfgcontrol)+") (Ref:"+alltrim(pref)+") (Frv:"+Alltrim(str(pitens,4))+")",58)) )
      ( DevPos(2,17),DevOut(Padc(if(pdesconto>0,"(%Max:"+Alltrim(str(pdesconto,4))+")","")+if(day(pdataprog)>0,"  (PrProm:"+Alltrim(str(pvluven2,10,2))+")",""),58)) )
      ( DevPos(2,17),DevOut(Padc("Gen: "+tem_generico(pprincipio,pdic5),58)) )
      ( DevPos(3,17),DevOut(Padc(Alltrim(pprincipio),58)) )
   else
      (Scroll(0,16,3,79,0),DispBox(0,16,3,79))
      ( DevPos(0,17),DevOut(Padc("(Cod:"+Str(pcod,6)+") "+alltrim(pdesc),58)) )
      ( DevPos(1,17),DevOut(Padc("(%DscBloq:"+Alltrim(pbloqvenda)+") (Frv:"+Alltrim(str(pitens,4))+") (Saldo: "+ltrim(Str(peatual,4))+")",58)) )
      ( DevPos(2,17),DevOut(Padc("(Marca:"+alltrim(pref)+") (Modelo:"+alltrim(pmarcamode)+") (Tipo:"+alltrim(ptipo)+")",58)),SetColor(Z_COR) )
   endif
   SetColor(Z_COR)
#FIM_TEXTO_FONTE
variavel #TEXTO_FONTE
   //ONINIT
      if sys_segmento='farma'
         if Select("tabela")=0
            ABRA_ARQ("TABELA")
            DbSelectArea("SE_PROD")
         endif
         hwg_TbFi(D_oB, 'Apresentacao;Pdesc;C;@s29; 27;;')
         hwg_TbFi(D_oB, 'Principio;Pprincipio;C;@s27; 25;;')
         hwg_TbFi(D_oB, 'G;Pgenerico;C;!;1;;')
         hwg_TbFi(D_oB, 'Cod;Pcod;N;99999;  5;N;')
         hwg_TbFi(D_oB, 'Est;Peatual;N;999;3;;')
         hwg_TbFi(D_oB, 'Pr Venda;pvluvenda;N;9999.99; 7;;')
//hwg_TbFi(D_oB, 'Pr Dinh;if(pdescbon>0,"d"+str(pvluvenda*(1-pdescbon/100),6,2),if(Se_Prod->PvluVen2>0.and.w_fgprom_ativa.and.(s_datual<=se_prod->pdataprog.or.w_promocao="S"),"p"+str(PVLUVEN2,6,2),if(PBLOQVENDA="S","b","")));C;x999.99;7;;')
         hwg_TbFi(D_oB, 'Frac;pgpreco+lower(pabcfisica)+str(Pitens,4);N;xx9999;6;;')
         hwg_TbFi(D_oB, 'Ref;pref;C;@s15;15;;')
         hwg_TbFi(D_oB, 'Ped;quant_vped(pcod);N;9999;4;N;')
         hwg_TbFi(D_oB, '%Marg;pdescvar;N;99.99%;6;N;')
      else
         hwg_TbFi(D_oB, 'Apresentacao;Pdesc;C;@s40; 40;;')
         hwg_TbFi(D_oB, 'Est;Peatual;N;@e 9999.999;8;;')
         hwg_TbFi(D_oB, '(if(wPrAtacLiberado,"PrAtacado","Pr.Venda"));(if(wPrAtacLiberado,pvluven4,pvluvenda));P;9999.99; 7;;')
         hwg_TbFi(D_oB, 'Cod Barras;pdic6;N;9999999999999; 13;;')
         hwg_TbFi(D_oB, 'Cod;Pcod;N;99999;  5;N;')
         hwg_TbFi(D_oB, 'Ref.Fab.;prefFab;C;@s15;10;;')
         hwg_TbFi(D_oB, '(if(wPrAtacLiberado,"Pr.Venda","PrAtacado"));(if(wPrAtacLiberado,pvluvenda,pvluven4));P;9999.99; 7;;')
// hwg_TbFi(D_oB, 'Pr Prom;if(pdescbon>0,"d"+str(pvluvenda*(1-pdescbon/100),6,2),if(Se_Prod->PvluVen2>0.and.w_fgprom_ativa.and.(s_datual<=se_prod->pdataprog.or.w_promocao="S"),"p"+str(PVLUVEN2,6,2),if(PBLOQVENDA="S","b","")));C;x999.99; 7;;')
         hwg_TbFi(D_oB, 'Gp Itens;pgpreco+lower(pabcfisica)+str(Pitens,4);N;xx9999;6;;')
         hwg_TbFi(D_oB, 'Ref;pref;C;@s15;10;;')
         hwg_TbFi(D_oB, 'CF;se_prod->pcategoria;C;XXX;3;;')
         hwg_TbFi(D_oB, 'CFOF;se_prod->pcfop;C;XXXXX;5;;')
      endif
   //ENDONINIT   
#FIM_TEXTO_FONTE

COMANDO DEPOIS znil = if(Select("tabela")>0,TABELA->(DBCLOSEAREA()),"")
COMANDO DEPOIS znil = if(.not.sGuiMode,if(sys_segmento='farma',RestScreen(0,16,4,79,Z_Xtela), RestScreen(0,16,3,79,Z_Xtela)),)

:TBMT
 13;ret_pcod();Enter-Quant ;
 80;psq_prod("P",D_oB);P-Pesquisa ;
 43;ped_cod(d_ob);+-Cod_Quant ;
 -5,sys_segmento="farma";vb_prdfalta();F6-Lanca_Falta ;
 61,sys_segmento="farma";tv_interroga();=-Indicacoes ;
 87,sys_segmento="farma";BulaWww(pPrincipio);W-Bula_WWW ;
 93,.not.sGuiMode;disp_sdse(pcod);]-Demanda;
 47;tb_cons("se_prodc",.f.);/-Ficha ;