INDEX temp0mlj 999999-TGSS 
OUTROARQ SE_PROD SEIP_C PCOD 

VARIAVEL LST_TP   = 58 
VARIAVEL Z_NPROD  = 0 
VARIAVEL Z_REF    = Spac(15)
VARIAVEL Z_MODElo = Spac(20)
VARIAVEL Z_tipo   = Spac(5)
VARIAVEL Z_lj     = "00"
VARIAVEL Z_qtdmin = 5 
VARIAVEL Z_d7nat= "N"
VARIAVEL Z_d1jpa= "N"
VARIAVEL Z_d5Cge= "N"
VARIAVEL Z_d2jpa= "N"
VARIAVEL Z_d6jpa= "N"
VARIAVEL Z_d3Man= "N"
VARIAVEL Z_d4tam= "N"
VARIAVEL Z_d8Cge= "N"

VARIAVEL Z_d_ljs  = "N"
VARIAVEL Z_LJS    = ""

T07,10,19,70,Parametros
T2,2,Loja..:,20,z_lj,99
T3,2,QtdMin:,20,z_qtdmin,9999
T5,2,Tipo..:,5,z_tipo,@!5
T6,2,Marca.:,15,z_ref,@!15
T7,2,Modelo:,20,z_modelo,@!20

T2,34,Destaca S7-Nat  ?,1,Z_d7nat,!
T3,34,Destaca S1-JPA  ?,1,Z_d1jpa,!
T4,34,Destaca S5-Cge  ?,1,Z_d5Cge,!
T5,34,Destaca S2-Jpa1 ?,1,Z_d2jpa,!
T6,34,Destaca S6-Jpa2 ?,1,Z_d6jpa,!
T7,34,Destaca S3-Man  ?,1,Z_d3Man,!
T8,34,Destaca S4-tam  ?,1,Z_d4tam,!
T9,34,Destaca S8-Cge  ?,1,Z_d8Cge,!

COMANDO ANTES Z_LJS = if(z_d_ljs="S", var_get(12,30,spac(60),"@s20"), "")

COMANDO DURANTEAF z_pcod = PCOD 
COMANDO DURANTEAF se_prod->( dbSeek( z_pcod ))
COMANDO DURANTEAF z_est_ss_lj = if( z_lj<>"00", fr_eval("estth"+z_lj+"+ssth"+z_lj), 0)
FILTRO z_lj="00".or.z_est_ss_lj>0
FILTRO (z_tipo=spac(5).or.se_prod->ptipo=z_tipo).and.(z_ref=spac(15).or.z_ref=se_prod->pref).and.(z_modelo=spac(20).or.z_modelo=se_prod->pmarcamode)

COMANDO DURANTE Z_NPROD = Z_NPROD + 1 

35
38
39

VARIAVEL Z_C7nat= "th29 th30 th31 th32 th33 th35 th36 "
VARIAVEL Z_C1jpa= "th01 th04 th09 th13 th19 th34 "
VARIAVEL Z_C5Cge= "th07 th17 th20 th23 th24 "
VARIAVEL Z_C2jpa= "th06 th12 th15 th37 "
VARIAVEL Z_C6jpa= "th05 th38 "
VARIAVEL Z_C3Man= "th02 th08 th28 "
VARIAVEL Z_C4tam= "th21 th22 th26 "
VARIAVEL Z_C8Cge= "th10 th25 th39 "
VARIAVEL Z_CxOut= "th03 th11 th18 th27 "

COMANDO ANTES z_cab = if(Z_d1jpa="S", Z_C1jpa, "Jpa1 ") + if(Z_d2jpa="S", Z_C2jpa, "jpa2 ")+if(Z_d6jpa="S", Z_C6jpa, "Jpa6 ") + if(Z_d4tam="S", Z_C4tam, "tam4 ")
COMANDO ANTES z_cab = z_cab + if(Z_d3man="S", Z_C3man, "man3 ") + if(Z_d7nat="S", Z_C7nat, "Nat7 ")+ if(Z_d5cge="S", Z_C5cge, "Cge5 ") + if(Z_d8cge="S", Z_C8cge, "cge8 ")

