<%@ LANGUAGE = "VBScript" %> <% 'Session.Timeout = 120 busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.QueryString("Date_ini") Date_end=Request.QueryString("Date_end") if Date_ini="" or Date_ini=null then 'Date_ini=date()-(day(date()))+1 Date_ini=date() Date_end=date() 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) '''''''''''''''''''''''''''''''''''''' 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) '''''''''''''''''''''''''''''''''''''' %> <% Response.Buffer = TRUE Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "content-disposition", "inline; filename=ProduceByRouting"&date()&".xls" %> Report Produce Summary By Routing <% d="/" sla="/" cero1="00" cero2="0000" '''''''''''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 " layer=weekday(date()-1) If layer = 1 Then lfecinicial=date()-3 lfecfinal=date()-3 else if layer=7 then lfecinicial=date()-2 lfecfinal=date()-2 else lfecinicial=date()-1 lfecfinal=date()-1 end if end if strdaybook = Right("00" & Day(lfecinicial), 2) strmonthbook = Right("00" & Month(lfecinicial), 2) stryearbook = Right("00" & Year(lfecinicial), 4) lfechabook1 = CStr(stryearbook + strmonthbook + strdaybook) lfechabook2 = CStr(stryearbook + strmonthbook + strdaybook) If lvende = "" Then vendedor_i = "00000" vendedor_f = "99999" Else if cdbl(lvende)=0 then vendedor_i = "00000" vendedor_f = "99999" else vendedor_i = lvende vendedor_f = lvende end if End If '************** Inventory Dim Rsinven1, Rsinven2,rswip Dim Sqlinven1,sqlinven2,sqlwip 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 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' and a.cust_cd like '%' 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 & "' 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 %>
SINIL INDUSTRY
BITACORA DE PRODUCCION
Periodo: <%=Date_ini%> <% '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") %> <% if not isnull(Rsinven1("plan_qty")) then lplanqty=lplanqty+cdbl(Rsinven1("plan_qty")) end if lprodqty=lprodqty+cdbl(Rsinven1("real_prod_qty")) lprodm2=lprodm2+cdbl(Rsinven1("prod_m2")) lbadqty=lbadqty+cdbl(Rsinven1("bad_qty")) if not isnull(Rsinven1("plan_qty")) then lplanqtym=lplanqtym+cdbl(Rsinven1("plan_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 lturno2=Rsinven1("wrok_gubun_nm") lmaquina2=Rsinven1("proc_nm") if lturno1<>lturno2 or lmaquina1<>lmaquina2 then if lmaquina1<>lmaquina2 then lcumplimiento2=(lprodqtym/lplanqtym)*100 %> <% lmaquina1=lmaquina2 lprodqtym=0 lprodm2m=0 lbadqtym=0 lplanqtym=0 end if if lturno1<>lturno2 then lcumplimiento=(lprodqty/lplanqty)*100 %> <% lturno1=lturno2 lprodqty=0 lprodm2=0 lbadqty=0 lplanqty=0 end if end if else lcumplimiento=(lprodqty/lplanqty)*100 lcumplimiento2=(lprodqtym/lplanqtym)*100 %> <% end if Loop %>
PROD DATE MACHINE SHIFT ORDER NO CUSTOMER ITEM ORD QTY PLAN_QTY PROD QTY PROD M2 BAD QTY % Logro Vs Plan Comments
<%= Rsinven1("prod_day")%> <%= Rsinven1("proc_nm")%> <%= Rsinven1("wrok_gubun_nm")%> <%= Rsinven1("ord_no")%> <%= Rsinven1("cust_nm")%> <%= Rsinven1("good_nm")%> <%= Rsinven1("ord_qty")%> <%= Rsinven1("plan_qty")%> <%= Rsinven1("real_prod_qty")%> <%= Rsinven1("prod_m2")%> <%= Rsinven1("bad_qty")%> <%= formatnumber(porclogro,1)%> %
Total <%= lmaquina1%> <%=formatnumber(lprodqtym,0)%> <%=formatnumber( lprodm2m,0)%> <%=formatnumber( lbadqtym,0)%> <%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%> <%=formatnumber(lprodqty,0)%> <%=formatnumber( lprodm2,0)%> <%=formatnumber( lbadqty,0)%> <%=formatnumber(lcumplimiento,1)%> %
Total <%= lmaquina1%> <%=formatnumber(lprodqtym,0)%> <%=formatnumber( lprodm2m,0)%> <%=formatnumber( lbadqtym,0)%> <%=formatnumber(lcumplimiento2,1)%> %
Total turno: <%= lturno1%> <%=formatnumber(lprodqty,0)%> <%=formatnumber( lprodm2,0)%> <%=formatnumber( lbadqty,0)%> <%=formatnumber(lcumplimiento,1)%> %
<% End If Rsinven1.Close Set Rsinven1 = Nothing '**************end inventory %>