<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% ' *** Restrict Access To Page: Grant or deny access to this page MM_authorizedUsers="ADMIN,GERENTE" MM_authFailedURL="login.asp" MM_grantAccess=false If Session("MM_Username") <> "" Then If (false Or CStr(Session("MM_UserAuthorization"))="") Or _ (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then MM_grantAccess = true End If End If If Not MM_grantAccess Then MM_qsChar = "?" If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&" MM_referrer = Request.ServerVariables("URL") if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString() MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer) Response.Redirect(MM_authFailedURL) End If %> <% Dim zonas Dim zonas_numRows Set zonas = Server.CreateObject("ADODB.Recordset") zonas.ActiveConnection = MM_maq_STRING zonas.Source = "SELECT distinct(ZONA) FROM USUARIOS where ZONA<>''" zonas.CursorType = 0 zonas.CursorLocation = 2 zonas.LockType = 1 zonas.Open() zonas_numRows = 0 %> <% Dim rp__DESD rp__DESD = "1/1/04" If (DES <> "") Then rp__DESD = DES End If %> <% Dim rp__HASD rp__HASD = "1/1/05" If (HAS <> "") Then rp__HASD = HAS End If %><% Dim ents__VZONA ents__VZONA = "WHERE ZONA='" + strreplace(session("ZONA"), "'", "''") + "' " If (request("ZONA") <> "") Then if Session("MM_UserAuthorization")="ADMIN" then ents__VZONA = " WHERE ZONA='" + strreplace(request("ZONA"), "'", "''") + "' " End If If Session("MM_UserAuthorization")="ADMIN" then if (request("ZONA") = "*") or (request("ZONA") = "") Then ents__VZONA ="" '" +ents__VZONA + " %> <% Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_maq_STRING MM_editCmd.CommandText = "CALL REP5 ('" + strreplace(rp__DESD, "'", "''") + "','" + strreplace(rp__HASD, "'", "''") + " ') " 'response.Redirect("es.asp?cmd="+MM_editQuery) MM_editCmd.Execute MM_editCmd.ActiveConnection.Close %> <%'('" + strreplace(rp__DESD, "'", "''") + "','" + strreplace(rp__HASD, "'", "''") + " ') " +ents__VZONA+ " %> <% Dim rp Dim rp_numRows Set rp = Server.CreateObject("ADODB.Recordset") rp.ActiveConnection = MM_maq_STRING rp.Source = "SELECT IDCTE, NOMBRE, IDCLIENTE, CLIENTES, NUM_COTS, COTS, NUM_VTAS, VENTAS, NUM_PENDS, PENDS, FIN, NUMGFC, ZONA, EF_VENTAS, EF_VENTAS_DOLARES, EF_CTE_PORC FROM REP5 "+ents__VZONA+" ORDER BY ZONA,COTS DESC,NUM_VTAS DESC" rp.CursorType = 0 rp.CursorLocation = 2 rp.LockType = 1 rp.Open() rp_numRows = 0 %> <% Dim Repeat2__numRows Dim Repeat2__index Repeat2__numRows = -1 Repeat2__index = 0 rp_numRows = rp_numRows + Repeat2__numRows %> <% Dim Repeat3__numRows Dim Repeat3__index Repeat3__numRows = -1 Repeat3__index = 0 rp_numRows = rp_numRows + Repeat3__numRows %> <%rem response.Redirect("es.asp?cmd="+cpos(4))%> www.promad.com.mx
 
?ZONA=<%=REQUEST("ZONA") %>&ml=true&DESDE=<%= Request("DESDE") %>&HASTA=<%= Request("HASTA") %>">Enviar por correo
Regresar a Menú de Reportes Resumen de Vendedores
  TODOS LOS VALORES SON EN DOLARES
