ARR_VND;("Vendedores na "+x_tmp[1]);sys_tbbrow; 3;0;23;79;x;;
:SKEL
VARIAVEL W_footSEP = "="
VARIAVEL w_colsep = chr(179)
VARIAVEL w_headsep = chr(196)
VARIAVEL Z_BLOCK = {|x_vnd| sf_vend->(dbgoto(x_vnd)), "Th"+strzero(floja,2)+if(fnumero>0,if(ffg_demit," - d -"," m"+strzero(fnumero,4))+" "+sf_vend->nome," c"+strzero(x_vnd,4)+" -Inativo-") }
//VARIAVEL Z_BLs1 = {|x| asort(v_vnd,,,_createblock("if(x[6]>0,x[2]/x[6],0)>if(y[6]>0,y[2]/y[6],0)"))}
*VARIAVEL v_vnd = asort( v_vnd,,,{|x,y| x[2]>y[2] } )
:TBMT
 13;Eval(Z_BLs1);Enter-Medias ;
:TBFI
Rk Vendedor;Str(nrow,3)+" "+eval( z_block, v_vnd[nrow,1]);C;@s30;30;;
Venda;v_vnd[nrow,2];N;@E 9,999,999;9;;
Tempo   Med/Dia;left(dma_str(sf_vend->fdtadmis),6)+" | "+Transform(if(v_vnd[nrow,6]>0,v_vnd[nrow,2]/v_vnd[nrow,6],0),"@e 99,999");C;@s15;15;;
Unids  Cups   MedPrd;Transform( v_vnd[nrow,4],"@e 99,999")+" "+Transform( v_vnd[nrow,5],"@e 99,999")+" "+Str( if(v_vnd[nrow,5]>0,v_vnd[nrow,4]/v_vnd[nrow,5],0),6,2);N;@s20;20;;
:TBFO
"Totais: ";
Transform( x_tmp[4], if(x_tmp[4]<=9999999,"@E 9,999,999","@E 99999,999"));
Str(if(x_tmp[17]>0,100*x_tmp[4]/x_tmp[17],0),5,1)+"% Geral";
" ";
