SINIL INDUSTRY
Production Corrugator Machine Date: <%=Date_ini%> To: <%=Date_end%> Generated: <%=time%>
<%
'************** Inventory
'lturno=0
Dim Rsinven1, Rsinven2, rswip, Rsmachine
Dim Sqlinven1, sqlinven2, sqlwip
'''''''''''''''''''''''''''''''''''''''
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")
If Rscorr.EOF And Rscorr.BOF Then
response.Write("No records exist for corr. this date.")
Else
%>
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
Rscorr.movefirst
lturno1="1" 'Rscorr("JOBJO")
lturno2="1" 'Rscorr("JOBJO")
Do While Not Rscorr.EOF
'response.write(Rscorr("JOBJO"))
lstime=Rscorr("STIME")
lestado=1
fecfin=(mid(RsCORR("Edate"),1,4)&mid(RsCORR("Edate"),6,2)&mid(RsCORR("Edate"),9,2))
if ucase(trim(Rscorr("jobymd")))=ucase(trim(fechafinal)) and Rscorr("STIME")>"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<152000 then
lturno2="1"
end if
if shora2>151959 and shora2<232000 then
lturno2="2"
'response.write(" t2x "&ehora2)
end if
if shora2>231959 or shora2<065000 then
lturno2="3"
'response.write(" T3 "&ehora2)
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=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
'response.write(" t3 "&Sec2n3)
end if
'lturno2=Rscorr("JOBJO")
if lturno2="3" and Ehora2<235959 then
'RsCORR.MoveNext
' if RsCORR.eof then
' Lturno2="2"
' end if
'RsCORR.MovePrevious
end if
end if
'response.write(" t1 "<urno1)
if RsCORR.eof or lturno1<>lturno2 then
'response.write(" t2 "<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)
if lturno1="1" then
lshift="1st"
end if
if lturno1="2" then
lshift="2nd"
end if
if lturno1="3" then
lshift="3rd"
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
end if ' nshift
LOOP
END IF
rscorr.close
''''''''''''''''''''''''
lspeedtot1=int(TOTML/((TOTjtime)/60))
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))
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)
%>
GRAND TOTAL
<%=formatnumber(TOTITEMS,0)%>
<%=FORMATNUMBER(TOTTARGET,0)%>
<%=FORMATNUMBER(TOTPROD,0) %>
<%=FORMATNUMBER(TOTML,0) %> M
<%=FORMATNUMBER(TOTM2,0) %> M2
<%=FORMATNUMBER(TOTbad,0) %>
<%=TOTwt %> hrs
<%=TOTdt %> hrs
<%=formatnumber(lspeedtot1,0)%>
<%
End If
Rsfore0.Close
Set Rsfore0 = Nothing
dbsql3.Close
Set dbsql3 = Nothing
'''''''''''''
%>