%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.Buffer = False%>
<%
Session.LCID = 1033
on error resume next
Session("turno")=""
'Session.Timeout = 120
Server.ScriptTimeout = 10000
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")
criterio22=Request.Form("criterio22")
if criterio22="" then
xcriterio22=" Todos "
end if
cdias=1
if Date_ini="" or Date_ini=null then
'Date_ini=date()-(day(date()))+1
Date_ini=date()-1
Date_end=date()-1
end if
dia1=right("00"&day(Date_ini),2)
mes1=right("00"&month(Date_ini),2)
anno1=right("00"&year(Date_ini),4)
'Date_inii=cdate(dia1+"/"+mes1+"/"+anno1)
cfechai=cdbl(anno1+mes1+dia1)
xday = Right("00" & Day(Date), 2)
xmonth = Right("00" & Month(Date), 2)
xyear = Right("00" & Year(Date), 4)
xdate=xyear&xmonth&xday
dia2=right("00"&day(Date_end),2)
mes2=right("00"&month(Date_end),2)
anno2=right("00"&year(Date_end),4)
'cfechaf=cdate((dia2+"/"+mes2+"/"+anno2))
cfechaf=cdbl(anno2+mes2+dia2)
cdias=DateDiff("d",Date_ini,Date_end)+1
''''''''''''''''''''''''''''''' inicio maquinas
Session("turno")=null
Dim aturno
aturno = Session("turno")
If isArray(aturno)=false Then
ReDim aturno(60,23)
for xx=1 to 60
aturno(xx,1)=""
next
aturno(0,1)="SUPER JUMBO"
aturno(1,1)="JUMBO FLEXO"
aturno(2,1)="MARTIN-1"
aturno(3,1)="MARTIN-2"
aturno(4,1)="WARD"
aturno(5,1)="ISOWA"
aturno(6,1)="ICHIKAWA"
aturno(7,1)="LANGSTON"
aturno(8,1)="McKinley"
aturno(9,1)="MARTIN 3"
aturno(10,1)="AIFEIER"
aturno(11,1)="MARTIN 4"
aturno(12,1)="RAPIDEX 2"
aturno(13,1)="PIN LONG"
aturno(14,1)="PINLONG 2"
aturno(15,1)="PIEMME"
aturno(16,1)="ISHIKAWA"
aturno(17,1)="MITSUBISHI"
aturno(18,1)="ISOWA 2"
aturno(19,1)="RAPIDEX 1"
aturno(20,1)="LANGSTON II"
aturno(21,1)="BOBST P3"
aturno(22,1)="GENCO"
aturno(23,1)="AUTOMAX 1"
aturno(24,1)="AUTOMAX 2"
aturno(25,1)="AUTOMAX 3"
aturno(26,1)="LABEL(STOCK)"
aturno(27,1)="Stock II"
aturno(28,1)="LABEL(MANUAL)"
aturno(29,1)="STOCK III"
aturno(30,1)="AUTOMAX +"
aturno(31,1)="GLUING"
aturno(32,1)="FOSHAN DUPLEX GLUER"
aturno(33,1)="SLITTER"
aturno(34,1)="STITCHING"
aturno(35,1)="PALLETIZE / STACK"
aturno(36,1)="V BOARDER 1"
aturno(37,1)="V BOARDER 2"
aturno(38,1)="V BOARDER 3"
aturno(0,19)="FLEXO"
aturno(1,19)="FLEXO"
aturno(2,19)="FLEXO"
aturno(3,19)="FLEXO"
aturno(4,19)="FLEXO"
aturno(5,19)="FLEXO"
aturno(6,19)="FLEXO"
aturno(7,19)="FLEXO"
aturno(8,19)="FLEXO"
aturno(9,19)="FLEXO"
aturno(10,19)="FLEXO"
aturno(11,19)="FLEXO"
aturno(12,19)="FLEXO"
aturno(13,19)="FLEXO"
aturno(14,19)="FLEXO"
aturno(15,19)="FLEXO"
aturno(16,19)="FLEXO"
aturno(17,19)="FLEXO"
aturno(18,19)="FLEXO"
aturno(19,19)="FLEXO"
aturno(20,19)="FLEXO"
aturno(21,19)="FLEXO"
aturno(22,19)="FLEXO"
aturno(23,19)="LABEL"
aturno(24,19)="LABEL"
aturno(25,19)="LABEL"
aturno(26,19)="LABEL"
aturno(27,19)="LABEL"
aturno(28,19)="LABEL"
aturno(29,19)="LABEL"
aturno(30,19)="OTHER"
aturno(31,19)="OTHER"
aturno(32,19)="OTHER"
aturno(33,19)="OTHER"
aturno(34,19)="OTHER"
aturno(35,19)="OTHER"
aturno(36,19)="OTHER"
aturno(36,19)="OTHER"
aturno(37,19)="OTHER"
aturno(38,19)="OTHER"
session("turno") = aturno
end if
aturno = Session("turno")
'''''''''''''''''''''''''''''''''''' fin maquinas
'set Rstarget=dbsql3.execute("select * from headcount where dia month year='" & aturno(i,1) & "'")
lturno1t=1
lturno2t=1
lturno3t=1
lturnotot=3
lturno1m=34
lturno2m=24
lturno3m=8
ltotmach=66
lturno1a=14
lturno2a=5
lturno3a=7
ltotaut=26
''''''''******* PERSONAL POR TURNO
Dim Rsfore0
Dim Sqlfore0
set Rsfore0=dbsql3.execute("SELECT * FROM forecast WHERE id=49")
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CDbl(stryear + strmonth + strday)
fechafinal = CDbl(stryear2 + strmonth2 + strday2)
xday2 = Right("00" & Rsfore0("month"), 2)
xmonth2 = Right("00" & Rsfore0("forecast"), 2)
xyear2 = Right("00" & Rsfore0("year"), 4)
xdate2=xyear2&xmonth2&xday2
''''''''''''''''''''''''''''''''''''''
If xdate>xdate2 Then
response.write (ErrorNo1)
else
%>
Report By Routingdatepicker demo
<%
header
%>
<%
'''''''''''calcula
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CStr(stryear + strmonth + strday)
fechafinal = CStr(stryear2 + strmonth2 + strday2)
'response.write(fechainicial)&" FI "
' response.write(fechafinal)&" Ff "
set Rsheadc=dbsql3.execute("select * from headcount where (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))>= '" & fechainicial & "' and (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))<= '" & fechafinal & "'")
response.write(day(Date_ini)&" "&month(Date_ini)&" "&year(Date_ini)&" "&cdias)
If Rsheadc.EOF And Rsheadc.BOF Then
'
else
lturno1t=0
lturno2t=0
lturno3t=0
lturnotot=0
Rsheadc.movefirst
Do While Not Rsheadc.EOF
if Rsheadc("planta")=1 or Rsheadc("planta")=3 then
if Rsheadc("turno")=1 then
lturno1t=lturno1t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
if Rsheadc("turno")=2 then
lturno2t=lturno2t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
if Rsheadc("turno")=3 then
lturno3t=lturno3t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
lturnotot=lturnotot+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
Rsheadc.MoveNext
Loop
end if
Rsheadc.close
set Rsheadc=nothing
if lturno1t=0 then
lturno1t=1
end if
if lturno2t=0 then
lturno2t=1
end if
if lturno3t=0 then
lturno3t=1
end if
if lturnotot=0 then
lturnotot=1
end if
%>
SINIL INDUSTRY Production By Machine - Shift Date: <%=Date_ini%> to <%=Date_end%> Generated: <%=time%>
<%
'************** Inventory
'lturno=0
Dim Rsinven1, Rsinven2, rswip, Rsmachine
Dim Sqlinven1, sqlinven2, sqlwip
'do while lturno<3
set Rsinven1=dbsql.execute("select a.prod_date, right(a.prod_date,6) prod_day, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end proc_cd,(select proc_nm from stb160t(nolock) where proc_cd = (case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end) ) as proc_nm, a.work_gubun, case a.work_gubun when '0' then '1S' when '1' then '2S' when '2' then '3S' end as wrok_gubun_nm, dbo.usf_no('B', '1', a.ord_date, a.ord_seq, 4, '-') as ord_no, b.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) as cust_nm, b.good_cd, b.good_nm, b.ord_qty, c.plan_qty, a.real_prod_qty, round(a.real_prod_qty * b.mae_m2 , 0) as prod_m2, a.bad_qty, a.extra_qty, isnull(a1.inv_qty,0) as inv_qty " & _
"from bob030t a(nolock) left outer join ( select crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq, sum(plan_qty) plan_qty from bob010t(nolock) group by crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq) c on a.crp_id = c.crp_id and a.goods_class = c.goods_class and a.ord_date = c.ord_date and a.ord_seq = c.ord_seq and a.plan_date = c.plan_date and a.plan_seq = c.plan_seq left outer join ( select a.crp_id, a.ord_no, sum(a.qty) inv_qty from inout_table a(nolock), bar_code b(nolock) where a.ord_no = 'B1' + substring(b.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), b.ord_seq), 4) and b.chk_bit = '1' and b.bar_code = a.bar_code and b.trans_date = a.job_date and a.class = '1' group by a.crp_id, a.ord_no) a1 on a.crp_id = a1.crp_id and 'B1' + substring(a.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), a.ord_seq), 4) = a1.ord_no , boa010t b(nolock) " & _
"where a.crp_id = b.crp_id and a.goods_class = b.goods_class and a.ord_date = b.ord_date and a.ord_seq = b.ord_seq and b.del_yn = '0' and a.crp_id = '10' and (a.prod_date) >= '" & fechainicial & "' and (a.prod_date) <= '" & fechafinal & "'order by a.prod_date, a.work_gubun, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end, a.ord_date, a.ord_seq")
If Rsinven1.EOF And Rsinven1.BOF Then
ExisteUsuario = False
Msg = "No records exist for this date."
Style = vbDefaultButton2
Title = "Msg from System"
Help = ""
ctxt = 1000
'Response = MsgBox(Msg, Style, Title, Help, ctxt)
response.Write("No records exist for this date.")
Else
%>
W. O. Details
PROD DATE
SHIFT
MACHINE
ORDER NO
CUSTOMER
ITEM
CUSTOMER ORD
WO QTY
PROD QTY
PROD M2
PROD KG
BAD QTY
WO Vs PROD (%)
<%
'Rsinven1.MoveFirst
nmachine=1
lworkorder1="a"
lworkorder2="b"
lmaquina1="a"
lmaquina2="b"
Rsinven1.movefirst
Do While Not Rsinven1.EOF
' lqtyinven = lqtyinven + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))
' lamtinven = lamtinven + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))
'response.write((Rsinven1("real_prod_qty"))&" / "&Rsinven1("plan_qty"))
if not isnull(Rsinven1("real_prod_qty")) and not isnull(Rsinven1("plan_qty")) then
Porclogro=cdbl(Rsinven1("real_prod_qty"))/cdbl(Rsinven1("plan_qty"))*100
else
Porclogro=0
end if
lturno1=Rsinven1("wrok_gubun_nm")
lmaquina1=Rsinven1("proc_nm")
Posicion= Instr(Rsinven1("good_nm"),"/")
'''''''''''**********************
'''''' Calcular KG
set rspeso=dbsql.execute("select round((dbo.f_mtrl_wgt2(c.mtrl_yn1, x1.sale_price ) + dbo.f_mtrl_wgt2(c.mtrl_yn2, x2.sale_price ) + dbo.f_mtrl_wgt2(c.mtrl_yn3, x3.sale_price ) + dbo.f_mtrl_wgt2(c.mtrl_yn4, x4.sale_price ) + dbo.f_mtrl_wgt2(c.mtrl_yn5, x5.sale_price )) * a.mae_m2 / a.julsu ,5) mtrl_wgt from stb040t a(nolock) left outer join stb180t e(nolock) on a.cust_cd = e.cust_cd and a.good_cd = e.good_cd and a.cust_cd ='"&Rsinven1("cust_cd")&"' and a.good_cd ='"&Rsinven1("good_cd")&"', stb010t b(nolock), stb070t x1(nolock), stb070t x2(nolock), stb070t x3(nolock), stb070t x4(nolock), stb070t x5(nolock), stb070t x6(nolock), stb070t x7(nolock), cost010t y1(nolock), cost010t y2(nolock), cost010t y3(nolock), cost010t y4(nolock), cost010t y5(nolock), stb080t c(nolock), stb100t d(nolock) ")
prodkg=cdbl(rspeso("mtrl_wgt"))*cdbl(Rsinven1("real_prod_qty"))
''''''''''''*********** Fin de calculo de KG
%>
<%= Rsinven1("prod_day")%>
<%= Rsinven1("wrok_gubun_nm")%>
<%= Rsinven1("proc_nm")%>
<%= Rsinven1("ord_no")%>
<%= Rsinven1("cust_nm")%>
<%if posicion>0 then%>
<%= mid(Rsinven1("good_nm"),1,posicion-1)%>
<%else%>
<%= Rsinven1("good_nm")%>
<% end if%>
<%= Rsinven1("ord_qty")%>
<%= Rsinven1("plan_qty")%>
<%= Rsinven1("real_prod_qty")%>
<%= prodkg%>
<%= Rsinven1("prod_m2")%>
<%= Rsinven1("bad_qty")%>
<%= formatnumber(porclogro,1)%> %
<%
lprodqty=lprodqty+cdbl(Rsinven1("real_prod_qty"))
lprodkg=lprodkg+cdbl(prodkg)
lprodm2=lprodm2+cdbl(Rsinven1("prod_m2"))
lbadqty=lbadqty+cdbl(Rsinven1("bad_qty"))
xturno=Rsinven1("wrok_gubun_nm")
if not isnull(Rsinven1("plan_qty")) then
xplanqty=cdbl(Rsinven1("plan_qty"))
else
xplanqty=cdbl(Rsinven1("real_prod_qty"))
end if
lprodqtym=lprodqtym+cdbl(Rsinven1("real_prod_qty"))
lprodm2m=lprodm2m+cdbl(Rsinven1("prod_m2"))
lprodmkg=lprodmkg+cdbl(prodkg)
lbadqtym=lbadqtym+cdbl(Rsinven1("bad_qty"))
Rsinven1.MoveNext
set Rspeso=nothing
if not rsinven1.eof then
'if lworkorder1<>lworkorder2 then
'end if
lturno2=Rsinven1("wrok_gubun_nm")
lmaquina2=Rsinven1("proc_nm")
lworkorder2=Rsinven1("ord_no")
if xplanqty>0 and ((lworkorder1<>lworkorder2) or (lmaquina1<>lmaquina2)) then
lplanqty=lplanqty+xplanqty
end if
if xplanqty>0 and ((lworkorder1<>lworkorder2) or (lmaquina1<>lmaquina2)) then
lplanqtym=lplanqtym+xplanqty
end if
lworkorder1=lworkorder2
if lturno1<>lturno2 or lmaquina1<>lmaquina2 then
if lmaquina1<>lmaquina2 then
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
'Dim aturno
'aturno = Session("turno")
If isArray(aturno)=false Then
ReDim aturno(60,23)
aturno(1,1)=lmaquina1
if lturno1="1S" then
aturno(1,2)=aturno(1,2)+lprodqtym
aturno(1,3)=aturno(1,3)+lprodm2m
aturno(1,8)=aturno(1,8)+lplanqtym
aturno(1,9)=aturno(1,9)+lbadqtym
aturno(1,10)=aturno(1,10)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,21)=aturno(1,21)+lprodmkg
end if
if lturno1="2S" then
aturno(1,4)=aturno(1,4)+lprodqtym
aturno(1,5)=aturno(1,5)+lprodm2m
aturno(1,11)=aturno(1,11)+lplanqtym
aturno(1,12)=aturno(1,12)+lbadqtym
aturno(1,13)=aturno(1,13)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,22)=aturno(1,22)+lprodmkg
end if
if lturno1="3S" then
aturno(1,6)=aturno(1,6)+lprodqtym
aturno(1,7)=aturno(1,7)+lprodm2m
aturno(1,14)=aturno(1,14)+lplanqtym
aturno(1,15)=aturno(1,15)+lbadqtym
aturno(1,16)=aturno(1,16)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,23)=aturno(1,23)+lprodmkg
end if
session("turno") = aturno
else
numprod=0
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)=lmaquina1 then
if lturno1="1S" then
aturno(i,2)=aturno(i,2)+lprodqtym
aturno(i,3)=aturno(i,3)+lprodm2m
aturno(i,8)=aturno(i,8)+lplanqtym
aturno(i,9)=aturno(i,9)+lbadqtym
aturno(i,10)=aturno(i,10)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,21)=aturno(i,21)+lprodmkg
end if
if lturno1="2S" then
aturno(i,4)=aturno(i,4)+lprodqtym
aturno(i,5)=aturno(i,5)+lprodm2m
aturno(i,11)=aturno(i,11)+lplanqtym
aturno(i,12)=aturno(i,12)+lbadqtym
aturno(i,13)=aturno(i,13)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,22)=aturno(i,22)+lprodmkg
end if
if lturno1="3S" then
aturno(i,6)=aturno(i,6)+lprodqtym
aturno(i,7)=aturno(i,7)+lprodm2m
aturno(i,14)=aturno(i,14)+lplanqtym
aturno(i,15)=aturno(i,15)+lbadqtym
aturno(i,16)=aturno(i,16)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,23)=aturno(i,23)+lprodmkg
end if
incart=true
else
if aturno(i,1)="" and not(incart) then
aturno(i,1)=lmaquina1
if lturno1="1S" then
aturno(i,2)=aturno(i,2)+lprodqtym
aturno(i,3)=aturno(i,3)+lprodm2m
aturno(i,8)=aturno(i,8)+lplanqtym
aturno(i,9)=aturno(i,9)+lbadqtym
aturno(i,10)=aturno(i,10)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,21)=aturno(i,21)+lprodmkg
end if
if lturno1="2S" then
aturno(i,4)=aturno(i,4)+lprodqtym
aturno(i,5)=aturno(i,5)+lprodm2m
aturno(i,11)=aturno(i,11)+lplanqtym
aturno(i,12)=aturno(i,12)+lbadqtym
aturno(i,13)=aturno(i,13)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,22)=aturno(i,22)+lprodmkg
end if
if lturno1="3S" then
aturno(i,6)=aturno(i,6)+lprodqtym
aturno(i,7)=aturno(i,7)+lprodm2m
aturno(i,14)=aturno(i,14)+lplanqtym
aturno(i,15)=aturno(i,15)+lbadqtym
aturno(i,16)=aturno(i,16)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(i,23)=aturno(i,23)+lprodmkg
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno
end if 'is array
'aturno(6,nmachine)=lturno1
'response.write(lmaquina1)
'response.write(lturno1)
%>
<%=xturno%>
Total <%= lmaquina1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqtym,0)%>
<%=formatnumber( lprodmkg,0)%>
<%=formatnumber( lprodm2m,0)%>
<%=formatnumber( lbadqtym,0)%>
<%=formatnumber(lcumplimiento2,1)%> %
<%
lmaquina1=lmaquina2
lprodqtym=0
lprodm2m=0
lprodmkg=0
lbadqtym=0
lplanqtym=0
nmachine=nmachine+1
end if 'si maquina
if lturno1<>lturno2 then
lcumplimiento=100
if lprodqty>0 and lplanqty>0 then
lcumplimiento=(lprodqty/lplanqty)*100
end if
%>
Total turno: <%= lturno1%>
<%=formatnumber(lplanqty,0)%>
<%=formatnumber(lprodqty,0)%>
<%=formatnumber(lprodkg,0)%>
<%=formatnumber(lprodm2,0)%>
<%=formatnumber(lbadqty,0)%>
<%=formatnumber(lcumplimiento,1)%> %
<%
lturno1=lturno2
gtot1=gtot1+lplanqty
gtot2=gtot2+lprodqty
gtot3=gtot3+lprodm2
gtot4=gtot4+lbadqty
lprodqty=0
lprodkg=0
lprodm2=0
lbadqty=0
lplanqty=0
end if 'turno
end if 'si maquina o turno
else 'si eof
if xplanqty>0 then
lplanqty=lplanqty+xplanqty
end if
if xplanqty>0 then
lplanqtym=lplanqtym+xplanqty
end if
lcumplimiento=(lprodqty/lplanqty)*100
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
'Dim aturno
'aturno = Session("turno")
If isArray(aturno)=false Then
ReDim aturno(60,23)
aturno(1,1)=lmaquina1
if lturno1="1S" then
aturno(1,2)=aturno(1,2)+lprodqtym
aturno(1,3)=aturno(1,3)+lprodm2m
aturno(1,8)=aturno(1,8)+lplanqtym
aturno(1,9)=aturno(1,9)+lbadqtym
aturno(1,10)=aturno(1,10)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,21)=aturno(1,21)+lprodmkg
end if
if lturno1="2S" then
aturno(1,4)=aturno(1,4)+lprodqtym
aturno(1,5)=aturno(1,5)+lprodm2m
aturno(1,11)=aturno(1,11)+lplanqtym
aturno(1,12)=aturno(1,12)+lbadqtym
aturno(1,13)=aturno(1,13)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,22)=aturno(1,22)+lprodmkg
end if
if lturno1="3S" then
aturno(1,6)=aturno(1,6)+lprodqtym
aturno(1,7)=aturno(1,7)+lprodm2m
aturno(1,14)=aturno(1,14)+lplanqtym
aturno(1,15)=aturno(1,15)+lbadqtym
aturno(1,16)=aturno(1,16)+lcumplimiento2
aturno(1,18)=aturno(1,18)+1
aturno(1,23)=aturno(1,23)+lprodmkg
end if
session("turno") = aturno
else
numprod=0
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)=lmaquina1 then
if lturno1="1S" then
aturno(i,2)=aturno(i,2)+lprodqtym
aturno(i,3)=aturno(i,3)+lprodm2m
aturno(i,8)=aturno(i,8)+lplanqtym
aturno(i,9)=aturno(i,9)+lbadqtym
aturno(i,10)=aturno(i,10)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,21)=aturno(1,21)+lprodmkg
end if
if lturno1="2S" then
aturno(i,4)=aturno(i,4)+lprodqtym
aturno(i,5)=aturno(i,5)+lprodm2m
aturno(i,11)=aturno(i,11)+lplanqtym
aturno(i,12)=aturno(i,12)+lbadqtym
aturno(i,13)=aturno(i,13)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,22)=aturno(1,22)+lprodmkg
end if
if lturno1="3S" then
aturno(i,6)=aturno(i,6)+lprodqtym
aturno(i,7)=aturno(i,7)+lprodm2m
aturno(i,14)=aturno(i,14)+lplanqtym
aturno(i,15)=aturno(i,15)+lbadqtym
aturno(i,16)=aturno(i,16)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,23)=aturno(1,23)+lprodmkg
end if
incart=true
else
if aturno(i,1)="" and not(incart) then
aturno(i,1)=lmaquina1
if lturno1="1S" then
aturno(i,2)=aturno(i,2)+lprodqtym
aturno(i,3)=aturno(i,3)+lprodm2m
aturno(i,8)=aturno(i,8)+lplanqtym
aturno(i,9)=aturno(i,9)+lbadqtym
aturno(i,10)=aturno(i,10)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,21)=aturno(1,21)+lprodmkg
end if
if lturno1="2S" then
aturno(i,4)=aturno(i,4)+lprodqtym
aturno(i,5)=aturno(i,5)+lprodm2m
aturno(i,11)=aturno(i,11)+lplanqtym
aturno(i,12)=aturno(i,12)+lbadqtym
aturno(i,13)=aturno(i,13)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,22)=aturno(1,22)+lprodmkg
end if
if lturno1="3S" then
aturno(i,6)=aturno(i,6)+lprodqtym
aturno(i,7)=aturno(i,7)+lprodm2m
aturno(i,14)=aturno(i,14)+lplanqtym
aturno(i,15)=aturno(i,15)+lbadqtym
aturno(i,16)=aturno(i,16)+lcumplimiento2
aturno(i,18)=aturno(i,18)+1
aturno(1,23)=aturno(1,23)+lprodmkg
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno
end if ' is array
%>
<%=xturno%>
Total <%= lmaquina1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqtym,0)%>
<%=formatnumber(lprodmkg,0)%>
<%=formatnumber(lprodm2m,0)%>
<%=formatnumber(lbadqtym,0)%>
<%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%>
<%=formatnumber(lplanqty,0)%>
<%=formatnumber(lprodqty,0)%>
<%=formatnumber(lprodkg,0)%>
<%=formatnumber(lprodm2,0)%>
<%=formatnumber(lbadqty,0)%>
<%=formatnumber(lcumplimiento,1)%> %
<%
gtot1=gtot1+lplanqty
gtot2=gtot2+lprodqty
gtot3=gtot3+lprodm2
gtot4=gtot4+lbadqty
gtot5=gtot5+lprodkg
if gtot2>0 and gtot1>0 then
'lplanqtym=lprodqtym
lcumplimiento3=(gtot2/gtot1)*100
else
lcumplimiento3=0
end if
'gtot5=gtot5+lplanqty
end if
Loop
Rsinven1.Close
Set Rsinven1 = Nothing
%>
GRAND TOTAL
<%=formatnumber(gtot1,0)%>
<%=formatnumber(gtot2,0)%>
<%=formatnumber(gtot5,0)%>
<%=formatnumber(gtot3,0)%>
<%=formatnumber(gtot4,0)%>
<%=formatnumber(lcumplimiento3,1)%> %
<%
End If
%>
Production Summary by Machine /Shift
(<%=Date_ini%> to <%=Date_end%>)
Generated: <%=time%>
1S
2S
3S
Total
<%=lturno1t%>
<%=lturno2t%>
<%=lturno3t%>
<%=lturnotot%>
Machine
Qty
M2
Qty
M2
Qty
M2
Qty
M2
Shift Qty
<%
'If isArray(aturno) Then
'buscar producto duplicado
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)<>"" then
if aturno(i,1)="V BOARDER 1" or aturno(i,1)="V BOARDER 2" or aturno(i,1)="V BOARDER 3" then
lstotqtymvb=ltotqtymvb+aturno(i,2)+aturno(i,4)+aturno(i,6)
lstotm2mvb=ltotm2mvb+aturno(i,3)+aturno(i,5)+aturno(i,7)
lstotqtys1vb=lstotqtys1vb+aturno(i,2)
lstotqtys2vb=lstotqtys2vb+aturno(i,4)
lstotqtys3vb=lstotqtys3vb+aturno(i,6)
lstotm2s1vb=lstotm2s1vb+aturno(i,3)
lstotm2s2vb=lstotm2s2vb+aturno(i,5)
lstotm2s3vb=lstotm2s3vb+aturno(i,7)
lstotbads1vb=lstotbads1vb+aturno(i,9)
lstotbads2vb=lstotbads2vb+aturno(i,12)
lstotbads3vb=lstotbads3vb+aturno(i,15)
end if
%>
<%
lstotqtys1=0
lstotqtys2=0
lstotqtys3=0
lstotm2s1=0
lstotm2s2=0
lstotm2s3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
lstotqtyday=0
lstotm2day=0
end if
if aturno(i,1)="V BOARDER 3" then
%>
<%
lstotqtys1vb=0
lstotqtys2vb=0
lstotqtys3vb=0
lstotm2s1vb=0
lstotm2s2vb=0
lstotm2s3vb=0
lstotbads1vb=0
lstotbads2vb=0
lstotbads3vb=0
lstotqtydayvb=0
lstotm2dayvb=0
end if
if aturno(i,1)="AUTOMAX +" then
%>
<%
lstotqtys1=0
lstotqtys2=0
lstotqtys3=0
lstotm2s1=0
lstotm2s2=0
lstotm2s3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
lstotqtyday=0
lstotm2day=0
end if
next
'else
' ReDim aturno(60,9)
'end if
if ubound(aturno) then
%>
<%
'If isArray(aturno) Then
'buscar producto duplicado
lstotbads1=0
lstotbads2=0
lstotbads3=0
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)<>"" then
if aturno(i,10)>89.99 then
lcolor1="#3CFF3C"
end if
if aturno(i,10)>80 and aturno(i,10)<90 then
lcolor1="#FFFF80"
end if
if aturno(i,10)<80 then
lcolor1="#FF9595"
end if
if aturno(i,13)>89.99 then
lcolor2="#3CFF3C"
end if
if aturno(i,13)>80 and aturno(i,13)<90 then
lcolor2="#FFFF80"
end if
if aturno(i,13)<80 then
lcolor2="#FF9595"
end if
if aturno(i,16)>89.99 then
lcolor3="#3CFF3C"
end if
if aturno(i,16)>80 and aturno(i,16)<90 then
lcolor3="#FFFF80"
end if
if aturno(i,16)<80 then
lcolor3="#FF9595"
end if
%>
<%=aturno(i,1)%>
<%=aturno(i,8)%>
<%=aturno(i,2)%>
<%=aturno(i,9)%>
<%if isnumeric(aturno(i,8)) and aturno(i,8)>0 then %>
<%=formatnumber(aturno(i,10),1)%> %
<%else%>
<%end if%>
<%=aturno(i,11)%>
<%=aturno(i,4)%>
<%=aturno(i,12)%>
<%if isnumeric(aturno(i,11)) and aturno(i,11)>0 then %>
<%=formatnumber(aturno(i,13),1)%> %
<%else%>
<%end if%>
<%=aturno(i,14)%>
<%=aturno(i,6)%>
<%=aturno(i,15)%>
<%if isnumeric(aturno(i,14)) and aturno(i,14)>0 then %>
<%=formatnumber(aturno(i,16),1)%> %
<%else%>
<%end if%>
<%
ltotwo=aturno(i,8)+aturno(i,11)+aturno(i,14)
ltotactual=aturno(i,2)+aturno(i,4)+aturno(i,6)
ltotbad=aturno(i,9)+aturno(i,12)+aturno(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
ltotwos1=ltotwos1+aturno(i,8)
ltotwos2=ltotwos2+aturno(i,11)
ltotwos3=ltotwos3+aturno(i,14)
lstotwos1=lstotwos1+aturno(i,8)
lstotwos2=lstotwos2+aturno(i,11)
lstotwos3=lstotwos3+aturno(i,14)
lstotacts1=lstotacts1+aturno(i,2)
lstotacts2=lstotacts2+aturno(i,4)
lstotacts3=lstotacts3+aturno(i,6)
lstotbads1=lstotbads1+aturno(i,9)
lstotbads2=lstotbads2+aturno(i,12)
lstotbads3=lstotbads3+aturno(i,15)
%>
<%=ltotwo%>
<%=ltotactual%>
<%=ltotbad%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF5353"
end if
if ltotpercent=0 then
%>
<% else %>
<%=formatnumber(ltotpercent,1)%> %
<% end if %>
<%
end if
if aturno(i,1)="GENCO" or aturno(i,1)="AUTOMAX +" or aturno(i,1)="PALLETIZE / STACK" or aturno(i,1)="V BOARDER 3" then
%>
Sub Total
<%=formatnumber(lstotwos1,0)%>
<%=formatnumber(lstotacts1,0)%>
<%=formatnumber(lstotbads1,0)%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents2=0
end if
else
lstotpercents1=0
end if %>
<%=formatnumber(lstotpercents1,1)%> %
<%=formatnumber(lstotwos2,0)%>
<%=formatnumber(lstotacts2,0)%>
<%=formatnumber(lstotbads2,0)%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if %>
<%=formatnumber(lstotpercents2,1)%> %
<%=formatnumber(lstotwos3,0)%>
<%=formatnumber(lstotacts3,0)%>
<%=formatnumber(lstotbads3,0)%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotacts3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if %>
<%=formatnumber(lstotpercents3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) and lstotactday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
%>
<%=formatnumber(lstotwoday,0)%>
<%=formatnumber(lstotactday,0)%>
<%=formatnumber(lstotbadday,0)%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
end if
next
'else
Session("turno")=""
'end if
ts=0
if ts=1 then
%>
Total Shift
<%=formatnumber(ltotwos1,0)%>
<%=formatnumber(ltotqtys1,0)%>
<%=formatnumber(ltotbads1,0)%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotqtys1) then
if ltotwos1>0 and ltotqtys1>0 then
ltotpercents1=(ltotqtys1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=formatnumber(ltotwos2,0)%>
<%=formatnumber(ltotqtys2,0)%>
<%=formatnumber(ltotbads2,0)%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotqtys2) then
if ltotwos2>0 and ltotqtys2>0 then
ltotpercents2=(ltotqtys2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=formatnumber(ltotwos3,0)%>
<%=formatnumber(ltotqtys3,0)%>
<%=formatnumber(ltotbads3,0)%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotqtys3) then
if ltotqtys3>0 and ltotwos3>0 then
ltotpercents3=(ltotqtys3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
if isnumeric(ltotwoday) and isnumeric(ltotqtyday) then
if ltotwoday>0 and ltotqtyday>0 then
ltotpercentday=(ltotqtyday/ltotwoday)*100
else
ltotpercentday=0
end if
else
ltotpercentday=0
end if
%>
<%=formatnumber(ltotwoday,0)%>
<%=formatnumber(ltotqtyday,0)%>
<%=formatnumber(ltotbadday,0)%>
<%=formatnumber(ltotpercentday,1)%> %
<% end if%>
<%
'''''''''''''''''''''''''''''''''''''''
Date_endc1=Request.Form("Date_end")
Date_end2=cdate(Date_end)+1
strday2 = Right("00" & Day(Date_end2), 2)
strmonth2 = Right("00" & Month(Date_end2), 2)
stryear2 = Right("00" & Year(Date_end2), 4)
fechafinal = CStr(stryear2 + strmonth2 + strday2)
response.write(fechainicial)&" FI "
response.write(fechafinal)&" Ff "
set Rscorr=dbsqlcorr.execute("select GOL,JIJG,JANG,WPOK,QTY,PQTY,SUJUNO,JOBYMD,CUST,BOX_NM,eqty,jtime,dtime,JOBJO,stime,etime,sdate,Edate from SHPSOUT(nolock) where jobymd between '" & fechainicial & "' and '" & fechafinal & "' order by sdate,stime,etime")
%>
CORRUGATOR I (Plant 1)
JOB DATE
SHIFT
TIME
ORDER NO
CUSTOMER
ITEM
FLUTE
COMBINATION
LENGTH
WIDTH
WO QTY
PROD QTY
M
M2
BAD Qty
WORK HOUR
STOP HOUR
AVG SPEED
<%
TOTML=0
TOTM2=0
TOTjtime=0
c1ps1m=0
c1ps1m2=0
c1ps2m=0
c1ps2m2=0
c1ps3m=0
c1ps3m2=0
if Not Rscorr.EOF then
Rscorr.movefirst
end if
lturno1="1" 'Rscorr("JOBJO")
lturno2="1" 'Rscorr("JOBJO")
Do While Not Rscorr.EOF
lehora1=mid(Rscorr("ETIME"),1,2)
lehora2=mid(Rscorr("ETIME"),4,2)
lehora3=mid(Rscorr("ETIME"),7,2)
lhend=lehora1&lehora2&lehora3
lsdate1=mid(Rscorr("sdate"),1,4)
lsdate2=mid(Rscorr("sdate"),6,2)
lsdate3=mid(Rscorr("sdate"),9,2)
lsdate=lsdate1&lsdate2&lsdate3
'response.write(" FI: "&Rscorr("jobymd")&" etime: "&Rscorr("etime")&" x "&lhend)
if (lsdate"06:49:59" then
lestado=0
end if
'response.write(" a "&fecfin)
if ucase(trim(Rscorr("jobymd")))>ucase(trim(fechafinal)) then
' or ucase(trim(fecfin))>ucase(trim(fechafinal))
lestado=0
'response.write(" b ")
end if
if ucase(trim(fecfin))>ucase(trim(fechafinal)) then
' or ucase(trim(fecfin))>ucase(trim(fechafinal))
lestado=0
'response.write(" c ")
end if
if ucase(trim(Rscorr("jobymd")))=ucase(trim(fechafinal)) and Rscorr("STIME")<"06:50:00" and Rscorr("ETIME")>"06:49:59" then
shora1c=int(mid(Rscorr("sTIME"),1,2))*3600
shora2c=int(mid(Rscorr("sTIME"),4,2))*60
shora3c=int(mid(Rscorr("sTIME"),7,2))
hsndc=24600-(shora1c+shora2c+shora3c)
ehora1c=int(mid(Rscorr("ETIME"),1,2))*3600
ehora2c=int(mid(Rscorr("ETIME"),4,2))*60
ehora3c=int(mid(Rscorr("ETIME"),7,2))
hendc=ehora1c+ehora2c+ehora3c-24600
'response.write(henda&"-"&hsnda)
if hendc>=hsndc then
lestado=0
else
lestado=1
end if
'RsCORR.MoveNext
end if
if ucase(trim(Rscorr("jobymd")))=ucase(trim(fechainicial)) and Rscorr("STIME")<"06:50:00" and Rscorr("ETIME")>"06:49:59" then
shora1a=int(mid(Rscorr("sTIME"),1,2))*3600
shora2a=int(mid(Rscorr("sTIME"),4,2))*60
shora3a=int(mid(Rscorr("sTIME"),7,2))
hsnda=24600-(shora1a+shora2a+shora3a)
ehora1a=int(mid(Rscorr("ETIME"),1,2))*3600
ehora2a=int(mid(Rscorr("ETIME"),4,2))*60
ehora3a=int(mid(Rscorr("ETIME"),7,2))
henda=ehora1a+ehora2a+ehora3a-24600
'response.write(henda&"-"&hsnda)
if hsnda>=henda then
lestado=0
else
lestado=1
end if
'RsCORR.MoveNext
end if
if lestado=1 then
ljobjo=Rscorr("JOBJO")
if ucase(trim(Rscorr("jobymd")))=ucase(trim(fechafinal)) and left(Rscorr("JOBJO"),1)="A" then
ljobjo="C"
end if
if left(Rscorr("JOBJO"),1)="A" then
if Rscorr("jtime")>25000 then
lstime="06:50:00"
ehora1=int(mid(Rscorr("ETIME"),1,2))*3600
ehora2=int(mid(Rscorr("ETIME"),4,2))*60
ehora3=int(mid(Rscorr("ETIME"),7,2))
hend=ehora1+ehora2+ehora3
Tiempo2=hend-24600
else
Tiempo2 = Rscorr("jtime")
end if
'response.write(" 1 ")
else
lstime=Rscorr("STIME")
Tiempo2 = Rscorr("jtime")
'response.write(" 2 ")
end if
%>
<%
TOTTARGET=TOTTARGET+Rscorr("QTY")
TOTPROD=TOTPROD+Rscorr("PQTY")
TOTML=TOTML+(Rscorr("JANG")*Rscorr("PQTY")/1000)
TOTM2=TOTM2+(Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000)
TOTbad=TOTbad+Rscorr("eQTY")
TOTjtime=TOTjtime+Tiempo2
TOTdtime=TOTdtime+Rscorr("dtime")
TOTITEMS=TOTITEMS+1
TOTTARGET2=TOTTARGET2+cdbl(Rscorr("QTY"))
TOTPROD2=TOTPROD2+cdbl(Rscorr("PQTY"))
TOTML2=TOTML2+(Rscorr("JANG")*Rscorr("PQTY")/1000)
TOTM22=TOTM22+(Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000)
TOTbad2=TOTbad2+cdbl(Rscorr("eQTY"))
TOTjtime2=TOTjtime2+cdbl(Tiempo2)
TOTdtime2=TOTdtime2+cdbl(Rscorr("dtime"))
RsCORR.MoveNext
if not RsCORR.eof then
shora2=int(mid(RsCORR("STIME"),1,2)&mid(RsCORR("STIME"),4,2)&mid(RsCORR("STIME"),7,2))
Ehora2=int(mid(RsCORR("ETIME"),1,2)&mid(RsCORR("ETIME"),4,2)&mid(RsCORR("ETIME"),7,2))
'response.write(" sh "&shora2)
'response.write(" eh "&ehora2)
' if shora2>064959 and shora2<185000 then
if shora2>064959 and shora2<152000 then
lturno2="1"
end if
'if shora2>184959 and shora2<065000 then
if shora2>151959 and shora2<232000 then
lturno2="2"
'response.write(" t2x "&ehora2)
end if
if shora2>231959 or shora2<065000 then
lturno2="3"
end if
if shora2<065000 and Ehora2>064959 then
'response.write(" t20 "&ehora2)
shora1x=int(mid(RsCORR("STIME"),1,2))*3600
shora2x=int(mid(RsCORR("STIME"),4,2))*60
shora3x=int(mid(RsCORR("STIME"),7,2))
hstartx=shora1x+shora2x+shora3x
ehora1x=int(mid(RsCORR("ETIME"),1,2))*3600
ehora2x=int(mid(RsCORR("ETIME"),4,2))*60
ehora3x=int(mid(RsCORR("ETIME"),7,2))
hendx=ehora1x+ehora2x+ehora3x
Shift1=24600
Sec1x=int(Shift1-hstartx)
Sec2x=int(hendx-Shift1)
if Sec2x>Sec1x then
lturno2="1"
end if
end if
'response.write(RsCORR("STIME")&" ")
'response.write(RsCORR("ETIME")&" ")
if (RsCORR("STIME")<"15:20:00" and RsCORR("ETIME")>"15:19:59") then
'response.write(" t21 "&ehora2)
shn1=int(mid(RsCORR("STIME"),1,2))*3600
shn2=int(mid(RsCORR("STIME"),4,2))*60
shn3=int(mid(RsCORR("STIME"),7,2))
hstn=shn1+shn2+shn3
ehn1=int(mid(RsCORR("ETIME"),1,2))*3600
ehn2=int(mid(RsCORR("ETIME"),4,2))*60
ehn3=int(mid(RsCORR("ETIME"),7,2))
hend2n=ehn1+ehn2+ehn3
if (shora2<"152000" and Ehora2>"151959") then
'Shift2=67800
Shift2=55200
Sec1n=int(Shift2-hstn)
Sec2n=int(hend2n-Shift2)
if Sec1n>Sec2n then
lturno2="1"
else
lturno2="2"
end if
'response.write(" t2 "&Sec2n)
end if
end if
ledate=mid(RsCORR("Edate"),1,4)&mid(RsCORR("Edate"),6,2)&mid(RsCORR("Edate"),9,2)
lsdate=mid(RsCORR("Sdate"),1,4)&mid(RsCORR("Sdate"),6,2)&mid(RsCORR("Sdate"),9,2)
'response.write(lsdate&" "&ledate)
if (RsCORR("STIME")<"23:20:00" and RsCORR("ETIME")>"23:19:59") or (RsCORR("STIME")<"23:20:00" and ledate>lsdate) then
'response.write(" t21 "&ehora2)
shn1=int(mid(RsCORR("STIME"),1,2))*3600
shn2=int(mid(RsCORR("STIME"),4,2))*60
shn3=int(mid(RsCORR("STIME"),7,2))
hstn=shn1+shn2+shn3
ehn1=int(mid(RsCORR("ETIME"),1,2))*3600
ehn2=int(mid(RsCORR("ETIME"),4,2))*60
ehn3=int(mid(RsCORR("ETIME"),7,2))
if ledate>lsdate then
hend2n=ehn1+ehn2+ehn3+86400
else
hend2n=ehn1+ehn2+ehn3
end if
Shift3=84000
Sec1n3=int(Shift3-hstn)
Sec2n3=int(hend2n-Shift3)
if Sec1n3>Sec2n3 then
lturno2="2"
else
lturno2="3"
end if
end if
' 'lturno2=Rscorr("JOBJO")
end if
'if RsCORR.eof then
' response.write(" FIN EOF "<urno1)
'end if
llugar=0
if RsCORR.eof or lturno1<>lturno2 then
response.write(" t2 or FIN "<urno2)
if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then
'lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60))
lspeedtot2=int(TOTML2/((TOTjtime2)/60))
else
lspeedtot2=0
end if
if TOTTARGET2>0 then
hores5 = int((TOTjtime2/3600))
aux5 = int(TOTjtime2-(3600*hores5))
minuts5 = int(aux5/60)
segons5 = TOTjtime2-hores5*3600-minuts5*60
Worktime5 = hores5&":"&right("00"&minuts5,2)&":"&right("00"&segons5,2)
hores6 = int((TOTdtime2/3600))
aux6 = int(TOTdtime2-(3600*hores6))
minuts6 = int(aux6/60)
segons6 = TOTdtime2-hores6*3600-minuts6*60
delaytime5 = hores6&":"&right("00"&minuts6,2)&":"&right("00"&segons6,2)
llugar=1
if lturno1="1" then
lshift="1st"
c1ps1m=TOTML2
c1ps1m2=TOTM22
pc1ps1m=pc1ps1m+TOTML2
pc1ps1m2=pc1ps1m2+TOTM22
end if
if lturno1="2" then
lshift="2nd"
c1ps2m=TOTML2
c1ps2m2=TOTM22
pc1ps2m=pc1ps2m+TOTML2
pc1ps2m2=pc1ps2m2+TOTM22
end if
if lturno1="3" then
lshift="3rd"
c1ps3m=TOTML2
c1ps3m2=TOTM22
pc1ps3m=pc1ps3m+TOTML2
pc1ps3m2=pc1ps3m2+TOTM22
end if
%>
<%=lshift%> Shift TOTAL
<%=formatnumber(TOTTARGET2,0)%>
<%=formatnumber(TOTPROD2,0)%>
<%=formatnumber(TOTML2,0)%> M
<%=formatnumber(TOTM22,0)%> M2
<%=formatnumber(TOTbad2,0)%>
<%=worktime5%>
<%=delaytime5%>
<%=formatnumber(lspeedtot2,0)%>
<%
lturno1=lturno2
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
end if
end if
else
RsCORR.MoveNext
if RsCORR.eof or lturno1<>lturno2 then
if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then
'lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60))
lspeedtot2=int(TOTML2/((TOTjtime2)/60))
else
lspeedtot2=0
end if
if TOTTARGET2>0 then
hores5 = int((TOTjtime2/3600))
aux5 = int(TOTjtime2-(3600*hores5))
minuts5 = int(aux5/60)
segons5 = TOTjtime2-hores5*3600-minuts5*60
Worktime5 = hores5&":"&right("00"&minuts5,2)&":"&right("00"&segons5,2)
hores6 = int((TOTdtime2/3600))
aux6 = int(TOTdtime2-(3600*hores6))
minuts6 = int(aux6/60)
segons6 = TOTdtime2-hores6*3600-minuts6*60
delaytime5 = hores6&":"&right("00"&minuts6,2)&":"&right("00"&segons6,2)
llugar=1
if lturno1="1" then
lshift="1st"
c1ps1m=TOTML2
c1ps1m2=TOTM22
pc1ps1m=pc1ps1m+TOTML2
pc1ps1m2=pc1ps1m2+TOTM22
end if
if lturno1="2" then
lshift="2nd"
c1ps2m=TOTML2
c1ps2m2=TOTM22
pc1ps2m=pc1ps2m+TOTML2
pc1ps2m2=pc1ps2m2+TOTM22
end if
if lturno1="3" then
lshift="3rd"
c1ps3m=TOTML2
c1ps3m2=TOTM22
pc1ps3m=pc1ps3m+TOTML2
pc1ps3m2=pc1ps3m2+TOTM22
end if
%>
<%=lshift%> Shift TOTAL
<%=formatnumber(TOTTARGET2,0)%>
<%=formatnumber(TOTPROD2,0)%>
<%=formatnumber(TOTML2,0)%> M
<%=formatnumber(TOTM22,0)%> M2
<%=formatnumber(TOTbad2,0)%>
<%=worktime5%>
<%=delaytime5%>
<%=formatnumber(lspeedtot2,0)%>
<%
lturno1=lturno2
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
end if
end if
end if ' nshift estado=1
end if 'si etime<065000
LOOP
'END IF
rscorr.close
''''''''''''''''''''''''
if TOTML>0 and TOTjtime>0 then
lspeedtot=int(TOTML/((TOTjtime)/60))
end if
Tiempod = TOTdtime
hores3 = int((Tiempod/3600))
aux3 = int(Tiempod-(3600*hores3))
minuts3 = int(aux3/60)
segons3 = Tiempod-hores3*3600-minuts3*60
totdt = hores3&":"&right("00"&minuts3,2)&":"&right("00"&segons3,2)
Tiempow = totjtime
hores4 = int((Tiempow/3600)-hores3)
aux4 = int(Tiempow-(3600*hores4))
minuts4 = int(aux4/60)
segons4 = Tiempow-hores4*3600-minuts4*60
totwt = hores4&":"&right("00"&minuts4,2)&":"&right("00"&segons4,2)
C1TOTML=TOTML
c1TOTM2=TOTM2
%>
<%
else
'abrir la base, fijate que esta en el directorio que la tienes ...
Set Corr2 = Server.CreateObject("ADODB.Recordset") ' seteas el recordset
''Set Corr2 = strConexao.Execute("SELECT * FROM PCSIN where LEFT(STIME,8) between '" & fechainicial & "' and '" & fechafinal2 & "' and STAT='T' order by STIME,Etime") ' lo ejecutas
Set Corr2 = dbsql5.Execute("SELECT * FROM PCSIN where (jobymd between '" & fechainicial & "' and '" & fechafinal2 & "') and left(STAT,1)='T' order by jobymd, jobjo,stime,etime") ' lo ejecutas
'lquery="SELECT * FROM PCSIN where (jobymd between '" & fechainicial & "' and '" & fechafinal2 & "') and left(STAT,1)='T' order by jobymd, jobjo,sujuno"
'response.write(lquery)
TOTTARGET=0
TOTPROD=0
TOTML=0
TOTM2=0
TOTbad=0
TOTjtime=0
TOTdtime=0
TOTITEMS=0
if Not corr2.EOF then
newreporte=1
if newreporte=0 then
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
c2ps1m=0
c2ps1m2=0
c2ps2m=0
c2ps2m2=0
c2ps3m=0
c2ps3m2=0
corr2.movefirst
lturno1="1"
lturno2="1"
Do While Not corr2.EOF
xturnox=Corr2("jobjo")
lestado=0
shora=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2)
Ehora=mid(Corr2("ETIME"),10,2)&mid(Corr2("ETIME"),13,2)&mid(Corr2("ETIME"),16,2)
fecha1=mid(Corr2("STIME"),1,8)
if (mid(Corr2("STIME"),1,8)=fechainicial and shora<"065000" and Ehora<"065001") then
'CORR2.MoveNext
lestado=0
end if
Sec1=0
Sec2=0
if shora<"065000" and Ehora>"064959" then
shora1=int(mid(Corr2("STIME"),10,2))*3600
shora2=int(mid(Corr2("STIME"),13,2))*60
shora3=int(mid(Corr2("STIME"),16,2))
hstart=shora1+shora2+shora3
ehora1=int(mid(Corr2("ETIME"),10,2))*3600
ehora2=int(mid(Corr2("ETIME"),13,2))*60
ehora3=int(mid(Corr2("ETIME"),16,2))
hend=ehora1+ehora2+ehora3
Shift1=24600
Sec1=int(Shift1-hstart)
Sec2=int(hend-Shift1)
'response.write(" Sec1 "&Sec1)
'response.write(" Sec2 "&Sec2)
end if
if (mid(Corr2("STIME"),1,8)=fechainicial) then
if Sec1>Sec2 then
'CORR2.MoveNext
lestado=0
else
if Sec1"064959" then
lestado=1
Sec12=0
Sec13=0
Sec22=0
Sec23=0
if shora<"152000" and Ehora>"151959" then
shora1=int(mid(Corr2("STIME"),10,2))*3600
shora2=int(mid(Corr2("STIME"),13,2))*60
shora3=int(mid(Corr2("STIME"),16,2))
hstart2=shora1+shora2+shora3
ehora1=int(mid(Corr2("ETIME"),10,2))*3600
ehora2=int(mid(Corr2("ETIME"),13,2))*60
ehora3=int(mid(Corr2("ETIME"),16,2))
hend2=ehora1+ehora2+ehora3
Shift2=55200
Sec12=int(Shift2-hstart2)
Sec22=int(hend2-Shift2)
end if
if shora<"232000" and Ehora>"231959" then
shora1=int(mid(Corr2("STIME"),10,2))*3600
shora2=int(mid(Corr2("STIME"),13,2))*60
shora3=int(mid(Corr2("STIME"),16,2))
hstart3=shora1+shora2+shora3
ehora1=int(mid(Corr2("ETIME"),10,2))*3600
ehora2=int(mid(Corr2("ETIME"),13,2))*60
ehora3=int(mid(Corr2("ETIME"),16,2))
hend3=ehora1+ehora2+ehora3
Shift3=84000
Sec13=int(Shift3-hstart3)
Sec23=int(hend3-Shift3)
end if
if shora>"064959" and shora<"151959" then
xTurno="1"
end if
if (shora>"151959" and shora<"232000") or Sec22>Sec12 then
xTurno="2"
end if
if Sec22>Sec12 then
xTurno="2"
end if
if shora>"231959" or shora<"064959" or Sec23>Sec13 then
xTurno="3"
end if
end if
if (mid(Corr2("STIME"),1,8)=fechafinal2) then
if (shora>"064959") then
'CORR2.MoveNext
lestado=0
else
if Sec1fechainicial and mid(Corr2("STIME"),1,8)"151959" then
shora1=int(mid(Corr2("STIME"),10,2))*3600
shora2=int(mid(Corr2("STIME"),13,2))*60
shora3=int(mid(Corr2("STIME"),16,2))
hstart2=shora1+shora2+shora3
ehora1=int(mid(Corr2("ETIME"),10,2))*3600
ehora2=int(mid(Corr2("ETIME"),13,2))*60
ehora3=int(mid(Corr2("ETIME"),16,2))
hend2=ehora1+ehora2+ehora3
Shift2=55200
Sec12=int(Shift2-hstart2)
Sec22=int(hend2-Shift2)
end if
if shora<"232000" and Ehora>"231959" then
shora1=int(mid(Corr2("STIME"),10,2))*3600
shora2=int(mid(Corr2("STIME"),13,2))*60
shora3=int(mid(Corr2("STIME"),16,2))
hstart3=shora1+shora2+shora3
ehora1=int(mid(Corr2("ETIME"),10,2))*3600
ehora2=int(mid(Corr2("ETIME"),13,2))*60
ehora3=int(mid(Corr2("ETIME"),16,2))
hend3=ehora1+ehora2+ehora3
Shift3=84000
Sec13=int(Shift3-hstart3)
Sec23=int(hend3-Shift3)
end if
if shora>"064959" and shora<"151959" then
xTurno="1"
end if
if (shora>"151959" and shora<"232000") or Sec22>Sec12 then
xTurno="2"
end if
if Sec22>Sec12 then
xTurno="2"
end if
if shora>"231959" or shora<"064959" or Sec23>Sec13 then
xTurno="3"
end if
end if
if lestado=0 then
CORR2.MoveNext
end if
if lestado=1 then
lm=int(cdbl(Corr2("Jang"))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))))/1000
lm2=int((cdbl(Corr2("Jang"))*cdbl(Corr2("WPOK")))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))))/1000000
totalTiempo = cdbl(corr2("dtime"))
hores = int((totalTiempo/3600))
aux = int(totalTiempo-(3600*hores))
minuts = int(aux/60)
segons = totalTiempo-hores*3600-minuts*60
Downtime = hores&":"&right("00"&minuts,2)&":"&right("00"&segons,2)
Tiempo2 = cdbl(corr2("jtime"))
hores2 = int((Tiempo2/3600))
aux2 = int(Tiempo2-(3600*hores2))
minuts2 = int(aux2/60)
segons2 = Tiempo2-hores2*3600-minuts2*60
Worktime = hores2&":"&right("00"&minuts2,2)&":"&right("00"&segons2,2)
lstime=mid(Corr2("stime"),10,8)
if lstime="" or isnull(lstime) then
lstime=mid(Corr2("etime"),10,8)
end if
lstime=letime2
letime=mid(Corr2("etime"),10,8)
%>
<%=mid(Corr2("STIME"),1,8)%>
<%=xTurnox%>
<%=lstime&"-"&lEtime%>
<%=Corr2("sujuno")%>
<%=Corr2("cust")%>
<%=Corr2("Boxname")%>
<%=Corr2("GOL")%>
<%=Corr2("BEHAP")%>
<%=Corr2("Jang")%>
<%=Corr2("WPOK")%>
<%=Corr2("QTY")%>
<%=cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))%>
<%=formatnumber(lm,0)%>
<%=formatnumber(lm2,0)%>
<%=Corr2("EQTY")%>
<%=worktime%>
<%=downtime%>
<%
TOTTARGET=TOTTARGET+cdbl(corr2("QTY"))
TOTPROD=TOTPROD+cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY"))
TOTML=TOTML+lm '(corr2("JANG")*corr2("PQTY")/1000)
TOTM2=TOTM2+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
TOTbad=TOTbad+cdbl(corr2("eQTY"))
TOTjtime=TOTjtime+cdbl(corr2("jtime"))
TOTdtime=TOTdtime+cdbl(corr2("dtime"))
TOTTARGET2=TOTTARGET2+cdbl(corr2("QTY"))
TOTPROD2=TOTPROD2+cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY"))
TOTML2=TOTML2+lm '(corr2("JANG")*corr2("PQTY")/1000)
TOTM22=TOTM22+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
TOTbad2=TOTbad2+cdbl(corr2("eQTY"))
TOTjtime2=TOTjtime2+cdbl(corr2("jtime"))
TOTdtime2=TOTdtime2+cdbl(corr2("dtime"))
TOTITEMS=TOTITEMS+1
CORR2.MoveNext
if not Corr2.eof then
shora2=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2)
Ehora2=mid(Corr2("ETIME"),10,2)&mid(Corr2("ETIME"),13,2)&mid(Corr2("ETIME"),16,2)
if shora2>"064959" and shora2<"152000" then
lturno2="1"
end if
if shora2>"151959" and shora2<"232000" then
lturno2="2"
end if
if shora2>"231959" or shora2<"065000" then
lturno2="3"
end if
if shora2<"065000" and Ehora2>"064959" then
shora1x=int(mid(Corr2("STIME"),10,2))*3600
shora2x=int(mid(Corr2("STIME"),13,2))*60
shora3x=int(mid(Corr2("STIME"),16,2))
hstartx=shora1x+shora2x+shora3x
ehora1x=int(mid(Corr2("ETIME"),10,2))*3600
ehora2x=int(mid(Corr2("ETIME"),13,2))*60
ehora3x=int(mid(Corr2("ETIME"),16,2))
hendx=ehora1x+ehora2x+ehora3x
Shift1=24600
Sec1x=int(Shift1-hstartx)
Sec2x=int(hendx-Shift1)
if Sec2x>Sec1x then
lturno2="1"
end if
end if
if (shora2<"152000" and Ehora2>"151959") or (shora2<"232000" and Ehora2>"231959") then
shn1=int(mid(Corr2("STIME"),10,2))*3600
shn2=int(mid(Corr2("STIME"),13,2))*60
shn3=int(mid(Corr2("STIME"),16,2))
hstn=shn1+shn2+shn3
ehn1=int(mid(Corr2("ETIME"),10,2))*3600
ehn2=int(mid(Corr2("ETIME"),13,2))*60
ehn3=int(mid(Corr2("ETIME"),16,2))
hend2n=ehn1+ehn2+ehn3
if (shora2<"152000" and Ehora2>"151959") then
Shift2=55200
Sec1n=int(Shift2-hstn)
Sec2n=int(hend2n-Shift2)
if Sec1n>Sec2n then
lturno2="1"
else
lturno2="2"
end if
end if
if (shora2<"232000" and Ehora2>"231959") then
Shift3=84000
Sec1n3=int(Shift3-hstn)
Sec2n3=int(hend2n-Shift3)
if Sec1n3>Sec2n3 then
lturno2="2"
else
lturno2="3"
end if
end if
end if
end if
if Corr2.eof or lturno1<>lturno2 then
if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then
lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60))
else
lspeedtot2=0
end if
if TOTTARGET2>0 then
hores5 = int((TOTjtime2/3600))
aux5 = int(TOTjtime2-(3600*hores5))
minuts5 = int(aux5/60)
segons5 = TOTjtime2-hores5*3600-minuts5*60
Worktime5 = hores5&":"&right("00"&minuts5,2)&":"&right("00"&segons5,2)
hores6 = int((TOTdtime2/3600))
aux6 = int(TOTdtime2-(3600*hores6))
minuts6 = int(aux6/60)
segons6 = TOTdtime2-hores6*3600-minuts6*60
delaytime5 = hores6&":"&right("00"&minuts6,2)&":"&right("00"&segons6,2)
if lturno1="1" or xturnox="A" or xturnox="C" then
lshift="1st"
c2ps1m=TOTML2
c2ps1m2=TOTM22
pc2ps1m=pc2ps1m+TOTML2
pc2ps1m2=pc2ps1m2+TOTM22
end if
if lturno1="2" or xturnox="B" or xturnox="D" then
lshift="2nd"
c2ps2m=TOTML2
c2ps2m2=TOTM22
pc2ps2m=pc2ps2m+TOTML2
pc2ps2m2=pc2ps2m2+TOTM22
end if
if lturno1="3" or xturnox="3" then
lshift="3"
c2ps3m=TOTML2
c2ps3m2=TOTM22
pc2ps3m=pc2ps3m+TOTML2
pc2ps3m2=pc2ps3m2+TOTM22
end if
%>
<%=lshift%> Shift TOTAL
<%=formatnumber(TOTTARGET2,0)%>
<%=formatnumber(TOTPROD2,0)%>
<%=formatnumber(TOTML2,0)%> M
<%=formatnumber(TOTM22,0)%> M2
<%=formatnumber(TOTbad2,0)%>
<%=worktime5%>
<%=delaytime5%>
<%=formatnumber(lspeedtot2,0)%>
<%
lturno1=lturno2
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
end if
end if
end if
letime2=letime
LOOP
else
TOTML=0
TOTM2=0
TOTTARGET=0
TOTPROD=0
TOTML=0 '(corr2("JANG")*corr2("PQTY")/1000)
TOTM2=0
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
TOTITEMS=0
'corr2.movefirst
'lturno1=Corr2("JOBJO")
lturno1="1"
lturno2="1"
Do While Not corr2.EOF
'response.write(mid(Corr2("STIME"),1,8)&" - ")
xturnox=Corr2("jobjo")
lfecha1=corr2("jobymd")
if corr2("jobymd")<"220228" then
if xturnox="A" or xturnox="C" or xturnox="" then
xTurno="1"
end if
if xturnox="B" or xturnox="D" then
xTurno="2"
end if
else
if xturnox="A" or xturnox="" or xturnox="1" then
xTurno="1"
end if
if xturnox="B" or xturnox="2" then
xTurno="2"
end if
if xturnox="C" or xturnox="3" then
xTurno="3"
end if
end if
'if lestado=1 then
lm=int(cdbl(Corr2("Jang"))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))))/cdbl(Corr2("Pokno"))/1000
lm2=int((cdbl(Corr2("Jang"))*cdbl(Corr2("WPOK")))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))))/cdbl(Corr2("Pokno"))/1000000
totalTiempo = cdbl(corr2("dtime"))
hores = int((totalTiempo/3600))
aux = int(totalTiempo-(3600*hores))
minuts = int(aux/60)
segons = totalTiempo-hores*3600-minuts*60
Downtime = hores&":"&right("00"&minuts,2)&":"&right("00"&segons,2)
Tiempo2 = cdbl(corr2("jtime"))
hores2 = int((Tiempo2/3600))
aux2 = int(Tiempo2-(3600*hores2))
minuts2 = int(aux2/60)
segons2 = Tiempo2-hores2*3600-minuts2*60
Worktime = hores2&":"&right("00"&minuts2,2)&":"&right("00"&segons2,2)
lstime=mid(Corr2("stime"),10,8)
if lstime="" or isnull(lstime) then
lstime=mid(Corr2("etime"),10,8)
end if
lstime=letime2
letime=mid(Corr2("etime"),10,8)
%>
<%=Corr2("jobymd")%>
<%=xTurnox%>
<%=lstime&"-"&lEtime%>
<%=Corr2("sujuno")%>
<%=Corr2("cust")%>
<%=Corr2("Boxname")%>
<%=Corr2("GOL")%>
<%=Corr2("BEHAP")%>
<%=Corr2("Jang")%>
<%=Corr2("WPOK")%>
<%=Corr2("QTY")%>
<%=cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY"))%>
<%=formatnumber(lm,0)%>
<%=formatnumber(lm2,0)%>
<%=Corr2("EQTY")%>
<%=worktime%>
<%=downtime%>
<%
TOTTARGET=TOTTARGET+cdbl(corr2("QTY"))
TOTPROD=TOTPROD+cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY"))
TOTML=TOTML+lm '(corr2("JANG")*corr2("PQTY")/1000)
TOTM2=TOTM2+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
TOTbad=TOTbad+cdbl(corr2("eQTY"))
TOTjtime=TOTjtime+cdbl(corr2("jtime"))
TOTdtime=TOTdtime+cdbl(corr2("dtime"))
TOTTARGET2=TOTTARGET2+cdbl(corr2("QTY"))
TOTPROD2=TOTPROD2+cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY"))
TOTML2=TOTML2+lm '(corr2("JANG")*corr2("PQTY")/1000)
TOTM22=TOTM22+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
TOTbad2=TOTbad2+cdbl(corr2("eQTY"))
TOTjtime2=TOTjtime2+cdbl(corr2("jtime"))
TOTdtime2=TOTdtime2+cdbl(corr2("dtime"))
TOTITEMS=TOTITEMS+1
CORR2.MoveNext
if not Corr2.eof then
if corr2("jobjo")="A" then
lturno2="1"
end if
if corr2("jobjo")="B" or corr2("jobjo")="D" then
lturno2="2"
end if
if corr2("jobjo")="C" then
lturno2="3"
end if
if corr2("jobymd")<"220228" then
if xturnox="A" or xturnox="C" or xturnox="" or corr2("jobjo")="A" or corr2("jobjo")="C" then
lturno2="1"
end if
if xturnox="B" or xturnox="D" or corr2("jobjo")="B" or corr2("jobjo")="D" then
lturno2="2"
end if
else
if xturnox="A" or xturnox="" or xturnox="1" or corr2("jobjo")="1" then
lturno2="1"
end if
if xturnox="B" or xturnox="2" or corr2("jobjo")="2" then
lturno2="2"
end if
if xturnox="C" or xturnox="3" or corr2("jobjo")="3" then
lturno2="3"
end if
end if
lfecha2=corr2("jobymd")
end if
if Corr2.eof or lturno1<>lturno2 or lfecha1<>lfecha2 then
if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then
lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60))
else
lspeedtot2=0
end if
if TOTTARGET2>0 then
hores5 = int((TOTjtime2/3600))
aux5 = int(TOTjtime2-(3600*hores5))
minuts5 = int(aux5/60)
segons5 = TOTjtime2-hores5*3600-minuts5*60
Worktime5 = hores5&":"&right("00"&minuts5,2)&":"&right("00"&segons5,2)
hores6 = int((TOTdtime2/3600))
aux6 = int(TOTdtime2-(3600*hores6))
minuts6 = int(aux6/60)
segons6 = TOTdtime2-hores6*3600-minuts6*60
delaytime5 = hores6&":"&right("00"&minuts6,2)&":"&right("00"&segons6,2)
if lturno1="1" then
lshift=xturnox
end if
if lturno1="2" then
lshift=xturnox
end if
''''********* para 2 turnos
if lturno1="1" or xturnox="A" or xturnox="C" then
c2ps1m=TOTML2
c2ps1m2=TOTM22
pc2ps1m=pc2ps1m+TOTML2
pc2ps1m2=pc2ps1m2+TOTM22
end if
if lturno1="2" or xturnox="B" or xturnox="D" then
c2ps2m=TOTML2
c2ps2m2=TOTM22
pc2ps2m=pc2ps2m+TOTML2
pc2ps2m2=pc2ps2m2+TOTM22
end if
if lturno1="3" or xturnox="3" then
lshift="3"
c2ps3m=TOTML2
c2ps3m2=TOTM22
pc2ps3m=pc2ps3m+TOTML2
pc2ps3m2=pc2ps3m2+TOTM22
end if
'''''''''**** fin de 2 turnos
%>
<%=lshift%> Shift TOTAL
<%=formatnumber(TOTTARGET2,0)%>
<%=formatnumber(TOTPROD2,0)%>
<%=formatnumber(TOTML2,0)%> M
<%=formatnumber(TOTM22,0)%> M2
<%=formatnumber(TOTbad2,0)%>
<%=worktime5%>
<%=delaytime5%>
<%=formatnumber(lspeedtot2,0)%>
<%
lturno1=lturno2
TOTTARGET2=0
TOTPROD2=0
TOTML2=0
TOTM22=0
TOTbad2=0
TOTjtime2=0
TOTdtime2=0
lfecha1=lfecha2
end if
end if
letime2=letime
LOOP
END IF 'newreporte
corr2.close
end if
''''''''''''''''''''''''
if totitems>0 then
lspeedtot=int(TOTML/((TOTjtime+TOTdtime)/60))
Tiempod = TOTdtime
hores3 = int((Tiempod/3600))
aux3 = int(Tiempod-(3600*hores3))
minuts3 = int(aux3/60)
segons3 = Tiempod-hores3*3600-minuts3*60
totdt2 = hores3&":"&right("00"&minuts3,2)&":"&right("00"&segons3,2)
Tiempow = totjtime
hores4 = int((Tiempow/3600))
aux4 = int(Tiempow-(3600*hores4))
minuts4 = int(aux4/60)
segons4 = Tiempow-hores4*3600-minuts4*60
totwt2 = hores4&":"&right("00"&minuts4,2)&":"&right("00"&segons4,2)
C2TOTML=TOTML
c2TOTM2=TOTM2
%>
GRAND TOTAL
<%=formatnumber(TOTITEMS,0)%>
<%=formatnumber(TOTTARGET,0)%>
<%=formatnumber(TOTPROD,0)%>
<%=formatnumber(TOTML,0)%> M
<%=formatnumber(TOTM2,0)%> M2
<%=formatnumber(TOTbad,0)%>
<%=totwt2%>
<%=totdt2%>
<%=formatnumber(lspeedtot,0)%>
<%
end if
strConexao.Close
Set strConexao=Nothing
end if
end if
%>
<%
if pc1ps1m>0 then
targetc1s1=42500*cdias
ranks1=(pc1ps1m/targetc1s1)
else
targetc1s1=0
ranks1=0
end if
if pc1ps2m>0 then
targetc1s2=40000*cdias
ranks2=(pc1ps2m/targetc1s2)
else
targetc1s2=0
ranks2=0
end if
if pc1ps3m>0 then
targetc1s3=37500*cdias
ranks3=(pc1ps3m/targetc1s3)
else
targetc1s3=0
ranks3=0
end if
if pc2ps1m>0 then
targetc2s1=42500*cdias
ranks4=(pc2ps1m/targetc2s1)
else
targetc2s1=0
ranks4=0
end if
if pc2ps2m>0 then
targetc2s2=40000*cdias
ranks5=(pc2ps2m/targetc2s2)
else
targetc2s2=0
ranks5=0
end if
if pc2ps3m>0 then
targetc2s3=37500*cdias
ranks6=(pc2ps3m/targetc2s3)
else
targetc2s3=0
ranks6=0
end if
'response.write(" r1= "&ranks1&" r2= "&ranks2&" r3="&ranks3&" r4="&ranks4&" r5="&ranks5&" r6="&ranks6)
targetc1=targetc1s1+targetc1s2+targetc1s3
targetc2=targetc2s1+targetc2s2+targetc2s3
If IsArray(arank)=false then
ReDim arank(8,2)
'Session("detalle2") = acart
arank(0,0)=ranks1
arank(1,0)=ranks2
arank(2,0)=ranks3
arank(3,0)=ranks4
arank(4,0)=ranks5
arank(5,0)=ranks6
arank(6,0)=0
arank(0,1)="R1"
arank(1,1)="R2"
arank(2,1)="R3"
arank(3,1)="R4"
arank(4,1)="R5"
arank(5,1)="R6"
arank(6,1)=0
end if
for i=lbound(arank) to ubound(arank)
r=0
ran2=7
do while r<7
if arank(i,0)>=arank(r,0) then
arank(i,1)=ran2
ran2=ran2-1
end if
r=r+1
loop
next
rank1=arank(0,1)
rank2=arank(1,1)
rank3=arank(2,1)
rank4=arank(3,1)
rank5=arank(4,1)
rank6=arank(5,1)
%>
Corrugator Performance
MC
Sh
M
M2
AVG (M)
Target (M)
Actual (%)
Rank
C1
S1
<%=formatnumber(pc1ps1m,0)%>
<%=formatnumber(pc1ps1m2,0)%>
<% if pc1ps1m2>0 and pc1ps1m>0 then %>
<%=formatnumber((pc1ps1m2/pc1ps1m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc1s1%>
<% if c1ps1m>0 and targetc1s1>0 then %>
<%=formatnumber((pc1ps1m/targetc1s1)*100,2)%>
<% else %>
0
<% end if %>
<%=rank1%>
S2
<%=formatnumber(pc1ps2m,0)%>
<%=formatnumber(pc1ps2m2,0)%>
<% if pc1ps2m2>0 and pc1ps2m>0 then %>
<%=formatnumber((pc1ps2m2/pc1ps2m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc1s2%>
<% if pc1ps2m>0 and targetc1s2>0 then %>
<%=formatnumber((pc1ps2m/targetc1s2)*100,2)%>
<% else %>
0
<% end if %>
<%=rank2%>
S3
<%=formatnumber(pc1ps3m,0)%>
<%=formatnumber(pc1ps3m2,0)%>
<% if pc1ps3m2>0 and pc1ps3m>0 then %>
<%=formatnumber((pc1ps3m2/pc1ps3m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc1s3%>
<% if pc1ps3m>0 and targetc1s3>0 then %>
<%=formatnumber((pc1ps3m/targetc1s3)*100,2)%>
<% else %>
0
<% end if %>
<%=rank3%>
C1 TOT
<%=formatnumber(C1TOTML,0)%>
<%=formatnumber(C1TOTM2,0)%>
<% if C1TOTM2>0 and C1TOTML>0 then %>
<%=formatnumber((C1TOTM2/C1TOTML)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc1%>
<% if C1TOTML>0 and targetc1>0 then %>
<%=formatnumber((C1TOTML/targetc1)*100,2)%>
<% else %>
0
<% end if %>
C2
S1
<%=formatnumber(pc2ps1m,0)%>
<%=formatnumber(pc2ps1m2,0)%>
<% if pc2ps1m2>0 and pc2ps1m>0 then %>
<%=formatnumber((pc2ps1m2/pc2ps1m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc2s1%>
<% if pc2ps1m>0 and targetc2s1>0 then %>
<%=formatnumber((pc2ps1m/targetc2s1)*100,2)%>
<% else %>
0
<% end if %>
<%=rank4%>
S2
<%=formatnumber(pc2ps2m,0)%>
<%=formatnumber(pc2ps2m2,0)%>
<% if pc2ps2m2>0 and pc2ps2m>0 then %>
<%=formatnumber((pc2ps2m2/pc2ps2m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc2s2%>
<% if pc2ps2m>0 and targetc2s2>0 then %>
<%=formatnumber((pc2ps2m/targetc2s2)*100,2)%>
<% else %>
0
<% end if %>
<%=rank5%>
S3
<%=formatnumber(pc2ps3m,0)%>
<%=formatnumber(pc2ps3m2,0)%>
<% if pc2ps3m2>0 and pc2ps3m>0 then %>
<%=formatnumber((pc2ps3m2/pc2ps3m)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc2s3%>
<% if pc2ps3m>0 and targetc2s3>0 then %>
<%=formatnumber((pc2ps3m/targetc2s3)*100,2)%>
<% else %>
0
<% end if %>
<%=rank6%>
C2 TOT
<%=formatnumber(C2TOTML,0)%>
<%=formatnumber(C2TOTM2,0)%>
<% if C2TOTM2>0 and C2TOTML>0 then %>
<%=formatnumber((C2TOTM2/C2TOTML)*100,2)%>
<% else %>
0
<% end if %>
<%=targetc2%>
<% if C2TOTML>0 and targetc2>0 then %>
<%=formatnumber((C2TOTML/targetc2)*100,2)%>
<% else %>
0
<% end if %>
G. TOT
<%=formatnumber(C1TOTML+C2TOTML,0)%>
<%=formatnumber(C1TOTM2+C2TOTM2,0)%>
<% if (C1TOTM2+C2TOTM2)>0 and (C1TOTML+C2TOTML)>0 then %>
<%
'Corr2.Close
''' Dias transcurridos
date_e = cdate(Date_end)
date_i = cdate(Date_ini)
diastrans = 0
contador=1
Do While cdate(date_i) =< (cdate(date_e))
lweekday = Weekday(cdate(date_i))
If lweekday = 1 Or lweekday = 7 Then
Else
diastrans = diastrans + 1
End If
'response.write(" Date1: "&date_i&" Day W: "&lweekday)
date_i = cdate(date_i) + 1
contador=contador+1
Loop
if diastrans = 0 then
diastrans = 1
end if
''' Fin dias transcurridos
%>
Production Performance against Target by Shift
(Target M2 vs Production M2) (<%=Date_ini%>)
1S
2S
3S
Total
Machine
Target M2
Prod M2
Target vs Prod (%)
Target M2
Prod M2
Target vs Prod (%)
Target M2
Prod M2
Target vs Prod (%)
Target M2
Prod M2
Target vs Prod (%)
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
ltotwos1=0
ltotwos2=0
ltotwos3=0
ltotqtys1=0
ltotqtys2=0
ltotqtys3=0
'If isArray(aturno) Then
'buscar producto duplicado
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)<>"" then
set Rstarget=dbsql3.execute("select * from target3 where machine='" & aturno(i,1) & "'")
if not Rstarget.eof then
lm21s=(Rstarget("m21s")*diastrans)
lm22s=(Rstarget("m22s")*diastrans)
lm23s=(Rstarget("m23s")*diastrans)
else
lm21s=0
lm22s=0
lm23s=0
end if
if aturno(i,3)>0 and lm21s>0 then
lpers1=(aturno(i,3)/lm21s)*100
else
lpers1=0
end if
if aturno(i,5)>0 and lm22s>0 then
lpers2=(aturno(i,5)/lm22s)*100
else
lpers2=0
end if
if aturno(i,7)>0 and lm23s>0 then
lpers3=(aturno(i,7)/lm23s)*100
else
lpers3=0
end if
if lpers1>89.99 then
lcolor1="#3CFF3C"
end if
if lpers1>80 and lpers1<90 then
lcolor1="#F8B310"
end if
if lpers1<80 then
lcolor1="#FF9595"
lcolort1="#000000"
end if
if lpers2>89.99 then
lcolor2="#3CFF3C"
end if
if lpers2>80 and lpers2<90 then
lcolor2="#F8B310"
end if
if lpers2<80 then
lcolor2="#FF9595"
lcolort2="#000000"
end if
if lpers3>89.99 then
lcolor3="#3CFF3C"
end if
if lpers3>80 and lpers3<90 then
lcolor3="#F8B310"
end if
if lpers3<80 then
lcolor3="#FF9595"
lcolort3="#000000"
end if
%>
<% end if %>
<%
ltotwo=lm21s+lm22s+lm23s
ltotactual=aturno(i,3)+aturno(i,5)+aturno(i,7)
ltotbad=aturno(i,9)+aturno(i,12)+aturno(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
%>
<%=ltotwo%>
<%=ltotactual%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF9595"
end if
if ltotpercent=0 then
%>
<% else %>
<%=formatnumber(ltotpercent,1)%> %
<% end if %>
<%
end if
if aturno(i,1)="GENCO" or aturno(i,1)="AUTOMAX +" or aturno(i,1)="PALLETIZE / STACK" or aturno(i,1)="V BOARDER 3" then
%>
Sub Total
<%=formatnumber(lstotwos1,0)%>
<%=formatnumber(lstotacts1,0)%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents2=0
end if
else
lstotpercents1=0
end if
if lstotacts1>0 and lstotwos1>0 then
lsubpers1=(lstotacts1/lstotwos1)*100
else
lsubpers1=0
end if
%>
<%=formatnumber(lsubpers1,1)%> %
<%=formatnumber(lstotwos2,0)%>
<%=formatnumber(lstotacts2,0)%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if
if lstotacts2>0 and lstotwos2>0 then
lsubpers2=(lstotacts2/lstotwos2)*100
else
lsubpers2=0
end if
%>
<%=formatnumber(lsubpers2,1)%> %
<%=formatnumber(lstotwos3,0)%>
<%=formatnumber(lstotacts3,0)%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotqtys3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if
if lstotacts3>0 and lstotwos3>0 then
lsubpers3=(lstotacts3/lstotwos3)*100
else
lsubpers3=0
end if
%>
<%=formatnumber(lsubpers3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) then
if lstotactday>0 and lstotwoday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
else
lstotpercentday=0
end if
%>
<%=formatnumber(lstotwoday,0)%>
<%=formatnumber(lstotactday,0)%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lsubpers1=0
lsubpers2=0
lsubpers3=0
lstotpercentday=0
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
end if
next
'else
Session("turno")=""
'end if
if ts=1 then
%>
Total Shift
<%=formatnumber(ltotwos1,0)%>
<%=formatnumber(ltotacts1,0)%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotacts1) then
if ltotwos1>0 and ltotacts1>0 then
ltotpercents1=(ltotacts1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=formatnumber(ltotwos2,0)%>
<%=formatnumber(ltotacts2,0)%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotacts2) then
if ltotwos2>0 and ltotacts2>0 then
ltotpercents2=(ltotacts2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=formatnumber(ltotwos3,0)%>
<%=formatnumber(ltotacts3,0)%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotacts3) then
if ltotacts3>0 and ltotwos3>0 then
ltotpercents3=(ltotacts3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
ltotactday=ltotacts1+ltotacts2+ltotacts3
if isnumeric(ltotwoday) and isnumeric(ltotactday) then
ltotpercentday=(ltotactday/ltotwoday)*100
else
ltotpercentday=0
end if
%>
<%=formatnumber(ltotwoday,0)%>
<%=formatnumber(ltotactday,0)%>
<%=formatnumber(ltotpercentday,1)%> %
<% end if %>
Production Performance against Target by Shift
(Target Qty vs Production Qty) (<%=Date_ini%>)
1S
2S
3S
Total
Machine
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
ltotwos1=0
ltotwos2=0
ltotwos3=0
ltotqtys1=0
ltotqtys2=0
ltotqtys3=0
ltotacts1=0
ltotacts2=0
ltotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
'If isArray(aturno) Then
'buscar producto duplicado
for i=lbound(aturno) to ubound(aturno)
if aturno(i,1)<>"" then
set Rstarget=dbsql3.execute("select * from target3 where machine='" & aturno(i,1) & "'")
if not Rstarget.eof then
lm21s=(Rstarget("qty1s")*diastrans)
lm22s=(Rstarget("qty2s")*diastrans)
lm23s=(Rstarget("qty3s")*diastrans)
else
lm21s=0
lm22s=0
lm23s=0
end if
if aturno(i,2)>0 and lm21s>0 then
lpers1=(aturno(i,2)/lm21s)*100
else
lpers1=0
end if
if aturno(i,4)>0 and lm22s>0 then
lpers2=(aturno(i,4)/lm22s)*100
else
lpers2=0
end if
if aturno(i,6)>0 and lm23s>0 then
lpers3=(aturno(i,6)/lm23s)*100
else
lpers3=0
end if
if lpers1>89.99 then
lcolor1="#3CFF3C"
end if
if lpers1>80 and lpers1<90 then
lcolor1="#F8B310"
end if
if lpers1<80 then
lcolor1="#FF9595"
lcolort1="#000000"
end if
if lpers2>89.99 then
lcolor2="#3CFF3C"
end if
if lpers2>80 and lpers2<90 then
lcolor2="#F8B310"
end if
if lpers2<80 then
lcolor2="#FF9595"
lcolort2="#000000"
end if
if lpers3>89.99 then
lcolor3="#3CFF3C"
end if
if lpers3>80 and lpers3<90 then
lcolor3="#F8B310"
end if
if lpers3<80 then
lcolor3="#FF9595"
lcolort3="#000000"
end if
%>
<% end if %>
<%
ltotwo=lm21s+lm22s+lm23s
ltotactual=aturno(i,2)+aturno(i,4)+aturno(i,6)
ltotbad=aturno(i,9)+aturno(i,12)+aturno(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
%>
<%=ltotwo%>
<%=ltotactual%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF9595"
end if
if ltotpercent=0 then
%>
<% else %>
<%=formatnumber(ltotpercent,1)%> %
<% end if %>
<%
end if
if aturno(i,1)="GENCO" or aturno(i,1)="AUTOMAX +" or aturno(i,1)="PALLETIZE / STACK" or aturno(i,1)="V BOARDER 3" then
%>
Sub Total
<%=formatnumber(lstotwos1,0)%>
<%=formatnumber(lstotacts1,0)%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents2=0
end if
else
lstotpercents1=0
end if
if lstotacts1>0 and lstotwos1>0 then
lsubpers1=(lstotacts1/lstotwos1)*100
else
lsubpers1=0
end if
%>
<%=formatnumber(lsubpers1,1)%> %
<%=formatnumber(lstotwos2,0)%>
<%=formatnumber(lstotacts2,0)%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if
if lstotacts2>0 and lstotwos2>0 then
lsubpers2=(lstotacts2/lstotwos2)*100
else
lsubpers2=0
end if
%>
<%=formatnumber(lsubpers2,1)%> %
<%=formatnumber(lstotwos3,0)%>
<%=formatnumber(lstotacts3,0)%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotqtys3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if
if lstotacts3>0 and lstotwos3>0 then
lsubpers3=(lstotacts3/lstotwos3)*100
else
lsubpers3=0
end if
%>
<%=formatnumber(lsubpers3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) then
if lstotwoday>0 and lstotactday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
else
lstotpercentday=0
end if
%>
<%=formatnumber(lstotwoday,0)%>
<%=formatnumber(lstotactday,0)%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lsubpers1=0
lsubpers2=0
lsubpers3=0
lstotpercentday=0
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
lstotpercentday=0
end if
next
'else
Session("turno")=""
'end if
if ts=1 then
%>
Total Shift
<%=formatnumber(ltotwos1,0)%>
<%=formatnumber(ltotacts1,0)%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotacts1) then
if ltotwos1>0 and ltotacts1>0 then
ltotpercents1=(ltotacts1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=formatnumber(ltotwos2,0)%>
<%=formatnumber(ltotacts2,0)%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotacts2) then
if ltotwos2>0 and ltotacts2>0 then
ltotpercents2=(ltotacts2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=formatnumber(ltotwos3,0)%>
<%=formatnumber(ltotacts3,0)%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotacts3) then
if ltotacts3>0 and ltotwos3>0 then
ltotpercents3=(ltotacts3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
ltotactday=ltotacts1+ltotacts2+ltotacts3
if isnumeric(ltotwoday) and isnumeric(ltotactday) then
ltotpercentday=(ltotactday/ltotwoday)*100
else
ltotpercentday=0
end if
%>
<%=formatnumber(ltotwoday,0)%>
<%=formatnumber(ltotactday,0)%>
<%=formatnumber(ltotpercentday,1)%> %
<% end if %>
<%
'********************************************* OFFSET
''''''''''''''''''''''''''''''' inicio maquinas Planta 2
Dim aturno2
aturno2 = Session("turno")
If isArray(aturno2)=false Then
ReDim aturno2(60,18)
aturno2(0,1)="PLANETA"
aturno2(1,1)="MITSUBISHI"
aturno2(2,1)="MIEHLE"
aturno2(3,1)="KBA"
session("turno") = aturno2
end if
aturno2 = Session("turno")
'''''''''''''''''''''''''''''''''''' fin maquinas
lturno1t=1
lturno2t=1
lturno3t=1
lturnotot=3
lturno1m=34
lturno2m=24
lturno3m=8
ltotmach=66
lturno1a=14
lturno2a=5
lturno3a=7
ltotaut=26
''''''''******* PERSONAL POR TURNO
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CDbl(stryear + strmonth + strday)
fechafinal = CDbl(stryear2 + strmonth2 + strday2)
''''''''''''''''''''''''''''''''''''''
'''''''''''calcula
strday = Right("00" & Day(Date_ini), 2)
strmonth = Right("00" & Month(Date_ini), 2)
stryear = Right("00" & Year(Date_ini), 4)
strday2 = Right("00" & Day(Date_end), 2)
strmonth2 = Right("00" & Month(Date_end), 2)
stryear2 = Right("00" & Year(Date_end), 4)
fechainicial = CStr(stryear + strmonth + strday)
fechafinal = CStr(stryear2 + strmonth2 + strday2)
'response.write(fechainicial)&" FI "
' response.write(fechafinal)&" Ff "
set Rsheadc=dbsql3.execute("select * from headcount where (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))>= '" & fechainicial & "' and (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))<= '" & fechafinal & "'")
If Rsheadc.EOF And Rsheadc.BOF Then
'
else
lturno1t=0
lturno2t=0
lturno3t=0
lturnotot=0
Rsheadc.movefirst
Do While Not Rsheadc.EOF
if Rsheadc("planta")=2 or Rsheadc("planta")=2 then
if Rsheadc("turno")=1 then
lturno1t=lturno1t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
if Rsheadc("turno")=2 then
lturno2t=lturno2t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
if Rsheadc("turno")=3 then
lturno3t=lturno3t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
lturnotot=lturnotot+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
end if
Rsheadc.MoveNext
Loop
end if
Rsheadc.close
set Rsheadc=nothing
if lturno1t=0 then
lturno1t=1
end if
if lturno2t=0 then
lturno2t=1
end if
if lturno3t=0 then
lturno3t=1
end if
if lturnotot=0 then
lturnotot=1
end if
%>
Production By Machine Offset - Shift Date: <%=Date_ini%> to <%=Date_end%> Generated: <%=time%>
<%
'************** Inventory
'lturno=0
Dim Rsinven12, Rsinven22, rswip2, Rsmachine2
Dim Sqlinven12, sqlinven22, sqlwip2
set Rsinven12=dbsql2.execute("select a.crp_id, a.ord_date, a.ord_seq, right(a.prod_date,6) prod_day, dbo.usf_no('C', '1', a.ord_date, a.ord_seq, '-') ord_no, (select code_nm from sta010t(nolock) where major_cd = '0000' and minor_cd = a.proc_cd) proc_nm, (select proc_nm from stb160t(nolock) where proc_cd = a.kong_cd) kong_nm, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) cust_nm, b.good_nm, b.color_qty, b.ord_qty, b.gross_sht_qty, b.julsu, case a.proc_cd when '101' then ceiling(b.gross_sht_qty / b.julsu) when '201' then ceiling(b.gross_sht_qty / b.julsu) when '301' then ceiling(b.gross_sht_qty / b.julsu) when '401' then ceiling(b.gross_sht_qty / b.julsu) when '501' then b.gross_sht_qty when '601' then b.gross_sht_qty when '701' then ceiling(b.gross_sht_qty / b.julsu) when '801' then b.gross_sht_qty end sht_qty, right(b.nap_date,6) nap_day, case a.last_chk when '0' then (a.prod_qty - a.bad_qty) else 0 end proc_qty, case a.last_chk when '1' then (a.prod_qty - a.bad_qty) else 0 end inv_qty, (a.prod_qty - a.bad_qty) prod_qty, a.bad_qty, a.str_date start_info, a.end_time , SUBSTRING(a.end_date,1,4)+SUBSTRING(a.end_date,6,2)+SUBSTRING(a.end_date,9,2) stop_info, SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) stop_time, case when (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) > '065000') and (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2)< '152001') then '1S' when (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) > '152000') and (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2)< '232001') then '2S' when (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) < '065001') or (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2)> '232000') then '3S' end as sturno, a.note from oop020t a(nolock) , ooa010t b(nolock) where a.crp_id = b.crp_id and a.ord_date = b.ord_date and a.ord_seq = b.ord_seq and b.del_yn = '0' and a.prod_date between '" & fechainicial & "' and '" & fechafinal & "' order by a.prod_date, sturno, a.kong_cd, a.ord_date, a.ord_seq, a.proc_cd, a.prod_no ")
If Rsinven12.EOF And Rsinven12.BOF Then
ExisteUsuario = False
Msg = "No records exist for this date."
Style = vbDefaultButton2
Title = "Msg from System"
Help = ""
ctxt = 1000
response.Write("No records exist for this date.")
Else
%>
W. O. Details Offset
PROD DATE
SHIFT
MACHINE
ORDER NO
CUSTOMER
ITEM
ORD QTY
PLAN_QTY
PROD QTY
BAD QTY
% Prod Vs Plan
<%
'Rsinven12.MoveFirst
nmachine=1
lworkorder1="a"
lworkorder2="b"
lmaquina1="a"
lmaquina2="b"
lprodqty=0
lbadqty=0
xplanqty=0
lprodqtym=0
lbadqtym=0
lplanqtym=0
Rsinven12.movefirst
Do While Not Rsinven12.EOF
'response.write((Rsinven12("real_prod_qty"))&" / "&Rsinven12("plan_qty"))
if not isnull(Rsinven12("prod_qty")) and not isnull(Rsinven12("sht_qty")) then
Porclogro=cdbl(Rsinven12("prod_qty"))/cdbl(Rsinven12("sht_qty"))*100
else
Porclogro=0
end if
xturno1=mid(Rsinven12("stop_info"),12,2)&mid(Rsinven12("stop_info"),15,2)&mid(Rsinven12("stop_info"),18,2)
'xturno1=Rsinven12("end_time")
''if (Rsinven12("prod_day")=fechainicial and xturno1<"065000") or (Rsinven12("prod_day")=fechafinal and xturno1>"065000") then
''else
if xturno1>"065000" and xturno1<"152000" then
lturno1="1S"
xturno="1S"
end if
if xturno1>"151959" and xturno1<"232000" then
lturno1="2S"
xturno="2S"
end if
if xturno1>"231959" or xturno1<"065001" then
lturno1="3S"
xturno="3S"
end if
lturno1=Rsinven12("sturno")
xturno=Rsinven12("sturno")
lmaquina1=Rsinven12("kong_nm")
Posicion= Instr(Rsinven12("good_nm"),"/")
%>
<%= Rsinven12("prod_day")%>
<%= lturno1 %>
<%= Rsinven12("kong_nm")%>
<%= Rsinven12("ord_no")%>
<%= Rsinven12("cust_nm")%>
<%if posicion>0 then%>
<%= mid(Rsinven12("good_nm"),1,posicion-1)%>
<%else%>
<%= Rsinven12("good_nm")%>
<% end if%>
<%= Rsinven12("gross_sht_qty")%>
<%= Rsinven12("sht_qty")%>
<%= Rsinven12("prod_qty")%>
<%= Rsinven12("bad_qty")%>
<%= formatnumber(porclogro,1)%> %
<%
lprodqty=lprodqty+cdbl(Rsinven12("prod_qty"))
lprodm2=0 'lprodm2+cdbl(Rsinven12("prod_m2"))
lbadqty=lbadqty+cdbl(Rsinven12("bad_qty"))
xplanqty=xplanqty+cdbl(Rsinven12("sht_qty"))
lprodqtym=lprodqtym+cdbl(Rsinven12("prod_qty"))
lprodm2m=0 'lprodm2m+cdbl(Rsinven12("prod_m2"))
lbadqtym=lbadqtym+cdbl(Rsinven12("bad_qty"))
lplanqtym=lplanqtym+cdbl(Rsinven12("sht_qty"))
Rsinven12.MoveNext
if not Rsinven12.eof then
'if lworkorder1<>lworkorder2 then
'end if
xturno2=mid(Rsinven12("stop_info"),12,2)&mid(Rsinven12("stop_info"),15,2)&mid(Rsinven12("stop_info"),18,2)
'xturno2=Rsinven12("end_time")
if xturno2>"065000" and xturno2<"152000" then
lturno2="1S"
'xturno="1S"
end if
if xturno2>"151959" and xturno2<"232000" then
lturno2="2S"
'xturno="2S"
end if
if xturno2>"231959" or xturno2<"065001" then
lturno2="3S"
'xturno="3S"
end if
lturno2=Rsinven12("sturno")
lmaquina2=Rsinven12("kong_nm")
lworkorder2=Rsinven12("ord_no")
lcondicion=0
if lturno1<>lturno2 and lmaquina1<>lmaquina2 then
lcondicion=1
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
If isArray(aturno2)=false Then
ReDim aturno2(60,18)
aturno2(1,1)=lmaquina1
if lturno1="1S" then
aturno2(1,2)=aturno2(1,2)+lprodqtym
aturno2(1,3)=aturno2(1,3)+lprodm2m
aturno2(1,8)=aturno2(1,8)+lplanqtym
aturno2(1,9)=aturno2(1,9)+lbadqtym
aturno2(1,10)=aturno2(1,10)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="2S" then
aturno2(1,4)=aturno2(1,4)+lprodqtym
aturno2(1,5)=aturno2(1,5)+lprodm2m
aturno2(1,11)=aturno2(1,11)+lplanqtym
aturno2(1,12)=aturno2(1,12)+lbadqtym
aturno2(1,13)=aturno2(1,13)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="3S" then
aturno2(1,6)=aturno2(1,6)+lprodqtym
aturno2(1,7)=aturno2(1,7)+lprodm2m
aturno2(1,14)=aturno2(1,14)+lplanqtym
aturno2(1,15)=aturno2(1,15)+lbadqtym
aturno2(1,16)=aturno2(1,16)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
session("turno") = aturno2
else
numprod=0
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)=lmaquina1 then
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
else
if aturno2(i,1)="" and not(incart) then
aturno2(i,1)=lmaquina1
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno2
end if 'is array
'if lplanqtym>0 then
if lprodqtym>0 then
%>
<%=xturno%>
Total <%= lmaquina1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqtym,0)%>
<%=formatnumber( lbadqtym,0)%>
<%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%>
<%=formatnumber(xplanqty,0)%>
<%=formatnumber(lprodqty,0)%>
<%=formatnumber(lbadqty,0)%>
<%=formatnumber(lcumplimiento,1)%> %
<%
end if
lprodqtym=0
lprodm2m=0
lbadqtym=0
lplanqtym=0
xplanqty=0
lprodqty=0
lprodm2=0
lbadqty=0
lmaquina1=lmaquina2
nmachine=nmachine+1
end if 'si maquina y turno
if lturno1<>lturno2 and lcondicion=0 then
lcondicion=1
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
If isArray(aturno2)=false Then
ReDim aturno2(60,18)
aturno2(1,1)=lmaquina1
if lturno1="1S" then
aturno2(1,2)=aturno2(1,2)+lprodqtym
aturno2(1,3)=aturno2(1,3)+lprodm2m
aturno2(1,8)=aturno2(1,8)+lplanqtym
aturno2(1,9)=aturno2(1,9)+lbadqtym
aturno2(1,10)=aturno2(1,10)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="2S" then
aturno2(1,4)=aturno2(1,4)+lprodqtym
aturno2(1,5)=aturno2(1,5)+lprodm2m
aturno2(1,11)=aturno2(1,11)+lplanqtym
aturno2(1,12)=aturno2(1,12)+lbadqtym
aturno2(1,13)=aturno2(1,13)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="3S" then
aturno2(1,6)=aturno2(1,6)+lprodqtym
aturno2(1,7)=aturno2(1,7)+lprodm2m
aturno2(1,14)=aturno2(1,14)+lplanqtym
aturno2(1,15)=aturno2(1,15)+lbadqtym
aturno2(1,16)=aturno2(1,16)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
session("turno") = aturno2
else
numprod=0
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)=lmaquina1 then
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
else
if aturno2(i,1)="" and not(incart) then
aturno2(i,1)=lmaquina1
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno2
end if 'is array
if lprodqtym>0 then
%>
Total turno: <%= lturno1%>
<%=formatnumber(xplanqty,0)%>
<%=formatnumber(lprodqty,0)%>
<%=formatnumber(lbadqty,0)%>
<%=formatnumber(lcumplimiento,1)%> %
<%
end if
xplanqty=0
lprodqty=0
lprodm2=0
lbadqty=0
lmaquina1=lmaquina2
nmachine=nmachine+1
end if 'si turno
if lcondicion=0 and lmaquina1<>lmaquina2 then
lcondicion=1
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
If isArray(aturno2)=false Then
ReDim aturno2(60,18)
aturno2(1,1)=lmaquina1
if lturno1="1S" then
aturno2(1,2)=aturno2(1,2)+lprodqtym
aturno2(1,3)=aturno2(1,3)+lprodm2m
aturno2(1,8)=aturno2(1,8)+lplanqtym
aturno2(1,9)=aturno2(1,9)+lbadqtym
aturno2(1,10)=aturno2(1,10)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="2S" then
aturno2(1,4)=aturno2(1,4)+lprodqtym
aturno2(1,5)=aturno2(1,5)+lprodm2m
aturno2(1,11)=aturno2(1,11)+lplanqtym
aturno2(1,12)=aturno2(1,12)+lbadqtym
aturno2(1,13)=aturno2(1,13)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="3S" then
aturno2(1,6)=aturno2(1,6)+lprodqtym
aturno2(1,7)=aturno2(1,7)+lprodm2m
aturno2(1,14)=aturno2(1,14)+lplanqtym
aturno2(1,15)=aturno2(1,15)+lbadqtym
aturno2(1,16)=aturno2(1,16)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
session("turno") = aturno2
else
numprod=0
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)=lmaquina1 then
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
else
if aturno2(i,1)="" and not(incart) then
aturno2(i,1)=lmaquina1
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno2
end if 'is array
'if lplanqtym>0 then
if lprodqtym>0 then
%>
<%=xturno%>
Total <%= lmaquina1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqtym,0)%>
<%=formatnumber( lbadqtym,0)%>
<%=formatnumber(lcumplimiento2,1)%> %
<%
end if
lprodqtym=0
lprodm2m=0
lbadqtym=0
lplanqtym=0
lmaquina1=lmaquina2
nmachine=nmachine+1
end if 'si maquina
else 'si eof
if xplanqty>0 then
'lplanqty=lplanqty+xplanqty
end if
if xplanqty>0 then
'lplanqtym=lplanqtym+xplanqty
end if
'lcumplimiento=(lprodqty/lplanqty)*100
if lprodqty>0 and lplanqty>0 then
lcumplimiento=(lprodqty/lplanqty)*100
else
if lprodqty>0 and lplanqty=0 then
'lplanqtym=lprodqtym
lcumplimiento=(lprodqty/lprodqty)*100
else
lcumplimiento=0
end if
end if
if lprodqtym>0 and lplanqtym>0 then
lcumplimiento2=(lprodqtym/lplanqtym)*100
else
if lprodqtym>0 and lplanqtym=0 then
'lplanqtym=lprodqtym
lcumplimiento2=(lprodqtym/lprodqtym)*100
else
lcumplimiento2=0
end if
end if
incart=false
'Dim aturno2
'aturno2 = Session("turno")
If isArray(aturno2)=false Then
ReDim aturno2(60,9)
aturno2(1,1)=lmaquina1
if lturno1="1S" then
aturno2(1,2)=aturno2(1,2)+lprodqtym
aturno2(1,3)=aturno2(1,3)+lprodm2m
aturno2(1,8)=aturno2(1,8)+lplanqtym
aturno2(1,9)=aturno2(1,9)+lbadqtym
aturno2(1,10)=aturno2(1,10)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="2S" then
aturno2(1,4)=aturno2(1,4)+lprodqtym
aturno2(1,5)=aturno2(1,5)+lprodm2m
aturno2(1,11)=aturno2(1,11)+lplanqtym
aturno2(1,12)=aturno2(1,12)+lbadqtym
aturno2(1,13)=aturno2(1,13)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
if lturno1="3S" then
aturno2(1,6)=aturno2(1,6)+lprodqtym
aturno2(1,7)=aturno2(1,7)+lprodm2m
aturno2(1,14)=aturno2(1,14)+lplanqtym
aturno2(1,15)=aturno2(1,15)+lbadqtym
aturno2(1,16)=aturno2(1,16)+lcumplimiento2
aturno2(1,18)=aturno2(1,18)+1
end if
session("turno") = aturno2
else
numprod=0
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)=lmaquina1 then
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
else
if aturno2(i,1)="" and not(incart) then
aturno2(i,1)=lmaquina1
if lturno1="1S" then
aturno2(i,2)=aturno2(i,2)+lprodqtym
aturno2(i,3)=aturno2(i,3)+lprodm2m
aturno2(i,8)=aturno2(i,8)+lplanqtym
aturno2(i,9)=aturno2(i,9)+lbadqtym
aturno2(i,10)=aturno2(i,10)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="2S" then
aturno2(i,4)=aturno2(i,4)+lprodqtym
aturno2(i,5)=aturno2(i,5)+lprodm2m
aturno2(i,11)=aturno2(i,11)+lplanqtym
aturno2(i,12)=aturno2(i,12)+lbadqtym
aturno2(i,13)=aturno2(i,13)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
if lturno1="3S" then
aturno2(i,6)=aturno2(i,6)+lprodqtym
aturno2(i,7)=aturno2(i,7)+lprodm2m
aturno2(i,14)=aturno2(i,14)+lplanqtym
aturno2(i,15)=aturno2(i,15)+lbadqtym
aturno2(i,16)=aturno2(i,16)+lcumplimiento2
aturno2(i,18)=aturno2(i,18)+1
end if
incart=true
end if
end if
numprod=numprod+1
next
session("turno")=aturno2
end if ' is array
%>
<%=xturno%>
Total <%= lmaquina1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqtym,0)%>
<%=formatnumber(lbadqtym,0)%>
<%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%>
<%=formatnumber(lplanqtym,0)%>
<%=formatnumber(lprodqty,0)%>
<%=formatnumber(lbadqty,0)%>
<%=formatnumber(lcumplimiento,1)%> %
<%
end if
''end if
Loop
Rsinven12.Close
Set Rsinven12 = Nothing
%>
<%
End If
%>
Summary by Machine /Shift (<%=Date_ini%>) Offset
Generated: <%=time%>
1S
2S
3S
Total
<%=lturno1t%>
<%=lturno2t%>
<%=lturno3t%>
<%=lturnotot%>
Machine
Qty
Qty
Qty
Qty
Shift Qty
<%
'If isArray(aturno2) Then
lstotqtys1=0
lstotqtys2=0
lstotqtys3=0
lstotm2s1=0
lstotm2s2=0
lstotm2s3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
lstotqtyday=0
lstotm2day=0
'buscar producto duplicado
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)<>"" then
if aturno2(i,1)="V BOARDER 1" or aturno2(i,1)="V BOARDER 2" or aturno2(i,1)="V BOARDER 3" then
lstotqtymvb=ltotqtymvb+aturno2(i,2)+aturno2(i,4)+aturno2(i,6)
lstotm2mvb=ltotm2mvb+aturno2(i,3)+aturno2(i,5)+aturno2(i,7)
lstotqtys1vb=lstotqtys1vb+aturno2(i,2)
lstotqtys2vb=lstotqtys2vb+aturno2(i,4)
lstotqtys3vb=lstotqtys3vb+aturno2(i,6)
lstotm2s1vb=lstotm2s1vb+aturno2(i,3)
lstotm2s2vb=lstotm2s2vb+aturno2(i,5)
lstotm2s3vb=lstotm2s3vb+aturno2(i,7)
lstotbads1vb=lstotbads1vb+aturno2(i,9)
lstotbads2vb=lstotbads2vb+aturno2(i,12)
lstotbads3vb=lstotbads3vb+aturno2(i,15)
end if
%>
<%
lstotqtys1=0
lstotqtys2=0
lstotqtys3=0
lstotm2s1=0
lstotm2s2=0
lstotm2s3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
lstotqtyday=0
lstotm2day=0
end if
if aturno2(i,1)="V BOARDER 3" then
%>
<%
lstotqtys1vb=0
lstotqtys2vb=0
lstotqtys3vb=0
lstotm2s1vb=0
lstotm2s2vb=0
lstotm2s3vb=0
lstotbads1vb=0
lstotbads2vb=0
lstotbads3vb=0
lstotqtydayvb=0
lstotm2dayvb=0
end if
if aturno2(i,1)="AUTOMAX +" then
%>
% Production by Machine /Shift (Prod vs WO qty) (<%=Date_ini%>) Offset
1S
2S
3S
Total
Machine
W/O
Prod Qty
Bad Qty
% Plan
W/O
Prod Qty
Bad Qty
% Plan
W/O
Prod Qty
Bad Qty
% Plan
W/O
Prod Qty
Bad Qty
% Plan
<%
'If isArray(aturno2) Then
'buscar producto duplicado
lstotbads1=0
lstotbads2=0
lstotbads3=0
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)<>"" then
if aturno2(i,10)>89.99 then
lcolor1="#3CFF3C"
end if
if aturno2(i,10)>80 and aturno2(i,10)<90 then
lcolor1="#FFFF80"
end if
if aturno2(i,10)<80 then
lcolor1="#FF9595"
end if
if aturno2(i,13)>89.99 then
lcolor2="#3CFF3C"
end if
if aturno2(i,13)>80 and aturno2(i,13)<90 then
lcolor2="#FFFF80"
end if
if aturno2(i,13)<80 then
lcolor2="#FF9595"
end if
if aturno2(i,16)>89.99 then
lcolor3="#3CFF3C"
end if
if aturno2(i,16)>80 and aturno2(i,16)<90 then
lcolor3="#FFFF80"
end if
if aturno2(i,16)<80 then
lcolor3="#FF9595"
end if
%>
<% end if
ltotwo=aturno2(i,8)+aturno2(i,11)+aturno2(i,14)
ltotactual=aturno2(i,2)+aturno2(i,4)+aturno2(i,6)
ltotbad=aturno2(i,9)+aturno2(i,12)+aturno2(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
ltotwos1=ltotwos1+aturno2(i,8)
ltotwos2=ltotwos2+aturno2(i,11)
ltotwos3=ltotwos3+aturno2(i,14)
lstotwos2=lstotwos2+aturno2(i,11)
lstotacts2=lstotacts2+aturno2(i,4)
lstotbads2=lstotbads2+aturno2(i,12)
lstotwos3=lstotwos3+aturno2(i,14)
lstotacts3=lstotacts3+aturno2(i,6)
lstotbads3=lstotbads3+aturno2(i,15)
%>
<%=ltotwo%>
<%=ltotactual%>
<%=ltotbad%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF5353"
end if
%>
<%=formatnumber(ltotpercent,1)%> %
<%
end if
if aturno2(i,1)="KBA" or aturno2(i,1)="AUTOMAX +" then
%>
Sub Total
<%=lstotwos1%>
<%=lstotacts1%>
<%=lstotbads1%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents1=0
end if
else
lstotpercents1=0
end if %>
<%=formatnumber(lstotpercents1,1)%> %
<%=lstotwos2%>
<%=lstotacts2%>
<%=lstotbads2%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if %>
<%=formatnumber(lstotpercents2,1)%> %
<%=lstotwos3%>
<%=lstotacts3%>
<%=lstotbads3%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotacts3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if %>
<%=formatnumber(lstotpercents3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) and lstotactday>0 then
if lstotactday>0 and lstotwoday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
else
lstotpercentday=0
end if
%>
<%=lstotwoday%>
<%=lstotactday%>
<%=lstotbadday%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
end if
next
'else
Session("turno")=""
'end if
%>
Total Shift
<%=ltotwos1%>
<%=ltotqtys1%>
<%=ltotbads1%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotqtys1) then
if ltotwos1>0 and ltotqtys1>0 then
ltotpercents1=(ltotqtys1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
<%=ltotqtys2%>
<%=ltotbads2%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotqtys2) then
if ltotwos2>0 and ltotqtys2>0 then
ltotpercents2=(ltotqtys2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
<%=ltotqtys3%>
<%=ltotbads3%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotqtys3) then
if ltotqtys3>0 and ltotwos3>0 then
ltotpercents3=(ltotqtys3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
if isnumeric(ltotwoday) and isnumeric(ltotqtyday) then
if ltotwoday>0 and ltotqtyday>0 then
ltotpercentday=(ltotqtyday/ltotwoday)*100
else
ltotpercentday=0
end if
else
ltotpercentday=0
end if
%>
<%=ltotwoday%>
<%=ltotqtyday%>
<%=ltotbadday%>
<%=formatnumber(ltotpercentday,1)%> %
<%
'''''''''''''''''''''''''''''''''''''''
'set Rscorr=dbsqlcorr.execute("select GOL,JIJG,JANG,WPOK,QTY,PQTY,SUJUNO,JOBYMD,CUST,BOX_NM,eqty,jtime,dtime from SHPSOUT(nolock) where jobymd >= '" & fechainicial & "' and jobymd <= '" & fechafinal & "' ")
xxm2=0
if xxm2=1 then
%>
% Production by Machine /Shift (Prod vs Target M2) (<%=Date_ini%>)
1S
2S
3S
Total
Machine
Target M2
% Target
Prod M2
% Target
Prod M2
% Target
Prod M2
% Target
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
ltotwos1=0
ltotwos2=0
ltotwos3=0
ltotqtys1=0
ltotqtys2=0
ltotqtys3=0
'If isArray(aturno2) Then
'buscar producto duplicado
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)<>"" then
set Rstarget=dbsql3.execute("select * from target3 where machine='" & aturno2(i,1) & "'")
if not Rstarget.eof then
lm21s=Rstarget("m21s")
lm22s=Rstarget("m22s")
lm23s=Rstarget("m23s")
else
lm21s=0
lm22s=0
lm23s=0
end if
if aturno2(i,3)>0 and lm21s>0 then
lpers1=(aturno2(i,3)/lm21s)*100
else
lpers1=0
end if
if aturno2(i,5)>0 and lm22s>0 then
lpers2=(aturno2(i,5)/lm22s)*100
else
lpers2=0
end if
if aturno2(i,7)>0 and lm23s>0 then
lpers3=(aturno2(i,7)/lm23s)*100
else
lpers3=0
end if
if lpers1>89.99 then
lcolor1="#3CFF3C"
end if
if lpers1>80 and lpers1<90 then
lcolor1="#F8B310"
end if
if lpers1<80 then
lcolor1="#FF9595"
lcolort1="#000000"
end if
if lpers2>89.99 then
lcolor2="#3CFF3C"
end if
if lpers2>80 and lpers2<90 then
lcolor2="#F8B310"
end if
if lpers2<80 then
lcolor2="#FF9595"
lcolort2="#ffffff"
end if
if lpers3>89.99 then
lcolor3="#3CFF3C"
end if
if lpers3>80 and lpers3<90 then
lcolor3="#F8B310"
end if
if lpers3<80 then
lcolor3="#FF9595"
lcolort3="#ffffff"
end if
%>
<%=aturno2(i,1)%>
<%=lm21s%>
<%=formatnumber(lpers1,1)%> %
<%=lm22s%>
<%=aturno2(i,5)%>
<%=formatnumber(lpers2,1)%> %
<%=lm23s%>
<%=aturno2(i,7)%>
<%=formatnumber(lpers3,1)%> %
<%
ltotwo=lm21s+lm22s+lm23s
ltotactual=aturno2(i,3)+aturno2(i,5)+aturno2(i,7)
ltotbad=aturno2(i,9)+aturno2(i,12)+aturno2(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
ltotwos1=ltotwos1+lm21s
ltotwos2=ltotwos2+lm22s
ltotwos3=ltotwos3+lm23s
lstotwos1=lstotwos1+lm21s
lstotwos2=lstotwos2+lm22s
lstotwos3=lstotwos3+lm23s
lstotacts1=lstotacts1+aturno2(i,3)
lstotacts2=lstotacts2+aturno2(i,5)
lstotacts3=lstotacts3+aturno2(i,7)
ltotacts1=ltotacts1+aturno2(i,3)
ltotacts2=ltotacts2+aturno2(i,5)
ltotacts3=ltotacts3+aturno2(i,7)
lstotbads1=lstotbads1+aturno2(i,9)
lstotbads2=lstotbads2+aturno2(i,12)
lstotbads3=lstotbads3+aturno2(i,15)
%>
<%=ltotwo%>
<%=ltotactual%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF9595"
end if
%>
<%=formatnumber(ltotpercent,1)%> %
<%
end if
if aturno2(i,1)="KBA" or aturno2(i,1)="AUTOMAX +" then
%>
Sub Total
<%=lstotwos1%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents2=0
end if
else
lstotpercents1=0
end if
if lstotacts1>0 and lstotwos1>0 then
lsubpers1=(lstotacts1/lstotwos1)*100
else
lsubpers1=0
end if
%>
<%=formatnumber(lsubpers1,1)%> %
<%=lstotwos2%>
<%=lstotacts2%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if
if lstotacts2>0 and lstotwos2>0 then
lsubpers2=(lstotacts2/lstotwos2)*100
else
lsubpers2=0
end if
%>
<%=formatnumber(lsubpers2,1)%> %
<%=lstotwos3%>
<%=lstotacts3%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotqtys3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if
if lstotacts3>0 and lstotwos3>0 then
lsubpers3=(lstotacts3/lstotwos3)*100
else
lsubpers3=0
end if
%>
<%=formatnumber(lsubpers3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) and lstotwoday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
%>
<%=lstotwoday%>
<%=lstotactday%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lsubpers1=0
lsubpers2=0
lsubpers3=0
lstotpercentday=0
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
end if
next
'else
Session("turno")=""
'end if
%>
Total Shift
<%=ltotwos1%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotacts1) then
if ltotwos1>0 and ltotacts1>0 then
ltotpercents1=(ltotacts1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
<%=ltotacts2%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotacts2) then
if ltotwos2>0 and ltotacts2>0 then
ltotpercents2=(ltotacts2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
<%=ltotacts3%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotacts3) then
if ltotacts3>0 and ltotwos3>0 then
ltotpercents3=(ltotacts3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
ltotactday=ltotacts1+ltotacts2+ltotacts3
if isnumeric(ltotwoday) and isnumeric(ltotactday) and ltotwoday>0 then
ltotpercentday=(ltotactday/ltotwoday)*100
else
ltotpercentday=0
end if
%>
<%=ltotwoday%>
<%=ltotactday%>
<%=formatnumber(ltotpercentday,1)%> %
<%
end if
%>
% Production by Machine /Shift (Prod vs Target Qty) (<%=Date_ini%>) Offset
1S
2S
3S
Total
Machine
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
Target Qty
W.O.
Prod Qty
% Target
<%
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
ltotwos1=0
ltotwos2=0
ltotwos3=0
ltotqtys1=0
ltotqtys2=0
ltotqtys3=0
ltotacts1=0
ltotacts2=0
ltotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
'If isArray(aturno2) Then
'buscar producto duplicado
for i=lbound(aturno2) to ubound(aturno2)
if aturno2(i,1)<>"" then
set Rstarget=dbsql3.execute("select * from target3 where machine='" & aturno2(i,1) & "'")
if not Rstarget.eof then
lm21s=Rstarget("qty1s")
lm22s=Rstarget("qty2s")
lm23s=Rstarget("qty3s")
else
lm21s=0
lm22s=0
lm23s=0
end if
if aturno2(i,2)>0 and lm21s>0 then
lpers1=(aturno2(i,2)/lm21s)*100
else
lpers1=0
end if
if aturno2(i,4)>0 and lm22s>0 then
lpers2=(aturno2(i,4)/lm22s)*100
else
lpers2=0
end if
if aturno2(i,6)>0 and lm23s>0 then
lpers3=(aturno2(i,6)/lm23s)*100
else
lpers3=0
end if
if lpers1>89.99 then
lcolor1="#3CFF3C"
end if
if lpers1>80 and lpers1<90 then
lcolor1="#F8B310"
end if
if lpers1<80 then
lcolor1="#FF9595"
lcolort1="#000000"
end if
if lpers2>89.99 then
lcolor2="#3CFF3C"
end if
if lpers2>80 and lpers2<90 then
lcolor2="#F8B310"
end if
if lpers2<80 then
lcolor2="#FF9595"
lcolort2="#000000"
end if
if lpers3>89.99 then
lcolor3="#3CFF3C"
end if
if lpers3>80 and lpers3<90 then
lcolor3="#F8B310"
end if
if lpers3<80 then
lcolor3="#FF9595"
lcolort3="#000000"
end if
%>
<%=aturno2(i,1)%>
<%=lm21s%>
<%=aturno2(i,8)%>
<%=aturno2(i,2)%>
<% if lpers1>0 then %>
<%=formatnumber(lpers1,1)%> %
<% else %>
<% end if %>
<%=lm22s%>
<%=aturno2(i,11)%>
<%=aturno2(i,4)%>
<% if lpers2>0 then %>
<%=formatnumber(lpers2,1)%> %
<% else %>
<% end if %>
<%=lm23s%>
<%=aturno2(i,14)%>
<%=aturno2(i,6)%>
<% if lpers3>0 then %>
<%=formatnumber(lpers3,1)%> %
<% else %>
<% end if
ltotwo=lm21s+lm22s+lm23s
ltotactual=aturno2(i,2)+aturno2(i,4)+aturno2(i,6)
ltotbad=aturno2(i,9)+aturno2(i,12)+aturno2(i,15)
if isnumeric(ltotwo) and isnumeric(ltotactual) and ltotwo>0 and ltotactual>0 then
ltotpercent=(ltotactual/ltotwo)*100
else
ltotpercent=0
end if
if not isnumeric(ltotpercent) then
ltotpercent=0
end if
ltotwos1=ltotwos1+lm21s
ltotwos2=ltotwos2+lm22s
ltotwos3=ltotwos3+lm23s
lstotwos1=lstotwos1+lm21s
lstotwos2=lstotwos2+lm22s
lstotwos3=lstotwos3+lm23s
lstotacts1=lstotacts1+aturno2(i,2)
lstotacts2=lstotacts2+aturno2(i,4)
lstotacts3=lstotacts3+aturno2(i,6)
ltotacts1=ltotacts1+aturno2(i,2)
ltotacts2=ltotacts2+aturno2(i,4)
ltotacts3=ltotacts3+aturno2(i,6)
lstotbads1=lstotbads1+aturno2(i,9)
lstotbads2=lstotbads2+aturno2(i,12)
lstotbads3=lstotbads3+aturno2(i,15)
%>
<%=ltotwo%>
<%=ltotactual%>
<%if ltotpercent>89.99 then
lcolor4="#3CFF3C"
end if
if ltotpercent>80 and ltotpercent<90 then
lcolor4="#F8B310"
end if
if ltotpercent<80 then
lcolor4="#FF9595"
end if
if ltotpercent>0 then
%>
<%=formatnumber(ltotpercent,1)%> %
<% else %>
<% end if %>
<%
end if
if aturno2(i,1)="KBA" or aturno2(i,1)="AUTOMAX +" then
%>
Sub Total
<%=lstotwos1%>
<%=lstotacts1%>
<%
if isnumeric(lstotwos1) and isnumeric(lstotacts1) then
if lstotwos1>0 and lstotacts1>0 then
lstotpercents1=(lstotacts1/lstotwos1)*100
else
lstotpercents2=0
end if
else
lstotpercents1=0
end if
if lstotacts1>0 and lstotwos1>0 then
lsubpers1=(lstotacts1/lstotwos1)*100
else
lsubpers1=0
end if
%>
<%=formatnumber(lsubpers1,1)%> %
<%=lstotwos2%>
<%=lstotacts2%>
<%
if isnumeric(lstotwos2) and isnumeric(lstotacts2) then
if lstotwos2>0 and lstotacts2>0 then
lstotpercents2=(lstotacts2/lstotwos2)*100
else
lstotpercents2=0
end if
else
lstotpercents2=0
end if
if lstotacts2>0 and lstotwos2>0 then
lsubpers2=(lstotacts2/lstotwos2)*100
else
lsubpers2=0
end if
%>
<%=formatnumber(lsubpers2,1)%> %
<%=lstotwos3%>
<%=lstotacts3%>
<%
if isnumeric(lstotwos3) and isnumeric(lstotacts3) then
if lstotqtys3>0 and lstotwos3>0 then
lstotpercents3=(lstotacts3/lstotwos3)*100
else
lstotpercents3=0
end if
else
lstotpercents3=0
end if
if lstotacts3>0 and lstotwos3>0 then
lsubpers3=(lstotacts3/lstotwos3)*100
else
lsubpers3=0
end if
%>
<%=formatnumber(lsubpers3,1)%> %
<%
lstotwoday=lstotwos1+lstotwos2+lstotwos3
lstotbadday=lstotbads1+lstotbads2+lstotbads3
lstotactday=lstotacts1+lstotacts2+lstotacts3
if isnumeric(lstotwoday) and isnumeric(lstotactday) and lstotwoday>0 then
lstotpercentday=(lstotactday/lstotwoday)*100
else
lstotpercentday=0
end if
%>
<%=lstotwoday%>
<%=lstotactday%>
<%=formatnumber(lstotpercentday,1)%> %
<%
lsubpers1=0
lsubpers2=0
lsubpers3=0
lstotpercentday=0
lstotwos1=0
lstotwos2=0
lstotwos3=0
lstotacts1=0
lstotacts2=0
lstotacts3=0
lstotbads1=0
lstotbads2=0
lstotbads3=0
end if
next
'else
Session("turno")=""
'end if
%>
Total Shift
<%=ltotwos1%>
<%=ltotacts1%>
<%
if isnumeric(ltotwos1) and isnumeric(ltotacts1) then
if ltotwos1>0 and ltotacts1>0 then
ltotpercents1=(ltotacts1/ltotwos1)*100
else
ltotpercents2=0
end if
else
ltotpercents1=0
end if %>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
<%=ltotacts2%>
<%
if isnumeric(ltotwos2) and isnumeric(ltotacts2) then
if ltotwos2>0 and ltotacts2>0 then
ltotpercents2=(ltotacts2/ltotwos2)*100
else
ltotpercents2=0
end if
else
ltotpercents2=0
end if %>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
<%=ltotacts3%>
<%
if isnumeric(ltotwos3) and isnumeric(ltotacts3) then
if ltotacts3>0 and ltotwos3>0 then
ltotpercents3=(ltotacts3/ltotwos3)*100
else
ltotpercents3=0
end if
else
ltotpercents3=0
end if %>
<%=formatnumber(ltotpercents3,1)%> %
<%
ltotwoday=ltotwos1+ltotwos2+ltotwos3
ltotbadday=ltotbads1+ltotbads2+ltotbads3
ltotactday=ltotacts1+ltotacts2+ltotacts3
if isnumeric(ltotwoday) and isnumeric(ltotactday) and ltotwoday>0 then
ltotpercentday=(ltotactday/ltotwoday)*100
else
ltotpercentday=0
end if
%>
<%=ltotwoday%>
<%=ltotactday%>
<%=formatnumber(ltotpercentday,1)%> %
<%
'********************************************** FIN DE OFFSET
%>
<%
End If
Rsfore0.Close
Set Rsfore0 = Nothing
'''''''''''''
%>