<%@ LANGUAGE = "VBScript" %> <% 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 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) 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) ''''''''''''''''''''''''''''''' inicio maquinas 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 '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 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) '''''''''''''''''''''''''''''''''''''' %> Offset Report By Routing datepicker demo
       
Period:  
         
<% 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 dia=" & Day(Date_ini) & " and month=" & Month(Date_ini) & " and year=" & Year(Date_ini)) response.write(day(Date_ini)&" "&month(Date_ini)&" "&year(Date_ini)) 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 %>

SINIL INDUSTRY
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)< '152000') then '1S' when (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) > '15065000') and (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2)< '232000') then '2S' when (SUBSTRING(a.end_date,12,2)+SUBSTRING(a.end_date,15,2)+SUBSTRING(a.end_date,18,2) < '065000') 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 %>
<% 'Rsinven12.MoveFirst nmachine=1 lworkorder1="a" lworkorder2="b" lmaquina1="a" lmaquina2="b" 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("sturno") ''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"),"/") %> <%if posicion>0 then%> <%else%> <% end if%> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% end if ''end if Loop Rsinven12.Close Set Rsinven12 = Nothing %>
W. O. Details Offset
PROD DATE SHIFT MACHINE ORDER NO CUSTOMER ITEM ORD QTY PLAN_QTY PROD QTY BAD QTY % Prod Vs Plan
<%= Rsinven12("prod_day")%> <%= lturno1 %> <%= Rsinven12("kong_nm")%> <%= Rsinven12("ord_no")%> <%= Rsinven12("cust_nm")%><%= mid(Rsinven12("good_nm"),1,posicion-1)%> <%= Rsinven12("good_nm")%> <%= Rsinven12("gross_sht_qty")%> <%= Rsinven12("sht_qty")%> <%= Rsinven12("prod_qty")%> <%= Rsinven12("bad_qty")%> <%= formatnumber(porclogro,1)%> %
<%=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)%> %
Total turno: <%= lturno1%> <%=formatnumber(xplanqty,0)%> <%=formatnumber(lprodqty,0)%> <%=formatnumber(lbadqty,0)%> <%=formatnumber(lcumplimiento,1)%> %
<%=xturno%> Total <%= lmaquina1%> <%=formatnumber(lplanqtym,0)%> <%=formatnumber(lprodqtym,0)%> <%=formatnumber( lbadqtym,0)%> <%=formatnumber(lcumplimiento2,1)%> %
<%=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 %>
<% '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 %> <% ltotqtym=aturno2(i,2)+aturno2(i,4)+aturno2(i,6) ltotm2m=aturno2(i,3)+aturno2(i,5)+aturno2(i,7) %> <% 'end if ltotbadm=aturno2(i,9)+aturno2(i,12)+aturno2(i,15) lstotqtys1=lstotqtys1+aturno2(i,2) lstotqtys2=lstotqtys2+aturno2(i,4) lstotqtys3=lstotqtys3+aturno2(i,6) lstotm2s1=lstotm2s1+aturno2(i,3) lstotm2s2=lstotm2s2+aturno2(i,5) lstotm2s3=lstotm2s3+aturno2(i,7) lstotbads1=lstotbads1+aturno2(i,9) lstotbads2=lstotbads2+aturno2(i,12) lstotbads3=lstotbads3+aturno2(i,15) ltotqtys1=ltotqtys1+aturno2(i,2) ltotqtys2=ltotqtys2+aturno2(i,4) ltotqtys3=ltotqtys3+aturno2(i,6) ltotm2s1=ltotm2s1+aturno2(i,3) ltotm2s2=ltotm2s2+aturno2(i,5) ltotm2s3=ltotm2s3+aturno2(i,7) ltotbads1=ltotbads1+aturno2(i,9) ltotbads2=ltotbads2+aturno2(i,12) ltotbads3=ltotbads3+aturno2(i,15) end if if aturno2(i,1)="KBA" then %> <% lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3 lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3 %> <% lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3 lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3 lflexoqtys1=lstotqtys1 lflexom2s1=lstotm2s1 lflexoqtys2=lstotqtys2 lflexom2s2=lstotm2s2 lflexoqtys3=lstotqtys3 lflexom2s3=lstotm2s3 %> <% 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 %> <% lstotqtydayvb=lstotqtys1vb+lstotqtys2vb+lstotqtys3vb lstotm2dayvb=lstotm2s1vb+lstotm2s2vb+lstotm2s3vb %> <% 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)="LABEL(MANUAL)" then %> <% lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3 lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3 %> <% lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3 lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3 lflexoqtys1=lflexoqtys1+lstotqtys1 lflexom2s1=lflexom2s1+lstotm2s1 lflexoqtys2=lflexoqtys2+lstotqtys2 lflexom2s2=lflexom2s2+lstotm2s2 lflexoqtys3=lflexoqtys3+lstotqtys3 lflexom2s3=lflexom2s3+lstotm2s3 %> <% 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 aturno2(60,9) 'end if %> <% ltotqtyday=ltotqtys1+ltotqtys2+ltotqtys3 ltotm2day=ltotm2s1+ltotm2s2+ltotm2s3 %> <% lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3 lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3 lflexoqtytot=lflexoqtys1+lflexoqtys2+lflexoqtys3 lflexom2tot=lflexom2s1+lflexom2s2+lflexom2s3 %>
Summary by Machine /Shift (<%=Date_ini%>) Offset
Generated: <%=time%>
1S
2S
3S
Total
<%=lturno1t%>
<%=lturno2t%>
<%=lturno3t%>
<%=lturnotot%>
Machine Qty   Qty   Qty   Qty   Shift Qty 
<%=aturno2(i,1)%>
<%=aturno2(i,2)%>
 
