<%@ 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() 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 = stryear & strmonth & strday fechafinal = stryear2 & strmonth2 & strday2 ljob_date= stryear & strmonth & strday Dim Rsfore Dim Sqlfore Set rsvende = Server.CreateObject("ADODB.RecordSet") xtipo="VENDEDOR" 'rsvende.CursorType = adOpenDynamic 'set rsvende=dbsql.execute("SELECT major_cd, minor_cd, code_nm FROM sta010t WHERE (((major_cd)='9001')) ORDER BY minor_cd") %> Inventory Report Summary
     
From : To:  
<% header if busca="" or busca=null then origen=doc end if 'ljob_date="20160602" %>
Inventory by Summary Report to <%=ljob_date%>
<% d="/" sla="/" cero1="00" cero2="0000" '''''''''''calcula '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) Dim Rsmir1, Rsmir2,RsInvoice,RsInvoice2 Dim Sqlmir1, sqlmir2, sqlInvoice, sqlInvoice2 '************************************** V-Boards Plant 1 '************************************** End V-Boards '******************************** %>

<% '********************************************************** Inventory apostrofe=chr(39) Dim Rspurch1, Rsinven2,rswip Dim Sqlinven1,sqlinven2,sqlwip 'set Rsinven1=dbsql.execute("select b.crp_id,b.cust_cd,(select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) as customer,b.item, max(b.price) as price,sum(a.in_qty1) - sum(a.out_qty1) as inv_qty1,round(max(b.price) * (sum(a.in_qty1) - sum(a.out_qty1)),3) as inv_amt1, sum(a.in_qty2) - sum(a.out_qty2) as inv_qty2,round(max(b.price) * (sum(a.in_qty2) - sum(a.out_qty2)),3) as inv_amt2, sum(a.in_qty3) - sum(a.out_qty3) as inv_qty3,round(max(b.price) * (sum(a.in_qty3) - sum(a.out_qty3)),3) as inv_amt3 " & _ '" from (select a.cust_cd, a.item, sum(isnull(a.in_qty1,0)) in_qty1, sum(isnull(a.out_qty1,0)) out_qty1,sum(isnull(a.in_qty2,0)) in_qty2, sum(isnull(a.out_qty2,0)) out_qty2, sum(isnull(a.in_qty3,0)) in_qty3, sum(isnull(a.out_qty3,0)) out_qty3 from ( select cust_cd, item, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty2 , 0 out_qty2, 0 in_qty3 , 0 out_qty3 from inout_table where class = '1' and crp_id = '10' and local_cd = '1' and job_date<='" & ljob_date & "' group by cust_cd, item union " & _ '" select cust_cd, item,0 in_qty1 , sum(qty) out_qty1,0 in_qty2 , 0 out_qty2,0 in_qty3 , 0 out_qty3 from inout_table where class = '2' and crp_id = '10' and local_cd = '1' and job_date<='" & ljob_date & "' group by cust_cd, item union select cust_cd, item, 0 in_qty2 , 0 out_qty2, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty3, 0 out_qty3 from inout_table where class = '1' and crp_id = '10' and local_cd = '2' and job_date<='" & ljob_date & "' group by cust_cd, item " & _ '" union select cust_cd, item, 0 in_qty2 , 0 out_qty2, 0 in_qty1 , sum(qty) out_qty1, 0 in_qty3 , 0 out_qty3 from inout_table where class = '2' and crp_id = '10' and local_cd = '2' and job_date<='" & ljob_date & "' group by cust_cd, item " & _ '" union select cust_cd, item, 0 in_qty1 , 0 out_qty1,0 in_qty2, 0 out_qty2, sum(qty) in_qty3,0 out_qty3 from inout_table where class = '1' and crp_id = '10' and local_cd = '3' and job_date<='" & ljob_date & "' group by cust_cd, item " & _ '" union select cust_cd, item, 0 in_qty1 ,0 out_qty1, 0 in_qty2 , 0 out_qty2, 0 in_qty3 , sum(qty) out_qty3 from inout_table where class = '2' and crp_id = '10' and local_cd = '3' and job_date<='" & ljob_date & "' group by cust_cd, item) a group by a.cust_cd, a.item) a, (select crp_id, cust_cd, item, max(price) price from inout_table where class = '1' group by crp_id, cust_cd, item ) b " & _ '" where a.cust_cd = b.cust_cd and a.item = b.item and b.crp_id = '10' and (a.in_qty1 - a.out_qty1 <> 0 or a.in_qty2 - a.out_qty2 <> 0 or a.in_qty3 - a.out_qty3 <> 0 ) group by b.crp_id, b.cust_cd, b.item order by b.crp_id, b.cust_cd, b.item") set Rspurch1=dbsql.execute("select a.crp_id, a.bal_date, right(a.bal_date,6) bal_day, a.jaje_seq, a.bal_seq, a.bal_sub, (select cust_nm from stb010t where cust_cd = a.cust_cd ) cust_nm, c.jaje_nm, c.jaje_danwi, a.cust_cd, a.bal_qty, a.nap_date, a.bal_price, a.bal_amt, a.bal_kind, case a.money_chk when '1' then 'Dollar' when '2' then 'Peso' end money_chk, a.po_no, a.terms, a.attn, a.note1, a.note2, a.user_nm, a.prt_chk, a.ship_cust, a.ship_addr1, a.ship_addr2, a.ship_addr3, a.ship_tel, a.ship_fax, a.vat_class, b.ipgo_qty, (select code_nm from sta010t(nolock) where major_cd = '9020' and minor_cd = a.class) class, case c.jaje_kind when '' then '' else (select code_nm from sta010t where major_cd = '9200' and minor_cd = c.jaje_kind) end jaje_kind_nm, case c.proc_cd when '' then '' else (select code_nm from sta010t where major_cd = '9300' and minor_cd = c.proc_cd) end proc_nm, a.r_no1, a.r_no2, a.r_no3 from mtd011t a(nolock) left outer join ( select crp_id, bal_Date, bal_seq, bal_sub, po_no, sum(ipgo_qty) ipgo_qty from mtd020t(nolock) group by crp_id, bal_Date, bal_seq, bal_sub, po_no) b on a.crp_id = b.crp_id and a.bal_date = b.bal_date and a.bal_seq = b.bal_seq and a.bal_sub = b.bal_sub and a.po_no = b.po_no, mtd010t c(nolock) where a.jaje_seq = c.jaje_seq and a.crp_id ='10' and a.bal_date between '" & lfecinicial & "' and '" &lfecfinal & "' and a.cust_cd like '%' and a.po_no like '%' and a.jaje_seq like '%' and c.jaje_kind like '%' and isnull(c.proc_cd,'000') like '%' and (a.r_no1 like '%' or a.r_no2 like '%' or a.r_no3 like '%') and a.money_chk like '%' order by a.bal_date, a.bal_seq, a.bal_sub ") If Rspurch1.EOF And Rspurch1.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) Else lOBSamsung = 0 lOTSamsung = 0 lOBSamsung2 = 0 lOTSamsung2 = 0 lOBSamsung2WH3 = 0 lOTSamsungWH3 = 0 lOBSamsung3 = 0 lOTSamsung3 = 0 lSamsungObsOB1 = 0 lSamsungObsOT1 = 0 lSamsungObsOB1WH3 = 0 lSamsungObsOT1WH3 = 0 lOthers1 = 0 lOthers2 = 0 lTotalQtyInv1 = 0 lTotalQtyInv2 = 0 lTotalM2Inv1 = 0 lTotalM2Inv2 = 0 lTotalDllInv1 = 0 lTotalDllInv2 = 0 lTotalQtyInvD = 0 lTotalM2InvD = 0 lTotalDllInvD = 0 lqtyinven = 0 lqtyinven2 = 0 lamtinven = 0 lm2inven = 0 lcode1="BN69-12806A" lcode2="BN69-12807A" lcode3="BN69-00391U" lcode4="BN69-00391Y" lcode10="BN69-05528A V-BOARD" lcode11="BN69-00391E V-BOARD" lcode12="BN69-06769A" 'lcode13="BN69-12807A" lcode1qty=0 lcode1amt=0 lcode2qty=0 lcode2amt=0 lcode3qty=0 lcode3amt=0 lcode4qty=0 lcode4amt=0 lcode10qty=0 lcode10amt=0 lcode11qty=0 lcode11amt=0 lcode12qty=0 lcode12amt=0 'lcode13qty=0 'lcode13amt=0 %> <% Rspurch1.MoveFirst Do While Not Rspurch1.EOF %> <% Rspurch1.MoveNext Loop End If Rspurch1.Close Set Rspurch1 = Nothing %>
P/O Date  PO_NO  Seq  Vendor  Sub  Description  Plant  Qty  Date(m/d/y)  Currency  U/P  Amount  Rec_Qty  No Request  Note 
<%=rspurch1("Bal_day")%>  <%=rspurch1("po_no")%>  <%=rspurch1("bal_sec")%>  <%=rspurch1("cust_nm")%>  <%=rspurch1("bal_sub")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>  <%=rspurch1("")%>