SG_RTL;("Loja:"+Str(SG_rl->ploja)+" Tipos de "+alltrim(SG_rl->pref));skip_blk(x);5;3;18;69;padrao;;
:SKEL
VARIAVEL W_CHAVE = Str(SG_Rl->Ploja,2)+SG_Rl->PREF
VARIAVEL W_MENSAGEM = "Sem mais "+Str(SG_Rl->Ploja,2)+SG_rl->pref
VARIAVEL W_BLOCK = { || W_CHAVE <> Str(ploja,2)+PREF }
COMANDO ANTES Z_NIL = DbClearIndex()
COMANDO ANTES Z_NIL = DbSetIndex(r_siga+"ntx\sg_lrt")
:TBMT
 13;Cibrow("SG_RTML",,"SG_TLRM");Enter-Modelos ;
 47;displsdse(ploja,pref+ptipo,"I");/-Demanda ;
 79;tb_index(D_OB);O-Ordena ;
:TBFI
Tipo;PTIPO;C;@S5;  5;;
Saldo;PEATUAL;N;@E 999,999;  7;;
Val_Custo;PVLUVEN3;N;@E 99999,999;9;;
%Marg;if(Pvluvenda>0,100*(Pvluvenda-PVLUVEN3)/Pvluvenda,0);N;@E 999.9%;6;;
PmVen;if(peatual>0,PVLUVENDA/Peatual,0);N;@E 9999.99;7;;
Val_Venda;PVLUVENDA;N;99,999,999;10;;
Nmeses;Str(if(SS_12m>0,Peatual/(SS_12m/12),9999),4,1)+if(SS_0ano<SS_ano,"+","-");C;XXXXX;5;;
AcumAno;SS_ano;N;@E 999,999;7;;
DifAcum;SS_ano-SS_0anom;N;@E 999,999;7;;
MesAnt;SS_ultmes;N;@E 999,999;7;;
MesAtu;SS_mes;N;@E 999,999;7;;
DfM_Ant;SS_ultmes-SS_0ultmes;N;@E 999,999;7;;
Vnd2002;ss_0ano;N;@E 999,999;7;;
Vnd12mF;SS_12m;N;@E 999,999;7;;
Dif_12m;SS_12m-SS_0ano;N;@E 999,999;7;;
Val_Custo;PVLUVEN3;N;@E 99,999,999;10;;
Lj;PLOJA;N;99;  2;;
Grps;PITENS;N;9999;  4;;
