SG_R;Saldos por Marcas;sys_tbbrow;3; 1;22;79;padrao;;
:SKEL
* VARIAVEL Z_F1 = 'DbSetFilter({||peatual>0},"peatual>0")'
* 77;Cibrow("SG_RM",,"SG_RM");M-Modelos ;
VARIAVEL z_nil = log_si_proc("TOTREF","VIEW")
# VARIAVEL z_nil = log_si_proc("TOTREFL","VIEW")
VARIAVEL w_colsep = " "+chr(179)
:TBMT
 13;Cibrow("SG_RT",,"SG_RT");Enter-Tipos ;
 32;if(Peatual>0,Cibrow("SG_RL",,"SG_RL"),Mensagem("O Saldo da Marca "+alltrim(pref)+" esta Zerado...",1));Barra-Lojas ;
 47;disp_sdse(pref,"R");/-Demanda ;
 71;Cibrow("SG_GRD_R",,"SG_GRD_R");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
Marca;PREF;C;@S15; 15;;
Estoq;PEATUAL;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;;
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;;
ABC;Abcv1q+abcv2q+abcv3q;C;XXX;3;;
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;;
%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;;