COMANDO DURANTE ZsS7nat= str(ssth29+ssth30+ssth31+ssth32+ssth33+ssth35+ssth36,4)+" "
COMANDO DURANTE ZsS1jpa= str(ssth01+ssth04+ssth09+ssth13+ssth19+ssth34,4)+" "
COMANDO DURANTE ZsS3Man= str(ssth02+ssth08+ssth28,4)+" "
COMANDO DURANTE ZsS5Cge= str(ssth07+ssth17+ssth20+ssth23+ssth24,4)+" "
COMANDO DURANTE ZsS4tam= str(ssth21+ssth22+ssth26,4)+" "
COMANDO DURANTE ZsS8Cge= str(ssth10+ssth25+ssth39,4)+" "
COMANDO DURANTE ZsS2jpa= str(ssth06+ssth12+ssth15+ssth37,4)+" "
COMANDO DURANTE ZsS6jpa= str(ssth05+ssth38,4)+" "
//COMANDO DURANTE ZssXOut= str(ssth03+ssth11+ssth27+ssth18,4)+" "

COMANDO DURANTE Zest7nat= str(estth29+estth30+estth31+estth32+estth33+estth35+estth36,4)+" "
COMANDO DURANTE Zest1jpa= str(estth01+estth04+estth09+estth13+estth19+estth34,4)+" "
COMANDO DURANTE Zest3Man= str(estth02+estth08+estth28,4)+" "
COMANDO DURANTE Zest5Cge= str(estth07+estth17+estth20+estth23+estth24,4)+" "
COMANDO DURANTE Zest4tam= str(estth21+estth22+estth26,4)+" "
COMANDO DURANTE Zest8Cge= str(estth10+estth25+estth39,4)+" "
COMANDO DURANTE Zest2jpa= str(estth06+estth12+estth15+estth37,4)+" "
COMANDO DURANTE Zest6jpa= str(estth05+estth38,4)+" "
//COMANDO DURANTE ZestXout= str(estth03+estth11+estth18+estth27,4)+" "

COMANDO DURANTE Z_S7nat= str(ssth29,4)+" "+str(ssth30,4)+" "+str(ssth31,4)+" "+str(ssth32,4)+" "+str(ssth33,4)+" "+str(ssth35,4)+" "+str(ssth36,4)+" "
COMANDO DURANTE Z_S1jpa= str(ssth01,4)+" "+str(ssth04,4)+" "+str(ssth09,4)+" "+str(ssth13,4)+" "+str(ssth19,4)+" "+str(ssth34,4)+" "
COMANDO DURANTE Z_S3Man= str(ssth02,4)+" "+str(ssth08,4)+" "+str(ssth28,4)+" "
COMANDO DURANTE Z_S5Cge= str(ssth07,4)+" "+str(ssth17,4)+" "+str(ssth20,4)+" "+str(ssth23,4)+" "+str(ssth24,4)+" "
COMANDO DURANTE Z_S4tam= str(ssth21,4)+" "+str(ssth22,4)+" "+str(ssth26,4)+" "
COMANDO DURANTE Z_S8Cge= str(ssth10,4)+" "+str(ssth25,4)+" "+str(ssth39,4)+" "
COMANDO DURANTE Z_S2jpa= str(ssth06,4)+" "+str(ssth12,4)+" "+str(ssth15,4)+" "+str(ssth37,4)+" "
COMANDO DURANTE Z_S6jpa= str(ssth05,4)+" "+str(ssth38,4)+" "
//COMANDO DURANTE Z_SxOut= str(ssth03,4)+" "+str(ssth11,4)+" "+str(ssth18,4)+" "+str(ssth27,4)+" "

COMANDO DURANTE Z_e7nat= str(estth29,4)+" "+str(estth30,4)+" "+str(estth31,4)+" "+str(estth32,4)+" "+str(estth33,4)+" "+str(estth35,4)+" "+str(estth36,4)+" "
COMANDO DURANTE Z_e1jpa= str(estth01,4)+" "+str(estth04,4)+" "+str(estth09,4)+" "+str(estth13,4)+" "+str(estth19,4)+" "+str(estth34,4)+" "
COMANDO DURANTE Z_e3Man= str(estth02,4)+" "+str(estth08,4)+" "+str(estth28,4)+" "
COMANDO DURANTE Z_e5Cge= str(estth07,4)+" "+str(estth17,4)+" "+str(estth20,4)+" "+str(estth23,4)+" "+str(estth24,4)+" "
COMANDO DURANTE Z_e4tam= str(estth21,4)+" "+str(estth22,4)+" "+str(estth26,4)+" "
COMANDO DURANTE Z_e8Cge= str(estth10,4)+" "+str(estth25,4)+" "+str(estth39,4)+" "
COMANDO DURANTE Z_e2jpa= str(estth06,4)+" "+str(estth12,4)+" "+str(estth15,4)+" "+str(estth37,4)+" "
COMANDO DURANTE Z_e6jpa= str(estth05,4)+" "+str(estth38,4)+" "
//COMANDO DURANTE Z_ExOut= str(estth03,4)+" "+str(estth11,4)+" "+str(estth18,4)+" "+str(estth27,4)

