SG_LT;(SG_t->ptipo+" por lojas");skip_blk(x); 5; 14;20;75;x;;
:SKEL
VARIAVEL W_CHAVE = SG_t->ptipo
VARIAVEL W_MENSAGEM = "Sem mais Tipos  em "+SG_t->ptipo
VARIAVEL W_BLOCK = { || W_CHAVE <> ptipo }
COMANDO ANTES Z_NIL = DbClearIndex()
COMANDO ANTES Z_NIL = DbSetIndex(r_siga+"ntx\SG_TL")
:TBMT
 13;Cibrow("SG_RTL",,"SG_TLR");Enter-Marcas ;
 47;displsdse(ploja,ptipo,"T");/-Demanda ;
 79;tb_index(D_OB);O-Ordena ;
:TBFI
Lj;PLOJA;N;99;2;;
Estoq;PEATUAL;N;@E 999,999;7;;
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;;
PmVen;if(peatual>0,PVLUVENDA/Peatual,0);N;@E 999.99;6;;
Val_Venda;PVLUVENDA;N;9,999,999;9;;
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;;
%Marg;if(Pvluvenda>0,100*(Pvluvenda-PVLUVEN3)/Pvluvenda,0);N;@E 999.9%;6;;
Grps;PITENS;N;9999;5;;
Nmeses;if((SS_mes+SS_12m)>0,Peatual/((SS_mes+SS_12m)/12),9999);N;@E 999.9;5;;
Tipo;ptipo;C;@s5;5;;