" method="post" name="ZN" id="ZN"> <% if Session("MM_UserAuthorization")="ADMIN" then ' Adv Conditional Region %> <% end if 'Session("MM_UserAuthorization")="ADMIN" %> ?DESDE=<%=strMPasado %>&ZONA=<%=REQUEST("ZONA") %>');return document.MM_returnValue" value="< Ver el Mes Pasado"> ?DESDE=<%=HAS %>&ZONA=<%=REQUEST("ZONA") %>');return document.MM_returnValue" value="Ver el Sig Mes >"> "> ">
ZONAS
 
<% Session.LCID = 1034 %> Reporte desde <%= DoDateTime( DES , 1, -1) %> - Hasta <%= DoDateTime( HAS, 1, -1) %> <% Session.LCID = 1033 %>  
  <% While ((Repeat2__numRows <> 0) AND (NOT rp.EOF)) %> "> <% Repeat2__index=Repeat2__index+1 Repeat2__numRows=Repeat2__numRows-1 rp.MoveNext() Wend %>
  <%nfn=0 'numero de financiadas GFC %> NOMBRE CLIENTES Numero de Cotizaciones Valor de Cotizaciones Numero de Ventas Valor de las ventas (USD) Número de Cotizaciones pendientes Valor de Cotizaciones Pendientes Valor de Cotizaciones Financiadas por GFC ZONA Efectividad de Ventas Efectividad de Ventas por Dinero Efectividad de Ventas por Cliente
&IDVENDEDOR=<%=RP("IDCLIENTE") %>&bu4=busc" target="_blank">Clientes de Este Vendedor &DESDE=<%= Request("DESDE") %>&HASTA=<%= Request("HASTA") %>&NOME=<%=TRIM(RP("NOMBRE")) %>&IDVENDEDOR=<%=RP("IDCLIENTE") %>" target="_blank"> <%=ucase(rp.Fields.Item("NOMBRE").Value)%> <%=(rp("CLIENTES"))%> <% cob=cob+rp("CLIENTES")%> <%=(rp.Fields.Item("NUM_COTS").Value)%> <%tcs=tcs+rp("NUM_COTS") %> <%= FormatCurrency((rp.Fields.Item("COTS").Value), 2, -2, -2, -2) %> <% cs=cs+cdbl(rp("COTS")) %> <%=(rp.Fields.Item("NUM_VTAS").Value)%> <% vs=vs+cdbl(RP("NUM_VTAS")) 'SUMA VTAS %> <%= FormatCurrency((rp.Fields.Item("VENTAS").Value), 2, -2, -2, -2) %> <%tvs=tvs+rp("VENTAS") %> <%=(rp.Fields.Item("NUM_PENDS").Value)%> <%cis=cis+cdbl(rp("NUM_PENDS")) %> <%= FormatCurrency((rp.Fields.Item("PENDS").Value), 2, -2, -2, -2) %> <% if not isnull(rp("FIN")) then ' Adv Conditional Region %> <%= FormatCurrency((rp.Fields.Item("FIN").Value), 2, -2, -2, -2) %> <%fn=fn+RP("FIN") %> <%nfn=nfn+rp("numgfc" ) %> <% end if 'not isnull(rp("FIN")) %> <%=(rp.Fields.Item("ZONA").Value)%> <% val=rp("EF_VENTAS") if val>100 then val=val/10000 pre="" aft="" if val" aft="" end if val=pre+cstr(val)+"%"+aft %> <%=VAL%> <% val=rp("EF_VENTAS_DOLARES") if val>100 then val=val/10000 pre="" aft="" if val" aft="" end if val=pre+cstr(val)+"%"+aft %> <%=VAL%> <% val=rp("EF_CTE_PORC") if val>100 then val=val/10000 pre="" aft="" if val" aft="" end if val=pre+cstr(val)+"%"+aft %> <%=VAL%>

