SE_GRGRA;Grades Cadastradas;sys_tbbrow; 5;5;20;60;padrao;;
:SKEL
VARIAVEL Z_BlkVazio={}

VARIAVEL z_Blk13 = "Se_Prod->(RegLock()),Se_Prod->(Put_Var('PGRADE',Se_GrGra->Grade)),"
VARIAVEL z_Blk13 = z_Blk13 + "Sp_Movf->(reglock()),Sp_Movf->(Put_Var('GRADE',Se_GrGra->Grade)),"
VARIAVEL z_Blk13 = z_Blk13 + "Sp_Movf->(Put_Var('pitens',Se_GrGra->pitens)),"
VARIAVEL z_Blk13 = z_Blk13 + "__keyboard(chr(27))"
VARIAVEL z_Blk13 = _CreateBlock( z_Blk13 )

VARIAVEL z_Blk32 = "Z_Sele:=Select(),"
VARIAVEL z_Blk32 = z_Blk32 + 'Abra("0",R_SIGA,"SE_GRGTC","SE_GRGTC","SE_GRGTC","GRADE+PTAM+PCOR"),'
VARIAVEL z_Blk32 = z_Blk32 + "Brow_Db('SE_GRGTC',.t.),"
VARIAVEL z_Blk32 = z_Blk32 + 'Se_GRGTC->(DbCloseArea()),'
VARIAVEL z_Blk32 = z_Blk32 + "DbSelectArea(z_sele)"
VARIAVEL z_Blk32 = _CreateBlock( z_Blk32 )

*VARIAVEL z_Blk32 = "Z_Sele:=Select(),"
*VARIAVEL z_Blk32 = z_Blk32 + 'Abra("0",R_SIGA,"SE_GRGP","SE_GRGP","SE_GRGP","GRADE+str(Pcod,6)"),'
*VARIAVEL z_Blk32 = z_Blk32 + "Brow_Db('SE_GRGP',.t.),"
*VARIAVEL z_Blk32 = z_Blk32 + 'Se_GRGP->(DbCloseArea()),'
*VARIAVEL z_Blk32 = z_Blk32 + "DbSelectArea(z_sele)"
*VARIAVEL z_Blk32 = _CreateBlock( z_Blk32 )

VARIAVEL z_BlkDel = "Z_Sele:=Select(),"
VARIAVEL z_BlkDel = z_BlkDel + "z_grade:=grade,"
VARIAVEL z_BlkDel = z_BlkDel + 'Abra("0RO",R_SIGA,"SE_GRGTC","SE_GRGTC","SE_GRGTC","GRADE+PTAM+PCOR"),'
VARIAVEL z_BlkDel = z_BlkDel + "z_fgdel:=!DbSeek(z_grade),"
VARIAVEL z_BlkDel = z_BlkDel + 'Se_GRGTC->(DbCloseArea()),'
VARIAVEL z_BlkDel = z_BlkDel + "DbSelectArea(z_sele),"
VARIAVEL z_BlkDel = z_BlkDel + "if(z_fgdel,tb_del(w_dob),Mensagem('Grade nao Vazia! Voce deve primeiro apagar a composicao da grade...',1))"
VARIAVEL z_BlkDel = _CreateBlock( z_BlkDel )

*  32;Eval(z_Blk32);Barra-Produtos
:TBMT
  13;Eval(z_Blk32);Enter-Composicao ;
  32;Eval(z_Blk13);Barra-Confirma ;
   7;Eval(z_BlkDel);DEL-DELeta ;
 22;tb_insert(D_OB);Ins-Inclui ;
 65;tb_update(D_OB);A-Altera ;
 80;tb_pesq(D_OB);P-Pesquisa ;
 79;tb_index(D_OB);O-Ordena ;
 73;lst_alias(D_OB);I-Imprime ;
:TBFI
Grade;Grade;C;@S6;6;S;
Descricao;descricao;C;@s35;35;S;
Itens;Pitens;N;9999;5;N;
