%@ LANGUAGE = "VBScript" %> <% Session.Timeout = 120 Server.ScriptTimeout = 5000 busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.Form("Date_ini") Date_end=Request.Form("Date_end") lvende=Request.Form("cvende") cmes=Request.Form("cmes") canno=Request.Form("canno") if cmes="" then cmes=month(date) canno=year(date) end if criterio22=Request.Form("criterio22") if criterio22="" then xcriterio22=" Todos " end if lspace=" " apostrofe="'" if Date_ini="" or Date_ini=null then Date_ini=date()-(day(date()))+1 Date_end=date() end if '''''''''''calcula layer=weekday(date()-1) If layer = 1 Then Date_ini=date()-3 Date_end=date()-3 else if layer=7 then Date_ini=date()-2 Date_end=date()-2 else Date_ini=date()-1 Date_end=date()-1 end if end if strday = Right("00" & Day(Date_ini), 2) strmonth = Right("00" & Month(Date_ini), 2) stryear = Right("00" & (Year(Date_ini) - 1), 4) strday2 = Right("00" & Day(Date_end), 2) strmonth2 = Right("00" & Month(Date_end), 2) stryear2 = Right("00" & (Year(Date_end) - 1), 4) fechainicial2 = Cstr(stryear + strmonth + strday) fechafinal2 = Cstr(stryear2 + strmonth2 + strday2) lperiod1 = stryear & "-" & strmonth & "-" & strday lperiod2 = stryear2 & "-" & strmonth2 & "-" & strday2 period1 = lperiod1 period2 = lperiod2 '************** Transfer strday = Right("00" & Day(date), 2) strmonth = Right("00" & Month(date), 2) stryear = Right("00" & Year(date), 4) strday2 = Right("00" & Day(date+1), 2) strmonth2 = Right("00" & Month(date)+1, 2) stryear2 = Right("00" & Year(date+1), 4) lmonth = Month(Date)-1 'lmonth =4 If lmonth = 1 Or lmonth = 3 Or lmonth = 5 Or lmonth = 7 Or lmonth = 8 Or lmonth = 10 Or lmonth = 0 Then ldiasmes = 31 End If If lmonth = 2 Then ldiasmes = 29 End If If lmonth = 4 Or lmonth = 6 Or lmonth = 9 Or lmonth = 11 Then ldiasmes = 30 End If lmonth1 = Month(Date) 'lmonth1 = 5 If lmonth1 = 1 Or lmonth1 = 3 Or lmonth1 = 5 Or lmonth1 = 7 Or lmonth1 = 8 Or lmonth1 = 10 Or lmonth1 = 12 Then ldiasmes1 = 31 End If If lmonth1 = 2 Then ldiasmes1 = 29 End If If lmonth1 = 4 Or lmonth1 = 6 Or lmonth1 = 9 Or lmonth1 = 11 Then ldiasmes1 = 30 End If strmesini = Right("00" & lmonth, 2) strday2 = Right("00" & ldiasmes, 2) if cmes="" then lfecinicio= CStr(canno & strmonth & "01") lfecfinal= CStr(canno & strmonth & strday) lfecinicial=CStr(right("00"&year(date),4)+right("00"&month(date),2) + "01") ldiasmesx=ldiasmes1 else lmonth = cmes 'lmonth =4 If lmonth = 1 Or lmonth = 3 Or lmonth = 5 Or lmonth = 7 Or lmonth = 8 Or lmonth = 10 Or lmonth = 0 Then ldiasmes = 31 End If If lmonth = 2 Then ldiasmes = 29 End If If lmonth = 4 Or lmonth = 6 Or lmonth = 9 Or lmonth = 11 Then ldiasmes = 30 End If cmes2=right("00"&cmes,2) canno=right("0000"&year(date),4) lfecinicio= CStr(canno & cmes2 & "01") lfecfinal= CStr(canno & cmes2 & ldiasmes) lfecinicial=CStr(right("00"&year(date),4)+right("00"&month(date),2) + "01") ldiasmesx=ldiasmes end if 'lfecinicio 'lfecfinal 'Set rsvende = Server.CreateObject("ADODB.RecordSet") xtipo="VENDEDOR" 'rsvende.CursorType = adOpenDynamic 'set rsvende=dbsql.execute("SELECT major_cd, minor_cd, code_nm FROM sta010t WHERE (((major_cd)='9001')) ORDER BY minor_cd") %>
| <% if cmes<>"" then %> <%=MonthName(cmes, False) %> <% else %> <%= MonthName(Month(Date), False) %> <%end if %> | <%=time()%> | QTY | <% xnumerodias=0 for i=lbound(SalesDias) to ubound(SalesDias) %><%=SalesDias(i,0)%> |
<%
if SalesDias(i,0)>0 then
xnumerodias=xnumerodias+1
end if
next
%>
TOTAL |
% |
|---|---|---|---|---|---|
SAMSUNG |
Out Box (printing) | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,12),0)%> |
<%
xtotsamprint=xtotsamprint+SalesDias(i,12)
next
%>
<%=formatnumber(xtotsamprint,0)%> |
<%=formatnumber(xtotsamprint/xnumerodias,0)%> |
| Spot Label | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,13),0)%> |
<%
xtotsamspot=xtotsamspot+SalesDias(i,13)
next
%>
<%=formatnumber(xtotsamspot,0)%> |
<%=formatnumber(xtotsamspot/xnumerodias,0)%> |
|
| Full Litho | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,10),0)%> |
<%
xtotsamfull=xtotsamfull+SalesDias(i,10)
next
%>
<%=formatnumber(xtotsamfull,0)%> |
<%=formatnumber(xtotsamfull/xnumerodias,0)%> |
|
| OB Total | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %>
<%=formatnumber(SalesDias(i,13)+SalesDias(i,12)+SalesDias(i,10),0)%> |
<%
xtotsamob=xtotsamob+SalesDias(i,13)+SalesDias(i,12)+SalesDias(i,10)
next
%>
<%=formatnumber(xtotsamob,0)%> |
<%=formatnumber(xtotsamob/xnumerodias,0)%> |
|
| <% for i=lbound(SalesDias) to ubound(SalesDias) %> | <% next %> | ||||
| Inbox | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,11),0)%> |
<%
xtotsaminb=xtotsaminb+SalesDias(i,11)
next
%>
<%=formatnumber(xtotsaminb,0)%> |
<%=formatnumber(xtotsaminb/xnumerodias,0)%> |
|
| VB / Others | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,21)+SalesDias(i,22),0)%> |
<%
xtotsamot=xtotsamot+SalesDias(i,21)+SalesDias(i,22)
next
%>
<%=formatnumber(xtotsamot,0)%> |
<%=formatnumber(xtotsamot/xnumerodias,0)%> |
|
| TOTAL | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,21)+SalesDias(i,22)+SalesDias(i,13)+SalesDias(i,12)+SalesDias(i,11)+SalesDias(i,10),0)%> |
<%
xtotsamfg=xtotsamfg+SalesDias(i,21)+SalesDias(i,22)+SalesDias(i,13)+SalesDias(i,12)+SalesDias(i,11)+SalesDias(i,10)
next
%>
<%=formatnumber(xtotsamfg,0)%> |
<%=formatnumber(xtotsamfg/xnumerodias,0)%> |
|
Top 5 JBL, DJO, Stephen Gould, BOSE, Plantronics |
Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,14),0)%> |
<%
xtotaltop5=xtotaltop5+SalesDias(i,14)
next
%>
<%=formatnumber(xtotaltop5,0)%> |
<%=formatnumber(xtotaltop5/xnumerodias,0)%> |
|
| Others QTY | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,4),0)%> |
<%
xtotalothqty=xtotalothqty+SalesDias(i,4)
next
%>
<%=formatnumber(xtotalothqty,0)%> |
<%=formatnumber(xtotalothqty/xnumerodias,0)%> |
|
| TOTAL | Sales | <% for i=lbound(SalesDias) to ubound(SalesDias) %><%=formatnumber(SalesDias(i,7),0)%> |
<%
xtotalqty=xtotalqty+SalesDias(i,7)
next
%>
<%=formatnumber(xtotalqty,0)%> |
<%=formatnumber(xtotalqty/xnumerodias,0)%> |
|