SG_RTL;(alltrim(SG_RT->ptipo)+" "+alltrim(SG_RT->pref)+" por lojas");skip_blk(x);2;43;22;79;x;;
:SKEL
VARIAVEL W_CHAVE = SG_RT->PREF+SG_RT->ptipo
VARIAVEL W_MENSAGEM = "Sem mais "+SG_rT->pref+SG_Rt->ptipo
VARIAVEL W_BLOCK = { || W_CHAVE <> PREF+ptipo }
COMANDO ANTES Z_NIL = DbClearIndex()
COMANDO ANTES Z_NIL = DbSetIndex(r_siga+"ntx\SG_rtl")
:TBMT
 13;Cibrow("SG_RTML",,"SG_TLRM");Enter-Modelos ;
 47;displsdse(ploja,pref+ptipo,"T");/-Demanda ;
 79;tb_index(D_OB);O-Ordena ;
:TBFI
Lj;ploja;N;99;2;;
Saldo;PEATUAL;N;999999;  6;;
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;;
Pr Venda;PVLUVENDA;N;9999,999.99;11;;
Val_Custo;PVLUVEN3;N;@E 99,999,999;10;;
MesAnt;SS_ultmes;N;@E 999,999;7;;
MesAtu;SS_mes;N;@E 999,999;7;;
PmVen;if(peatual>0,PVLUVENDA/Peatual,0);N;@E 999.99;6;;
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;;
Grps;PITENS;N;9999;  4;;