COMANDO DURANTE z_css = if(Z_d7nat="S", Z_s7nat,zss7Nat)+ if(Z_d1jpa="S", Z_s1jpa,zss1Jpa) + if(Z_d5cge="S", Z_s5cge,zss5Cge) + if(Z_d2jpa="S", Z_s2jpa,zss2jpa)
COMANDO DURANTE z_css = z_css+if(Z_d6jpa="S", Z_s6jpa,zss6Jpa) + if(Z_d3man="S", Z_s3man,zss3man) + if(Z_d4tam="S", Z_s4tam,zss4tam) + if(Z_d8cge="S", Z_s8cge,zss8cge)
COMANDO DURANTE z_ces = if(Z_d7nat="S", Z_e7nat,zest7Nat)+ if(Z_d1jpa="S", z_e1jpa,zest1Jpa) + if(Z_d5cge="S", z_e5cge,zest5Cge) + if(Z_d2jpa="S", z_e2jpa,zest2jpa)
COMANDO DURANTE z_ces = z_ces+if(Z_d6jpa="S", z_e6jpa,zest6Jpa) + if(Z_d3man="S", z_e3man,zest3man) + if(Z_d4tam="S", z_e4tam,zest4tam) + if(Z_d8cge="S", z_e8cge,zest8cge)

COMANDO DURANTE Z_STRSS =           str(ssth01,4)+" "+str(ssth02,4)+" "+str(ssth04,4)+" "+str(ssth05,4)+" "+str(ssth06,4)+" "+str(ssth07,4)+" " 
COMANDO DURANTE Z_STRSS = z_strss + str(ssth08,4)+" "+str(ssth09,4)+" "+str(ssth10,4)+" "+str(ssth12,4)+" "+str(ssth13,4)+" "+str(ssth15,4)+" " 
COMANDO DURANTE Z_STRSS = z_strss + str(ssth17,4)+" "+str(ssth19,4)+" "+str(ssth20,4)+" "+str(ssth21,4)+" "+str(ssth22,4)+" "+str(ssth23,4)+" " 
COMANDO DURANTE Z_STRSS = z_strss + str(ssth24,4)+" "+str(ssth25,4)+" "+str(ssth26,4)+" "+str(ssth28,4)+" "+str(ssth29,4)+" "+str(ssth30,4)+" "
COMANDO DURANTE Z_STRSS = z_strss + str(ssth31,4)+" "+str(ssth32,4)+" "+str(ssth33,4)+" "+str(ssth34,4)
 
COMANDO DURANTE Z_STReS =           str(estth01,4)+" "+str(estth02,4)+" "+str(estth04,4)+" "+str(estth05,4)+" "+str(estth06,4)+" "+str(estth07,4)+" "
COMANDO DURANTE Z_STReS = z_stres + str(estth08,4)+" "+str(estth09,4)+" "+str(estth10,4)+" "+str(estth12,4)+" "+str(estth13,4)+" "+str(estth15,4)+" "
COMANDO DURANTE Z_STReS = z_stres + str(estth17,4)+" "+str(estth19,4)+" "+str(estth20,4)+" "+str(estth21,4)+" "+str(estth22,4)+" "+str(estth23,4)+" "
COMANDO DURANTE Z_STReS = z_stres + str(estth24,4)+" "+str(estth25,4)+" "+str(estth26,4)+" "+str(estth28,4)+" "+str(estth29,4)+" "+str(estth30,4)+" "
COMANDO DURANTE Z_STReS = z_stres + str(estth31,4)+" "+str(estth32,4)+" "+str(estth33,4)+" "+str(estth34,4)
 
FILTRO TGSS>=z_qtdmin
 
CProdutos Vendidos por Lojas no periodo de [w_mvde] a [w_mvate]    Pag [pag 999]   Tipo: [z_tipo]   Marca:[z_ref]   Modelo:[z_modelo]
C=========================================================================================================================================================================================
*Cod   Descricao                               th01 th02 th04 th05 th06 th07 th08 th09 th10 th12 th13 th15 th17 th19 th20 th21 th22 th23 th24 th25 th26 th28 th29 th30 th31 th32 th33 th34
CCod   Descricao                               [z_cab]
C=========================================================================================================================================================================================
//D[pcod 99999] [se_prod->pdesc @s30] Ss: [tgss 9999] [Z_STRsS] 
//D                                     Es: [tgest 9999] [Z_STReS] 

D[pcod 99999] [se_prod->pdesc @s30] Ss: [tgss 9999] [Z_csS] 
D                                     Es: [tgest 9999] [Z_ceS] 

D 
ULTPAG 
ULTPAG=========================================================================================================================================================================================
 