<%=aturno2(i,4)%>
 
<%=aturno2(i,6)%>
 
<%=ltotqtym%>
  <%=aturno2(i,18)%> 
SubTotal
<%=lstotqtys1%>
 
<%=lstotqtys2%>
 
<%=lstotqtys3%>
 
<%=lstotqtyday%>
   
AVG
<%=formatnumber(lstotqtys1/lturno1t,0)%>
 
<%=formatnumber(lstotqtys2/lturno2t,0)%>
 
<%=formatnumber(lstotqtys3/lturno3t,0)%>
 
<%=formatnumber(lstotqtyday/lturnotot,0)%>
   
VBOARD
<%=lstotqtys1vb%>
 
<%=lstotqtys2vb%>
 
<%=lstotqtys3vb%>
 
<%=lstotqtydayvb%>
   
SubTotal
<%=lstotqtys1%>
 
<%=lstotqtys2%>
 
<%=lstotqtys3%>
 
<%=lstotqtyday%>
   
AVG
<%=formatnumber(lstotqtys1/lturno1t,0)%>
 
<%=formatnumber(lstotqtys2/lturno2t,0)%>
 
<%=formatnumber(lstotqtys3/lturno3t,0)%>
 
<%=formatnumber(lstotqtyday/lturnotot,0)%>
   
Total Shift
<%=ltotqtys1%>
 
<%=ltotqtys2%>
 
<%=ltotqtys3%>
 
<%=ltotqtyday%>
   
AVG
<%=formatnumber(lflexoqtys1/lturno1t,0)%>
 
<%=formatnumber(lflexoqtys2/lturno2t,0)%>
 
<%=formatnumber(lflexoqtys3/lturno3t,0)%>
 
<%=formatnumber(lflexoqtytot/lturnotot,0)%>
   

<% '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 %> <% 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) lstotwos1=lstotwos1+aturno2(i,8) lstotwos2=lstotwos2+aturno2(i,11) lstotwos3=lstotwos3+aturno2(i,14) lstotacts1=lstotacts1+aturno2(i,2) lstotacts2=lstotacts2+aturno2(i,4) lstotacts3=lstotacts3+aturno2(i,6) lstotbads1=lstotbads1+aturno2(i,9) lstotbads2=lstotbads2+aturno2(i,12) lstotbads3=lstotbads3+aturno2(i,15) %> <%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 %> <% end if if aturno2(i,1)="KBA" or aturno2(i,1)="LABEL(MANUAL)" then %> <% 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 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 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 %> <% 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 %> <% 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 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 %> <% 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 %> <% 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 %> <% 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 %>
% 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
<%=aturno2(i,1)%> 
<%=aturno2(i,8)%>
<%=aturno2(i,2)%>
<%=aturno2(i,9)%>
<%=formatnumber(aturno2(i,10),1)%> %
<%=aturno2(i,11)%>
<%=aturno2(i,4)%>
<%=aturno2(i,12)%>
<%=formatnumber(aturno2(i,13),1)%> %
<%=aturno2(i,14)%>
<%=aturno2(i,6)%>
<%=aturno2(i,15)%>
<%=formatnumber(aturno2(i,16),1)%> %
<%=ltotwo%>
<%=ltotactual%>
<%=ltotbad%>
<%=formatnumber(ltotpercent,1)%> %
Sub Total
<%=lstotwos1%>
<%=lstotacts1%>
<%=lstotbads1%>
<%=formatnumber(lstotpercents1,1)%> %
<%=lstotwos2%>
<%=lstotacts2%>
<%=lstotbads2%>
<%=formatnumber(lstotpercents2,1)%> %
<%=lstotwos3%>
<%=lstotacts3%>
<%=lstotbads3%>
<%=formatnumber(lstotpercents3,1)%> %
<%=lstotwoday%>
<%=lstotactday%>
<%=lstotbadday%>
<%=formatnumber(lstotpercentday,1)%> %
Total Shift
<%=ltotwos1%>
<%=ltotqtys1%>
<%=ltotbads1%>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
<%=ltotqtys2%>
<%=ltotbads2%>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
<%=ltotqtys3%>
<%=ltotbads3%>
<%=formatnumber(ltotpercents3,1)%> %
<%=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 %>

