SG_T;Estoque por Tipos;sys_tbbrow; 3;1;22;79;x;;
:SKEL
*VARIAVEL Z_BLK1 = 100 * PVLUVENDA/PEATUAL * (SS_12M-SS_6M)/Z_TSS6M
VARIAVEL z_nil = log_si_proc("TOTREF","VIEW")
:TBMT
 13;Cibrow("SG_RT",,"SG_TR");Enter-Marcas ;
 32;Cibrow("SG_LT",,"SG_TL");Barra-Lojas ;
 47;disp_sdse(ptipo,"T");/-Demanda ;
 71;Cibrow("SG_GRD_T",,"SG_GRD_T");G-Grade ;
 73;lst_alias(D_OB);I-Imprime ;
 80;tb_pesq(D_OB);P-Pesquisa Chave;
 79;tb_index(D_OB);O-Ordena ;
 67;tb_locate(D_OB);C-Continua ;
 84;tb_locate(D_OB);T-Trecho ;
 76;tb_locate(D_OB);L-Iniciais ;
:TBFI
Tipo;PTIPO;C;@S5;  5;;
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;;