<% if request("ml")<>"" then 'envia reporte por correo Session.LCID = 2058 repc="Reporte Desde " +DoDateTime( DES , 1, -1)+"- Hasta "+ DoDateTime( HAS, 1, -1) Session.LCID = 1033 repc="" for i=0 to Ubound(head) if instr(oclt,head(i))<=0 then repc=repc+"" end if next repc=repc+"" While ((Repeat1__numRows <> 0) AND (NOT ents.EOF)) repc=repc+"" for i=0 to Ubound(head)-1 if instr(oclt,head(i))<=0 then repc=repc+"" end if next repc=repc+"" repc=repc+"" Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 ents.MoveNext() Wend repc=repc+"
 " +head(i) + " 
" val=ents(cpos(i)) if isnumeric (ents(cpos(i))) then IF head(i)="VENTAS" or head(i)="COTS" or head(i)="CAIDO" THEN if not Isnull(ents(cpos(i))) and ents(cpos(i))<>"" then val=FormatCurrency(ents(cpos(i)), 2, -2, -2, -2) if head(i)="VENTAS" then vs=vs+cdbl(ents(cpos(i))) if head(i)="COTS" then cs=cs+cdbl(ents(cpos(i))) if head(i)="CAIDO" then cis=cis+cdbl(ents(cpos(i))) end if END IF end if IF head(i)="NUM_COTS" then tcs=tcs+ents(cpos(i)) IF head(i)="NUM_VTAS" then tvs=tvs+ents(cpos(i)) IF head(i)="CLIENTES" then cob=cob+ents(cpos(i)) IF head(i)="FIN" then fn=fn+ents(cpos(i)) if not isnull(val) then repc=repc+cstr(val) repc=repc+"
" repc=repc+"" repc=repc+"" repc=repc+"
Cobertura de Clientes:" +CSTR(cob)+"
Total de Cotizaciones en El periodo: " + FormatCurrency(cs, 2, -2, -2, -2) +" | " + CSTR(tcs) +"
Número de Cotizaciones con Financiamiento (FIN):" + CSTR(fn) + "
Procentaje Cotizado con Financiamiento :" + FormatPercent(fn/(tcs)) repc=repc+"
Total de Ventas: " + FormatCurrency(vs, 2, -2, -2, -2) + " | " +CSTR(tvs) +"
Porcentaje de Realizacion de Cotizaciones:" + FormatPercent(tvs/(tcs)) + "
" Dim objCDO Set objCDO = Server.CreateObject("CDONTS.NewMail") objCDO.From = "crm@promad.com.mx" objCDO.To = session("EMAIL") objCDO.CC = "" objCDO.BodyFormat=0 objCDO.Subject = "Envío de Reporte Gerencial" objCDO.Body = "Reporte Gerencial de fecha " + cstr(date()) +"


" +repc+ "

" +"
Preguntas y soporte support@xnet.com.mx" + "


" + "Servicio Proveído por http://xnet.com.mx." objCDO.Send() Set objCDO = Nothing ents.movefirst 'Response.Redirect("users.asp") end if %>
Cobertura de Clientes:<%'=cob %>

RESUMEN        
Clave de Color para Valores de Efectividad,
Rojo Valor de efectividad
menores a <%=PORCBAD %>%
  Número Dolares Porcentaje  
Total de Cotizaciones en El periodo: <%=tcs%> <%= FormatCurrency(cs, 2, -2, -2, -2) %> 100%  
         
Número de Cotizaciones con Financiamiento Caterpillar(GFC): <%=nfn %> <%= FormatCurrency(fn, 2, -2, -2, -2) %> <%= FormatPercent(fn/(cs)) %>  
Número de Cotizaciones con Financiamiento PROMAD y AGRICREDIT: <%=tcs-nfn %> <%=FormatCurrency(CS-fn, 2, -2, -2, -2) %> <%= FormatPercent((cs-fn)/(cs)) %>  
         
Total de Ventas: <%=(vs)%> <%= FormatCurrency(tvs, 2, -2, -2, -2) %> <%= FormatPercent((vs)/(cs)) %>  




 
 
<% zonas.Close() Set zonas = Nothing %> <% rp.Close() Set rp = Nothing %>