<%@ LANGUAGE = "VBScript" %> <% Session.Timeout = 120 Server.ScriptTimeout = 5000 busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.Form("Date_ini") Date_end=Request.Form("Date_end") lvende=Request.Form("cvende") 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 aturno aturno = Session("turno") If isArray(aturno)=false Then ReDim aturno(60,18) 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)="PIEMME" aturno(13,1)="AUTOMAX 1" aturno(14,1)="AUTOMAX 2" aturno(15,1)="AUTOMAX 3" aturno(16,1)="LABEL(STOCK)" aturno(17,1)="Stock II" aturno(18,1)="LABEL(MANUAL)" aturno(19,1)="GLUING" aturno(20,1)="FOSHAN DUPLEX GLUER" aturno(21,1)="SLITTER" aturno(22,1)="STITCHING" aturno(23,1)="PALLETIZE / STACK" aturno(24,1)="VBOARD" session("turno") = aturno end if aturno = Session("turno") '''''''''''''''''''''''''''''''''''' fin maquinas lturno1t=200 lturno2t=152 lturno3t=116 lturnotot=468 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) '''''''''''''''''''''''''''''''''''''' %> 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 " %>

SINIL INDUSTRY
Production By Machine - Shift
Date: <%=Date_ini%> 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_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 %>
<% 'Rsinven1.MoveFirst nmachine=1 lworkorder1="a" lworkorder2="b" lmaquina1="a" lmaquina2="b" 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"),"/") %> <%if posicion>0 then%> <%else%> <% end if%> <% lprodqty=lprodqty+cdbl(Rsinven1("real_prod_qty")) 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")) lbadqtym=lbadqtym+cdbl(Rsinven1("bad_qty")) Rsinven1.MoveNext 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,18) 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 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 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 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 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 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 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 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 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 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) %> <% lmaquina1=lmaquina2 lprodqtym=0 lprodm2m=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 %> <% lturno1=lturno2 lprodqty=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,9) 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 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 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 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 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 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 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 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 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 end if incart=true end if end if numprod=numprod+1 next session("turno")=aturno end if ' is array %> <% end if Loop Rsinven1.Close Set Rsinven1 = Nothing %>
W. O. Details
PROD DATE SHIFT MACHINE ORDER NO CUSTOMER ITEM ORD QTY PLAN_QTY PROD QTY PROD M2 BAD QTY % Prod Vs Plan
<%= Rsinven1("prod_day")%> <%= Rsinven1("wrok_gubun_nm")%> <%= Rsinven1("proc_nm")%> <%= Rsinven1("ord_no")%> <%= Rsinven1("cust_nm")%><%= mid(Rsinven1("good_nm"),1,posicion-1)%> <%= Rsinven1("good_nm")%> <%= Rsinven1("ord_qty")%> <%= Rsinven1("plan_qty")%> <%= Rsinven1("real_prod_qty")%> <%= Rsinven1("prod_m2")%> <%= Rsinven1("bad_qty")%> <%= formatnumber(porclogro,1)%> %
<%=xturno%> Total <%= lmaquina1%> <%=formatnumber(lplanqtym,0)%> <%=formatnumber(lprodqtym,0)%> <%=formatnumber( lprodm2m,0)%> <%=formatnumber( lbadqtym,0)%> <%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%> <%=formatnumber(lplanqty,0)%> <%=formatnumber(lprodqty,0)%> <%=formatnumber(lprodm2,0)%> <%=formatnumber(lbadqty,0)%> <%=formatnumber(lcumplimiento,1)%> %
<%=xturno%> Total <%= lmaquina1%> <%=formatnumber(lplanqtym,0)%> <%=formatnumber(lprodqtym,0)%> <%=formatnumber(lprodm2m,0)%> <%=formatnumber(lbadqtym,0)%> <%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%> <%=formatnumber(lplanqty,0)%> <%=formatnumber(lprodqty,0)%> <%=formatnumber(lprodm2,0)%> <%=formatnumber(lbadqty,0)%> <%=formatnumber(lcumplimiento,1)%> %
<% End If %>
<% 'If isArray(aturno) Then 'buscar producto duplicado for i=lbound(aturno) to ubound(aturno) if aturno(i,1)<>"" then %> <% ltotqtym=aturno(i,2)+aturno(i,4)+aturno(i,6) ltotm2m=aturno(i,3)+aturno(i,5)+aturno(i,7) ltotbadm=aturno(i,9)+aturno(i,12)+aturno(i,15) lstotqtys1=lstotqtys1+aturno(i,2) lstotqtys2=lstotqtys2+aturno(i,4) lstotqtys3=lstotqtys3+aturno(i,6) lstotm2s1=lstotm2s1+aturno(i,3) lstotm2s2=lstotm2s2+aturno(i,5) lstotm2s3=lstotm2s3+aturno(i,7) lstotbads1=lstotbads1+aturno(i,9) lstotbads2=lstotbads2+aturno(i,12) lstotbads3=lstotbads3+aturno(i,15) ltotqtys1=ltotqtys1+aturno(i,2) ltotqtys2=ltotqtys2+aturno(i,4) ltotqtys3=ltotqtys3+aturno(i,6) ltotm2s1=ltotm2s1+aturno(i,3) ltotm2s2=ltotm2s2+aturno(i,5) ltotm2s3=ltotm2s3+aturno(i,7) ltotbads1=ltotbads1+aturno(i,9) ltotbads2=ltotbads2+aturno(i,12) ltotbads3=ltotbads3+aturno(i,15) %> <% end if if aturno(i,1)="PIEMME" 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 aturno(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 aturno(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%>)
Generated: <%=time%>
1S
2S
3S
Total
<%=lturno1t%>
<%=lturno2t%>
<%=lturno3t%>
<%=lturnotot%>
Machine Qty M2 Qty M2 Qty M2 Qty M2
<%=aturno(i,1)%>
<%=aturno(i,2)%>
<%=aturno(i,3)%>
<%=aturno(i,4)%>
<%=aturno(i,5)%>
<%=aturno(i,6)%>
<%=aturno(i,7)%>
<%=ltotqtym%>
<%=ltotm2m%>
SubTotal
<%=lstotqtys1%>
<%=lstotm2s1%>
<%=lstotqtys2%>
<%=lstotm2s2%>
<%=lstotqtys3%>
<%=lstotm2s3%>
<%=lstotqtyday%>
<%=lstotm2day%>
AVG
<%=formatnumber(lstotqtys1/lturno1t,0)%>
<%=formatnumber(lstotm2s1/lturno1t,0)%>
<%=formatnumber(lstotqtys2/lturno2t,0)%>
<%=formatnumber(lstotm2s2/lturno2t,0)%>
<%=formatnumber(lstotqtys3/lturno3t,0)%>
<%=formatnumber(lstotm2s3/lturno3t,0)%>
<%=formatnumber(lstotqtyday/lturnotot,0)%>
<%=formatnumber(lstotm2day/lturnotot,0)%>
SubTotal
<%=lstotqtys1%>
<%=lstotm2s1%>
<%=lstotqtys2%>
<%=lstotm2s2%>
<%=lstotqtys3%>
<%=lstotm2s3%>
<%=lstotqtyday%>
<%=lstotm2day%>
AVG
<%=formatnumber(lstotqtys1/lturno1t,0)%>
<%=formatnumber(lstotm2s1/lturno1t,0)%>
<%=formatnumber(lstotqtys2/lturno2t,0)%>
<%=formatnumber(lstotm2s2/lturno2t,0)%>
<%=formatnumber(lstotqtys3/lturno3t,0)%>
<%=formatnumber(lstotm2s3/lturno3t,0)%>
<%=formatnumber(lstotqtyday/lturnotot,0)%>
<%=formatnumber(lstotm2day/lturnotot,0)%>
Total Shift
<%=ltotqtys1%>
<%=ltotm2s1%>
<%=ltotqtys2%>
<%=ltotm2s2%>
<%=ltotqtys3%>
<%=ltotm2s3%>
<%=ltotqtyday%>
<%=ltotm2day%>
AVG
<%=formatnumber(lflexoqtys1/lturno1t,0)%>
<%=formatnumber(lflexom2s1/lturno1t,0)%>
<%=formatnumber(lflexoqtys2/lturno2t,0)%>
<%=formatnumber(lflexom2s2/lturno2t,0)%>
<%=formatnumber(lflexoqtys3/lturno3t,0)%>
<%=formatnumber(lflexom2s3/lturno3t,0)%>
<%=formatnumber(lflexoqtytot/lturnotot,0)%>
<%=formatnumber(lflexom2tot/lturnotot,0)%>

<% '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="#F8B310" end if if aturno(i,10)<80 then lcolor1="#FF5353" 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="#F8B310" end if if aturno(i,13)<80 then lcolor2="#FF5353" 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="#F8B310" end if if aturno(i,16)<80 then lcolor3="#FF5353" 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) %> <%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 aturno(i,1)="PIEMME" or aturno(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) 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 ltotpercentday=(ltotqtyday/ltotwoday)*100 else ltotpercentday=0 end if %>
% Production by Machine /Shift (Prod vs WO qty) (<%=Date_ini%>)
 
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
<%=aturno(i,1)%> 
<%=aturno(i,8)%>
<%=aturno(i,2)%>
<%=aturno(i,9)%>
<%=formatnumber(aturno(i,10),1)%> %
<%=aturno(i,11)%>
<%=aturno(i,4)%>
<%=aturno(i,12)%>
<%=formatnumber(aturno(i,13),1)%> %
<%=aturno(i,14)%>
<%=aturno(i,6)%>
<%=aturno(i,15)%>
<%=formatnumber(aturno(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 from SHPSOUT where jobymd >= '" & fechainicial & "' and jobymd <= '" & fechafinal & "' ") If Rscorr.EOF And Rscorr.BOF Then response.Write("No records exist for corr. this date.") Else %>
<% TOTML=0 TOTM2=0 Do While Not Rscorr.EOF %> <% TOTTARGET=TOTTARGET+Rscorr("QTY") TOTPROD=TOTPROD+Rscorr("PQTY") TOTML=TOTML+(Rscorr("JANG")*Rscorr("PQTY")/1000) TOTM2=TOTM2+(Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000) RsCORR.MoveNext LOOP END IF rscorr.close '''''''''''''''''''''''' %>
CORRUGATOR
PROD DATE ORDER NO. CUSTOMER BOX ITEM FLUTE PAPER COMBINATION LENGTH WIDTH TARGET PROD QTY TOTAL LENGTH (M) TOTAL M2
<%= Rscorr("JOBYMD")%> <%= Rscorr("SUJUNO")%> <%= Rscorr("CUST")%> <%= Rscorr("BOX_NM")%> <%= Rscorr("GOL")%> <%= Rscorr("JIJG")%> <%= Rscorr("JANG")%> <%= Rscorr("WPOK")%> <%= Rscorr("QTY")%> <%= Rscorr("PQTY")%> <%= formatnumber((Rscorr("JANG")*Rscorr("PQTY")/1000),0)%> <%= formatnumber((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000),0) %>
               
<%=FORMATNUMBER(TOTTARGET,0)%> 
<%=FORMATNUMBER(TOTPROD,0) %> 
<%=FORMATNUMBER(TOTML,0) %> M
<%=FORMATNUMBER(TOTM2,0) %> M2

<% 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") lm22s=Rstarget("m22s") lm23s=Rstarget("m23s") 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="#FF5353" lcolort1="#ffffff" 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="#FF5353" 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="#FF5353" lcolort3="#ffffff" 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 ltotwos1=ltotwos1+lm21s ltotwos2=ltotwos2+lm22s ltotwos3=ltotwos3+lm23s lstotwos1=lstotwos1+lm21s lstotwos2=lstotwos2+lm22s lstotwos3=lstotwos3+lm23s lstotacts1=lstotacts1+aturno(i,3) lstotacts2=lstotacts2+aturno(i,5) lstotacts3=lstotacts3+aturno(i,7) ltotacts1=ltotacts1+aturno(i,3) ltotacts2=ltotacts2+aturno(i,5) ltotacts3=ltotacts3+aturno(i,7) lstotbads1=lstotbads1+aturno(i,9) lstotbads2=lstotbads2+aturno(i,12) lstotbads3=lstotbads3+aturno(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 aturno(i,1)="PIEMME" or aturno(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) 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) 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 Prod M2   % Target Target M2 Prod M2   % Target Target M2 Prod M2   % Target Target M2 Prod M2   % Target
<%=aturno(i,1)%> 
<%=lm21s%>
<%=aturno(i,3)%>
<%=formatnumber(lpers1,1)%> %
<%=lm22s%>
<%=aturno(i,5)%>
<%=formatnumber(lpers2,1)%> %
<%=lm23s%>
<%=aturno(i,7)%>
<%=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)%> %