<% 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 %> <% 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) %> <%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 %> <% end if if aturno2(i,1)="KBA" or aturno2(i,1)="LABEL(MANUAL)" then %> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% 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 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 %> <% 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 %> <% 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 %> <% 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 %>
% 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
<%=aturno2(i,1)%> 
<%=lm21s%>
<%=formatnumber(lpers1,1)%> %
<%=lm22s%>
<%=aturno2(i,5)%>
<%=formatnumber(lpers2,1)%> %
<%=lm23s%>
<%=aturno2(i,7)%>
<%=formatnumber(lpers3,1)%> %
<%=ltotwo%>
<%=ltotactual%>
<%=formatnumber(ltotpercent,1)%> %
Sub Total
<%=lstotwos1%>
<%=formatnumber(lsubpers1,1)%> %
<%=lstotwos2%>
<%=lstotacts2%>
<%=formatnumber(lsubpers2,1)%> %
<%=lstotwos3%>
<%=lstotacts3%>
<%=formatnumber(lsubpers3,1)%> %
<%=lstotwoday%>
<%=lstotactday%>
<%=formatnumber(lstotpercentday,1)%> %
Total Shift
<%=ltotwos1%>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
<%=ltotacts2%>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
<%=ltotacts3%>
<%=formatnumber(ltotpercents3,1)%> %
<%=ltotwoday%>
<%=ltotactday%>
<%=formatnumber(ltotpercentday,1)%> %
<% end if %>
<% 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="#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 %> <% 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) %> <%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 %> <% end if if aturno2(i,1)="KBA" or aturno2(i,1)="LABEL(MANUAL)" then %> <% 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 %> <% 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 %> <% 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 %> <% 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 %> <% 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 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 %> <% 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 %> <% 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 %> <% 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 %>
% 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
<%=aturno2(i,1)%> 
<%=lm21s%>
<%=aturno2(i,8)%>
<%=aturno2(i,2)%>
<%=formatnumber(lpers1,1)%> %
<%=lm22s%>
<%=aturno2(i,11)%>
<%=aturno2(i,4)%>
<%=formatnumber(lpers2,1)%> %
<%=lm23s%>
<%=aturno2(i,14)%>
<%=aturno2(i,6)%>
<%=formatnumber(lpers3,1)%> %
<%=ltotwo%>
 
<%=ltotactual%>
<%=formatnumber(ltotpercent,1)%> %
Sub Total
<%=lstotwos1%>
 
<%=lstotacts1%>
<%=formatnumber(lsubpers1,1)%> %
<%=lstotwos2%>
 
<%=lstotacts2%>
<%=formatnumber(lsubpers2,1)%> %
<%=lstotwos3%>
 
<%=lstotacts3%>
<%=formatnumber(lsubpers3,1)%> %
<%=lstotwoday%>
 
<%=lstotactday%>
<%=formatnumber(lstotpercentday,1)%> %
Total Shift
<%=ltotwos1%>
 
<%=ltotacts1%>
<%=formatnumber(ltotpercents1,1)%> %
<%=ltotwos2%>
 
<%=ltotacts2%>
<%=formatnumber(ltotpercents2,1)%> %
<%=ltotwos3%>
 
<%=ltotacts3%>
<%=formatnumber(ltotpercents3,1)%> %
<%=ltotwoday%>
 
<%=ltotactday%>
<%=formatnumber(ltotpercentday,1)%> %