SE_PROMP;Descontos por Produtos;sys_tbbrow; 7; 2;18;79;se_prom;;
:SKEL
VARIAVEL Z_NIL=(zSele:=Select(),ABRA("0NOIDX",r_siga,"SE_LABS","SCCPFOR"), ABRA("0NOIDX",r_siga,"se_prod","Se_prod","seip_c","pcod","seip_n","pdesc"), DbSelectArea(zSele))
VARIAVEL Z_blkfor := { |x_forn| Sccpfor->( DbGoto(x_forn), if(empty(cp_fantasi),cp_nome,cp_fantasi) ) }
VARIAVEL Z_blkprd := { |x_pcod| Se_Prod->( DbSeek(x_pcod) ), se_prod->Pdesc}
COMANDO SAIDA Z_NIL = ( Se_Prod->(DbCloseArea()) , Sccpfor->(DbCloseArea()) )
:TBMT
13;doget(d_ob);Enter-Altera ;
32;AnexaProm();Barra-Anexa_Prd ;
22;tb_insert(d_ob);Ins-Inclui ;
7;tb_del(d_ob);Del-Deleta ;
79;tb_index(d_ob);O-Ordena ;
80;tb_pesq(d_ob);P-Pesquisa ;
73;lst_alias(d_ob);I-Imprime ;
:TBFI
Cod;PCOD;N;999999;6;N;
Descricao;Eval(z_blkprd,pcod);C;@s35;35;N;
%Desc;pdescprom;N;999.99;5;S;
PrProm;pvluven2;N;999.99;6;S;
Forn;Eval(z_blkfor,se_Prod->pprincforn);C;@s10;10;N;
Tabela;cr_tabela;N;99999;6;S;