<%@ 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_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) '''''''''''''''''''''''' bpjan=3481000 bpfeb=3592000 bpmar=4014000 bpapr=4038000 bpmay=4160000 bpjun=4340000 bpjul=4793000 bpaug=5414000 bpsep=6585000 bpoct=7478000 bpnov=6131000 bpdec=3925000 bptot=(bpjan+bpfeb+bpmar+bpapr+bpmay+bpjun+bpjul+bpaug+bpsep+bpoct+bpnov+bpdec) '''''''''''''''''''''''''''''''''''''' Dim Rsfore Dim Sqlfore set Rsfore=dbsql3.execute("SELECT * FROM forecast WHERE month=" & Month(Date_end) & " and year=" & Year(Date_end)) 'Set Rsfore = CurrentDb.OpenRecordset(Sqlfore) If Rsfore.EOF And Rsfore.BOF Then forecast = 0 bussines = 0 Else forecast = Rsfore("forecast") bussines = Rsfore("bussines") End If Rsfore.Close Set Rsfore = Nothing 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 <% header if busca="" or busca=null then origen=doc end if %>
Inventory Report Summary
<% 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 Dim Rsmir1, Rsmir2,RsInvoice,RsInvoice2 Dim Sqlmir1, sqlmir2, sqlInvoice, sqlInvoice2 '************************************** V-Boards Plant 1 '************************************** End V-Boards '******************************** %>

<% '********************************************************** Inventory apostrofe=chr(39) '********************************************************** Inventory Dim Rsinven1, 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, (select item_class from stb040t(nolock) where cust_cd=b.cust_cd and good_nm = b.item) as prodclass,(select proc_cd1 from stb040t(nolock) where cust_cd=b.cust_cd and good_nm = b.item) as machine1, 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, sum(a.in_qty4) - sum(a.out_qty4) as inv_qty4,round(max(b.price) * (sum(a.in_qty4) - sum(a.out_qty4)),3) as inv_amt4 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,sum(isnull(a.in_qty4,0)) in_qty4, sum(isnull(a.out_qty4,0)) out_qty4 from (select cust_cd, item, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty2 ,0 out_qty2, 0 in_qty3 , 0 out_qty3, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '1' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '1' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '2' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '2' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '3' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '3' 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,0 out_qty3, sum(qty) in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '4' 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 , 0 out_qty3, 0 in_qty4 , sum(qty) out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '4' 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 or a.in_qty4 - a.out_qty4 <> 0) group by b.crp_id, b.cust_cd, b.item order by b.crp_id, b.cust_cd, b.item") 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, (select item_class from stb040t(nolock) where cust_cd=b.cust_cd and good_nm = b.item) as prodclass,(select proc_cd1 from stb040t(nolock) where cust_cd=b.cust_cd and good_nm = b.item) as machine1, max(b.price) as price, max(b.lastmov) as lastmov,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, sum(a.in_qty4) - sum(a.out_qty4) as inv_qty4,round(max(b.price) * (sum(a.in_qty4) - sum(a.out_qty4)),3) as inv_amt4 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,sum(isnull(a.in_qty4,0)) in_qty4, sum(isnull(a.out_qty4,0)) out_qty4 from (select cust_cd, item, sum(qty) in_qty1 , 0 out_qty1, 0 in_qty2 ,0 out_qty2, 0 in_qty3 , 0 out_qty3, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '1' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '1' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '2' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '2' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '3' 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, 0 in_qty4 , 0 out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '3' 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,0 out_qty3, sum(qty) in_qty4 , 0 out_qty4 from inout_table where class = '1' and crp_id = '10' and local_cd = '4' 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 , 0 out_qty3, 0 in_qty4 , sum(qty) out_qty4 from inout_table where class = '2' and crp_id = '10' and local_cd = '4' group by cust_cd, item) a group by a.cust_cd, a.item) a, (select crp_id, cust_cd, item, max(price) price, max(prod_date) lastmov 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 or a.in_qty4 - a.out_qty4 <> 0) group by b.crp_id, b.cust_cd, b.item order by b.crp_id, b.cust_cd, b.item") lspace=" " apostrofe="'" 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) Else lOBSamsung = 0 lOTSamsung = 0 lOBSamsung2 = 0 lOTSamsung2 = 0 lOBSamsung2WH3 = 0 lOTSamsungWH3 = 0 lOTSamsungWH1 = 0 lOBSamsung3 = 0 lOTSamsung3 = 0 lOBSamsung2WH4 = 0 lOTSamsungWH4 = 0 lSamsungObsOB1 = 0 lSamsungObsOT1 = 0 lSamsungObsOB1WH3 = 0 lSamsungObsOT1WH3 = 0 lSamsungObsOB1WH4 = 0 lSamsungObsOT1WH4 = 0 lOthers1 = 0 lOthers2 = 0 lOthers11 = 0 lOthers12 = 0 lOthers13 = 0 lOthers14 = 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" lcode5="0330325 (V-BOARDS)" lcode10="BN69-05528A V-BOARD" lcode11="BN69-00391E V-BOARD" lcode12="BN69-06769A" lcode13="BN69-17053D" lcode14="BN69-17053J" lcode15="BN69-17053Q" lcode16="BN69-17053A" lcode17="BN69-17053E" lcode18="100033183" lcode19="100033185" lcode20="100033186" lcode21="100033201" lcode22="100033206" lcode23="100033211" lcode24="VBOARD 2 X 2 X 36" lcode25="BN69-17053S" lcode1qty=0 lcode1amt=0 lcode2qty=0 lcode2amt=0 lcode3qty=0 lcode3amt=0 lcode4qty=0 lcode4amt=0 lcode5qty=0 lcode5amt=0 lcode10qty=0 lcode10amt=0 lcode11qty=0 lcode11amt=0 lcode12qty=0 lcode12amt=0 lcode13qty=0 lcode13amt=0 lcode14qty=0 lcode14amt=0 lcode15qty=0 lcode15amt=0 lcode16qty=0 lcode16amt=0 lcode17qty=0 lcode17amt=0 lcode18qty=0 lcode18amt=0 lcode19qty=0 lcode19amt=0 lcode20qty=0 lcode20amt=0 lcode21qty=0 lcode21amt=0 lcode22qty=0 lcode22amt=0 lcode23qty=0 lcode23amt=0 lcode24qty=0 lcode24amt=0 lcode25qty=0 lcode25amt=0 totalvbqty3=0 totalvbqty4=0 totalvbamt3=0 totalvbamt4=0 %> <% Rsinven1.MoveFirst Do While Not Rsinven1.EOF if Rsinven1("cust_cd")>"" then %> <% 'response.write (lqtybook&",") 'response.write (Rsinven1("po_qty")&",") lqtyinven = lqtyinven + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lamtinven = lamtinven + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lSubqty = cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lSubAmt = cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lspace=" " 'apostrofe="'" if InStr(Rsinven1("item"),"'") then set Rsinven3=dbsql.execute("select sht_size1,sht_size2,poksu,julsu,hapsu from stb040t where cust_cd='" & Rsinven1("cust_cd") & "' and replace(good_nm,char(39),'" & lspace & "')='" & replace(Rsinven1("item"),apostrofe,lspace) & "'") else set Rsinven3=dbsql.execute("select sht_size1,sht_size2,poksu,julsu,hapsu from stb040t where cust_cd='" & Rsinven1("cust_cd") & "' and good_nm='" & Rsinven1("item") & "'") end if if not rsinven3.eof then if isnumeric(Rsinven3("sht_size1")) and isnumeric(Rsinven3("sht_size2")) and isnumeric(Rsinven3("poksu")) and isnumeric(Rsinven3("julsu")) and isnumeric(Rsinven3("hapsu")) then localm2=((cdbl(Rsinven3("sht_size1")) * cdbl(Rsinven3("sht_size2")) / 1000000) / cdbl(Rsinven3("poksu")) / cdbl(Rsinven3("julsu")) * cdbl(Rsinven3("hapsu")) * lSubqty) else localm2=0 end if end if lm2inven = lm2inven + cdbl(localm2) lboxtype="Not Samsung" lboxx=0 if Rsinven1("cust_cd")="20001" then 'CTE 'if Rsinven1("prodclass")="03" then if Rsinven1("machine1")="301" or Rsinven1("machine1")="302" or Rsinven1("machine1")="306" then '301 lcode35qty = lcode35qty + cdbl(Rsinven1("inv_qty1"))+ cdbl(Rsinven1("inv_qty2"))+ cdbl(Rsinven1("inv_qty3")) lcode35amt = lcode35amt + cdbl(Rsinven1("inv_amt1"))+ cdbl(Rsinven1("inv_amt2"))+ cdbl(Rsinven1("inv_amt3")) lcode35qty4 = lcode35qty4 + cdbl(Rsinven1("inv_qty4")) lcode35amt4 = lcode35amt4 + cdbl(Rsinven1("inv_amt4")) lcode35qty1 = lcode35qty1 + cdbl(Rsinven1("inv_qty1")) lcode35amt1 = lcode35amt1 + cdbl(Rsinven1("inv_amt1")) lcode35qty2 = lcode35qty2 + cdbl(Rsinven1("inv_qty2")) lcode35amt2 = lcode35amt2 + cdbl(Rsinven1("inv_amt2")) lcode35qty3 = lcode35qty3 + cdbl(Rsinven1("inv_qty3")) lcode35amt3 = lcode35amt3 + cdbl(Rsinven1("inv_amt3")) lboxtype="V-Board" lboxx=1 ' end if else '301 ltypeBox="x" ltypeBox2="x" set Rsinven2=cnn.execute("select * from SamsungItems where good_nm='" & Rsinven1("item") & "'") if not Rsinven2.eof then 'RS ltypeBox=rsinven2("Note_4") ltypeBox2=rsinven2("Note_5") if rsinven2("Note_5")= "INBOX / PAD" then 'PAD lOTSamsung2 = lOTSamsung2 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lTotalQtyInvD = lTotalQtyInvD + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lOTSamsungWH3 = lOTSamsungWH3 + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH4 = lOTSamsungWH4 + cdbl(Rsinven1("inv_qty4")) lOTSamsungWH1 = lOTSamsungWH1 + cdbl(Rsinven1("inv_qty1")) lOTSamsungWH2 = lOTSamsungWH2 + cdbl(Rsinven1("inv_qty2")) lTotalAmtInvOT =lTotalAmtInvOT + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lTotalM2InvD = lTotalM2InvD + localm2 lTotalDllInvD =lTotalDllInvD + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) if lboxx=0 then lboxtype="INBOX / PAD" end if else if rsinven2("Note_5")= "NA" then 'NA if rsinven2("Note_4")= "Full Litho" or rsinven2("Note_4")= "Spot Label" or rsinven2("Note_4")= "No Label" OR rsinven2("Note_4")= "FULL LITHO" or rsinven2("Note_4")= "PRINTING" or rsinven2("Note_4")= "SPOT" then 'lOBSamsung = lOBSamsung + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lSamsungObsOB1 = lSamsungObsOB1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lSamsungObsOB1WH3 = lSamsungObsOB1WH3 + cdbl(Rsinven1("inv_qty3")) lSamsungObsOB1WH4 = lSamsungObsOB1WH4 + cdbl(Rsinven1("inv_qty4")) lSamsungObsOB1WH1 = lSamsungObsOB1WH1 + cdbl(Rsinven1("inv_qty1")) lSamsungObsOB1WH2 = lSamsungObsOB1WH2 + cdbl(Rsinven1("inv_qty2")) 'lTotalM2Inv1 = lTotalM2Inv1 + localm2 lTotalDllInvobs =lTotalDllInvobs + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) if lboxx=0 then lboxtype="OB/Obsolete" end if else 'lOTSamsung = lOTSamsung + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lSamsungObsOT1 = lSamsungObsOT1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) IF lboxx=0 then lSamsungObsOT1WH3 = lSamsungObsOT1WH3 + cdbl(Rsinven1("inv_qty3")) lSamsungObsOT1WH2 = lSamsungObsOT1WH2 + cdbl(Rsinven1("inv_qty2")) lSamsungObsOT1WH4 = lSamsungObsOT1WH4 + cdbl(Rsinven1("inv_qty4")) lSamsungObsOT1WH1 = lSamsungObsOT1WH1 + cdbl(Rsinven1("inv_qty1")) lboxtype="OT/Obsolete" lTotalDllInvobs =lTotalDllInvobs + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) end if 'lTotalM2Inv1 = lTotalM2Inv1 + localm2 'lTotalDllInv1 =lTotalDllInv1 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) end if else 'NA ' response.write("cod "&Rsinven1("item")) lOBSamsung2 = lOBSamsung2 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lOBSamsung2WH3 = lOBSamsung2WH3 + cdbl(Rsinven1("inv_qty3")) lOBSamsung2WH4 = lOBSamsung2WH4 + cdbl(Rsinven1("inv_qty4")) lOBSamsung2WH1 = lOBSamsung2WH1 + cdbl(Rsinven1("inv_qty1")) lOBSamsung2WH2 = lOBSamsung2WH2 + cdbl(Rsinven1("inv_qty2")) lTotalQtyInvD = lTotalQtyInvD + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lTotalM2InvD = lTotalM2InvD + localm2 lTotalDllInvD =lTotalDllInvD + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lTotalAmtInvOB =lTotalAmtInvOB + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lboxtype=rsinven2("Note_5") end if 'NA end if 'PAD else 'RS lOTSamsung = lOTSamsung + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) + cdbl(Rsinven1("inv_qty4")) lOTSamsungWH3 = lOTSamsungWH3 + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH4 = lOTSamsungWH4 + cdbl(Rsinven1("inv_qty4")) lOTSamsungWH1 = lOTSamsungWH1 + cdbl(Rsinven1("inv_qty1")) lOTSamsungWH2 = lOTSamsungWH2 + cdbl(Rsinven1("inv_qty2")) lTotalAmtInvOT =lTotalAmtInvOT + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) lboxtype="Other" end if 'RS Rsinven2.Close Set Rsinven2 = Nothing end if lTotalQtyInv1 = lTotalQtyInv1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) + cdbl(Rsinven1("inv_qty4")) lTotalM2Inv1 = lTotalM2Inv1 + localm2 lTotalDllInv1 =lTotalDllInv1 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) else lspace=" " if instr(Rsinven1("item"),"'") then set Rsother=cnn.execute("select * from Items where good_nm='" & replace(Rsinven1("item"),apostrofe,lspace) & "'") else set Rsother=cnn.execute("select * from Items where good_nm='" & Rsinven1("item") & "'") end if if not Rsother.eof then 'RS ltypeBox=rsother("Note_4") ltypeBox2=rsother("Note_5") if rsother("Note_5")= "NA" then 'NA lOtherObs1 = lOtherObs1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3") )+ cdbl(Rsinven1("inv_qty4")) lOther1Obs1 = lOther1Obs1 + cdbl(Rsinven1("inv_qty1")) lOther2Obs1 = lOther2Obs1 + cdbl(Rsinven1("inv_qty2")) lOther3Obs1 = lOther3Obs1 + cdbl(Rsinven1("inv_qty3")) lOther4Obs1 = lOther4Obs1 + cdbl(Rsinven1("inv_qty4")) lOtherObsM2 = lOtherObsM2 + localm2 lOtherObsDll =lOtherObsDll + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) end if ELSE end if lOthers1 = lOthers1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lOthers11 = lOthers11 + cdbl(Rsinven1("inv_qty1")) lOthers12 = lOthers12 + cdbl(Rsinven1("inv_qty2")) lOthers13 = lOthers13 + cdbl(Rsinven1("inv_qty3")) lOthers14 = lOthers14 + cdbl(Rsinven1("inv_qty4")) lOtherInvDll =lOtherInvDll + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) 'lOthers2 = 0 lTotalQtyInv2 = lTotalQtyInv2 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) lTotalM2Inv2 = lTotalM2Inv2 + localm2 lTotalDllInv2 =lTotalDllInv2 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) end if 'if Rsinven1("item")=lcode1 or Rsinven1("item")=lcode2 or Rsinven1("item")=lcode3 or Rsinven1("item")=lcode4 or Rsinven1("item")=lcode5 or Rsinven1("item")=lcode10 or Rsinven1("item")=lcode11 or Rsinven1("item")=lcode12 or Rsinven1("item")=lcode13 or Rsinven1("item")=lcode14 or Rsinven1("item")=lcode15 or Rsinven1("item")=lcode16 or Rsinven1("item")=lcode17 or Rsinven1("item")=lcode18 or Rsinven1("item")=lcode19 or Rsinven1("item")=lcode20 or Rsinven1("item")=lcode21 or Rsinven1("item")=lcode22 or Rsinven1("item")=lcode23 or Rsinven1("item")=lcode24 or Rsinven1("item")=lcode25 then 'if Rsinven1("prodclass")="03" then if Rsinven1("machine1")="301" or Rsinven1("machine1")="302" or Rsinven1("machine1")="306" then totalvbqty=totalvbqty + cdbl(Rsinven1("inv_qty1"))+ cdbl(Rsinven1("inv_qty2"))+ cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) totalvbamt=totalvbamt + cdbl(Rsinven1("inv_amt1"))+ cdbl(Rsinven1("inv_amt2"))+ cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) if Rsinven1("cust_cd")<>"20001" then totalvbqty1=totalvbqty1 + cdbl(Rsinven1("inv_qty1")) totalvbqty2=totalvbqty2+ cdbl(Rsinven1("inv_qty2")) totalvbamt1=totalvbamt1 + cdbl(Rsinven1("inv_amt1")) totalvbamt2=totalvbamt2 + cdbl(Rsinven1("inv_amt2")) totalvbqty3=totalvbqty3 + cdbl(Rsinven1("inv_qty3")) totalvbqty4=totalvbqty4 + cdbl(Rsinven1("inv_qty4")) totalvbamt3=totalvbamt3 + cdbl(Rsinven1("inv_amt3")) totalvbamt4=totalvbamt4 + cdbl(Rsinven1("inv_amt4")) end if lboxtype="V-Board" end if %> <% ltotwh1 = ltotwh1 + cdbl(Rsinven1("inv_qty1")) ltotwh2 = ltotwh2 + cdbl(Rsinven1("inv_qty2")) ltotwh3 = ltotwh3 + cdbl(Rsinven1("inv_qty3")) ltotwh4 = ltotwh4 + cdbl(Rsinven1("inv_qty4")) ltotwha1 = ltotwha1 + cdbl(Rsinven1("inv_amt1")) ltotwha2 = ltotwha2 + cdbl(Rsinven1("inv_amt2")) ltotwha3 = ltotwha3 + cdbl(Rsinven1("inv_amt3")) ltotwha4 = ltotwha4 + cdbl(Rsinven1("inv_amt4")) end if Rsinven1.MoveNext Loop End If Rsinven1.Close Set Rsinven1 = Nothing %>
Cte Item Price WH1 Qty AMT1: WH2 Qty AMT2: WH3 Qty AMT3 WH4 Qty AMT4 Tot QTY Tot AMT Type
<%=Rsinven1("cust_cd") %> <%=Rsinven1("item") %> <%=formatnumber(Rsinven1("price"),4) %> <%=formatnumber(Rsinven1("inv_qty1"),0)%> <%=formatnumber(Rsinven1("inv_amt1"),4)%> <%=formatnumber(Rsinven1("inv_qty2"),0)%> <%=formatnumber(Rsinven1("inv_amt2"),4)%> <%=formatnumber(Rsinven1("inv_qty3"),0)%> <%=formatnumber(Rsinven1("inv_amt3"),4)%> <%=formatnumber(Rsinven1("inv_qty4"),0)%> <%=formatnumber(Rsinven1("inv_amt4"),4)%> <%=formatnumber((cdbl(Rsinven1("inv_qty1"))+cdbl(Rsinven1("inv_qty2"))+cdbl(Rsinven1("inv_qty3"))+cdbl(Rsinven1("inv_qty4"))),0)%> <%=formatnumber((cdbl(Rsinven1("inv_amt1"))+cdbl(Rsinven1("inv_amt2"))+cdbl(Rsinven1("inv_amt3"))+cdbl(Rsinven1("inv_amt4"))),2)%><%=lboxtype%> 
      <%=ltotwh1%> <%=ltotwha1%> <%=ltotwh2%> <%=ltotwha2%> <%=ltotwh3%> <%=ltotwha3%> <%=ltotwh4%> <%=ltotwha4%> <%=(ltotwh1+ltotwh2+ltotwh3+ltotwh4)%> <%=(ltotwha1+ltotwha2+ltotwha3+ltotwha4)%>  

V-Board Inventory
Customer Item 
<%'=Rsinven1("customer")%>  <%'=Rsinven1("item")%> <%'=cdbl(Rsinven1("inv_qty1"))+ cdbl(Rsinven1("inv_qty2"))+ cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4"))%> <%'=formatnumber(cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")),2)%>
TOTAL
Qty
Dlls
   
<%=formatnumber(totalvbqty,0)%>
<%=formatnumber(totalvbamt,2)%>
 
<% '**************end inventory '********************************************************** Inventory V-Board '***********************Planta 1 Vboard '********************** End VB planta 1 Dim Rsinvenvb2 set Rsinvenvb2=dbsql2.execute("select a.crp_id, a.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = a.cust_cd) cust_nm, a.good_cd, a.good_nm, max(a.inv_qty1) inv_qty1, max(a.inv_qty2) inv_qty2, max(a.inv_qty3) inv_qty3, max(a.inv_qty4) inv_qty4, max(a.inv_qty5) inv_qty5, max(a.inv_amt1) inv_amt1, max(a.inv_amt2) inv_amt2, max(a.inv_amt3) inv_amt3, max(a.inv_amt4) inv_amt4, max(a.inv_amt5) inv_amt5 from ( select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, sum(isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) inv_qty1, 0 inv_qty2, 0 inv_qty3, 0 inv_qty4, 0 inv_qty5, sum(round((isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) * b.good_price,3)) inv_amt1, 0 inv_amt2, 0 inv_amt3, 0 inv_amt4, 0 inv_amt5 from sal011t a(nolock), 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.local_cd = '1' and a.cust_cd ='20001' and a.real_jego_qty - a.mov_qty - a.sales_qty > 0 group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm union all select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, 0, sum(isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)), 0 , 0 , 0, 0 inv_amt2, sum(round((isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) * b.good_price,3)) inv_amt1, 0 inv_amt3, 0 inv_amt4, 0 inv_amt5 from sal011t a(nolock), ooa010t 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.local_cd in('A','B') and a.cust_cd ='20001' and a.real_jego_qty - a.mov_qty - a.sales_qty > 0 group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm union all select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, 0, 0, sum(isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) inv_qty1, 0 inv_qty4, 0 inv_qty5, 0 inv_amt2, 0 inv_amt3, sum(round((isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) * b.good_price,3)) inv_amt1, 0 inv_amt4, 0 inv_amt5 from sal011t a(nolock), 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.local_cd <> '1' and a.cust_cd ='20001' and a.real_jego_qty - a.mov_qty - a.sales_qty > 0 group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm union all select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, 0, 0, 0, sum(isnull(a.mov_qty,0)), 0, 0 inv_amt2, 0 inv_amt3, 0 inv_amt4, sum(round(isnull(a.mov_qty,0) * b.good_price,3)) inv_amt1, 0 inv_amt5 from sal011t a(nolock), 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.cust_cd ='20001' and a.mov_qty <> 0 and a.real_jego_qty - a.sales_qty > 0 group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm union all select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, 0, 0, 0, 0, sum(isnull(a.mov_qty,0)), 0 inv_amt2, 0 inv_amt3, 0 inv_amt4, 0 inv_amt5, sum(round(isnull(a.mov_qty,0) * b.good_price,3)) inv_amt1 from sal011t a(nolock), ooa010t 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.cust_cd ='20001' and a.mov_qty <> 0 and a.real_jego_qty - a.sales_qty > 0 group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm ) a group by a.crp_id, a.cust_cd, a.good_cd, a.good_nm order by a.crp_id, a.cust_cd, a.good_cd") txx=0 if txx=1 then larchivo="\\server2\reporte\InvTotSamsungVB.xlsx" Path=larchivo Set ConexionBD = Server.CreateObject("ADODB.Connection") ConexionBD.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & path & ";Extended Properties='Excel 12.0 Xml;HDR=no;IMEX=1';" Set rsVac = Server.CreateObject("ADODB.Recordset") rsVac.Open "Select * From [InvTotSamsungVB$]", ConexionBD,3 ,3 if rsVac.eof or rsVac.bof then ExisteUsuario = False Msg = "No inventory exist for this date." Style = vbDefaultButton2 Title = "Msg from System" Help = "" ctxt = 1000 'Response = MsgBox(Msg, Style, Title, Help, ctxt) Else lqtyvb=0 lamtvb=0 ltotqtyvb=0 ltotamtvb=0 lcode1="BN69-12806A" lcode2="BN69-12807A" lcode3="BN69-00391U" lcode4="BN69-00391Y" lcode5="0330325 (V BOARDS)" lcode6="V Boards 2x2x96" lcode7="31"& Chr(34) &" Kraft V-Board" lcode8="45"& Chr(34) &" Kraft V-Board" lcode9="8 Feets V-Board" lcode10="BN69-05528A V-BOARD" lcode11="BN69-00391E V-BOARD" lcode12="BN69-06769A" lcode13="BN69-12807A" rsVac.MoveFirst Do While Not RsVac.EOF if rsVac(3) =lcode1 then lcode1qty = cdbl(rsVac(14)) lcode1amt = cdbl(rsVac(15)) end if if rsVac(3) =lcode2 then lcode2qty = cdbl(rsVac(14)) lcode2amt = cdbl(rsVac(15)) end if if rsVac(3)=lcode3 then lcode3qty = cdbl(rsVac(14)) lcode3amt = cdbl(rsVac(15)) end if if rsVac(3)=lcode4 then lcode4qty = cdbl(rsVac(14)) lcode4amt = cdbl(rsVac(15)) end if RsVac.MoveNext Loop End If RsVac.Close Set RsVac = Nothing else if Rsinvenvb2.eof or Rsinvenvb2.bof then ExisteUsuario = False Msg = "No inventory exist for this date." Style = vbDefaultButton2 Title = "Msg from System" Help = "" ctxt = 1000 'Response = MsgBox(Msg, Style, Title, Help, ctxt) Else lqtyvb=0 lamtvb=0 ltotqtyvb=0 ltotamtvb=0 lcode1="BN69-12806A" lcode2="BN69-12807A" lcode3="BN69-00391U" lcode4="BN69-00391Y" lcode5="0330325 (V BOARDS)" lcode6="V Boards 2x2x96" lcode7="31"& Chr(34) &" Kraft V-Board" lcode8="45"& Chr(34) &" Kraft V-Board" lcode9="8 Feets V-Board" lcode10="BN69-05528A V-BOARD" lcode11="BN69-00391E V-BOARD" lcode12="BN69-06769A" lcode13="BN69-12807A" Rsinvenvb2.MoveFirst Do While Not Rsinvenvb2.EOF if Rsinvenvb2("good_nm") =lcode1 then lcode1qty = lcode1qty + cdbl(Rsinvenvb2("inv_qty1"))+ cdbl(Rsinvenvb2("inv_qty2"))+ cdbl(Rsinvenvb2("inv_qty3"))+ cdbl(Rsinvenvb2("inv_qty4"))+ cdbl(Rsinvenvb2("inv_qty5")) lcode1amt = lcode1amt + cdbl(Rsinvenvb2("inv_amt1"))+ cdbl(Rsinvenvb2("inv_amt2"))+ cdbl(Rsinvenvb2("inv_amt3"))+ cdbl(Rsinvenvb2("inv_amt4"))+ cdbl(Rsinvenvb2("inv_amt5")) end if if Rsinvenvb2("good_nm") =lcode2 then lcode2qty = lcode2qty + cdbl(Rsinvenvb2("inv_qty1"))+ cdbl(Rsinvenvb2("inv_qty2"))+ cdbl(Rsinvenvb2("inv_qty3"))+ cdbl(Rsinvenvb2("inv_qty4"))+ cdbl(Rsinvenvb2("inv_qty5")) lcode2amt = lcode2amt + cdbl(Rsinvenvb2("inv_amt1"))+ cdbl(Rsinvenvb2("inv_amt2"))+ cdbl(Rsinvenvb2("inv_amt3"))+ cdbl(Rsinvenvb2("inv_amt4"))+ cdbl(Rsinvenvb2("inv_amt5")) end if if Rsinvenvb2("good_nm")=lcode3 then lcode3qty = lcode3qty + cdbl(Rsinvenvb2("inv_qty1"))+ cdbl(Rsinvenvb2("inv_qty2"))+ cdbl(Rsinvenvb2("inv_qty3"))+ cdbl(Rsinvenvb2("inv_qty4"))+ cdbl(Rsinvenvb2("inv_qty5")) lcode3amt = lcode3amt + cdbl(Rsinvenvb2("inv_amt1"))+ cdbl(Rsinvenvb2("inv_amt2"))+ cdbl(Rsinvenvb2("inv_amt3"))+ cdbl(Rsinvenvb2("inv_amt4"))+ cdbl(Rsinvenvb2("inv_amt5")) end if if Rsinvenvb2("good_nm")=lcode4 then lcode4qty = lcode4qty + cdbl(Rsinvenvb2("inv_qty1"))+ cdbl(Rsinvenvb2("inv_qty2"))+ cdbl(Rsinvenvb2("inv_qty3"))+ cdbl(Rsinvenvb2("inv_qty4"))+ cdbl(Rsinvenvb2("inv_qty5")) lcode4amt = lcode4amt + cdbl(Rsinvenvb2("inv_amt1"))+ cdbl(Rsinvenvb2("inv_amt2"))+ cdbl(Rsinvenvb2("inv_amt3"))+ cdbl(Rsinvenvb2("inv_amt4"))+ cdbl(Rsinvenvb2("inv_amt5")) end if Rsinvenvb2.MoveNext Loop End If Rsinvenvb2.Close Set Rsinvenvb2 = Nothing end if '**************end inventory V-Board set Rswip=cnn.execute("select * from wip") lsheetwip=rswip("SHEETWIP") lboxwip=rswip("boxwip") lboxrwr=rswip("boxrwr") lboxrwked=rswip("boxrwked") rswip.close set rswip = nothing cnn.close set cnn = nothing dbsql.Close Set dbsql = Nothing dbsql2.Close Set dbsql2 = Nothing 'db.close ''lsamsungvbqty=(lcode1qty+lcode2qty+lcode3qty+lcode4qty+lcode10qty+lcode11qty+lcode12qty+lcode13qty+lcode14qty+lcode15qty+lcode16qty+lcode17qty+lcode25qty) ''lsamsungvbamt=(lcode1amt+lcode2amt+lcode3amt+lcode4amt+lcode10amt+lcode11amt+lcode12amt+lcode13amt+lcode14amt+lcode15amt+lcode16amt+lcode17amt+lcode25amt) ''lsamsungvbqty4=(lcode1qty4+lcode2qty4+lcode3qty4+lcode4qty4+lcode10qty4+lcode11qty4+lcode12qty4+lcode13qty4+lcode14qty4+lcode15qty4+lcode16qty4+lcode17qty4+lcode25qty4) ''lsamsungvbamt4=(lcode1amt4+lcode2amt4+lcode3amt4+lcode4amt4+lcode10amt4+lcode11amt4+lcode12amt4+lcode13amt4+lcode14amt4+lcode15amt4+lcode16amt4+lcode17amt4+lcode25amt4) ''lsamsungvbqty1=(lcode1qty1+lcode2qty1+lcode3qty1+lcode4qty1+lcode10qty1+lcode11qty1+lcode12qty1+lcode13qty1+lcode14qty1+lcode15qty1+lcode16qty1+lcode17qty1+lcode25qty1) ''lsamsungvbamt1=(lcode1amt1+lcode2amt1+lcode3amt1+lcode4amt1+lcode10amt1+lcode11amt1+lcode12amt1+lcode13amt1+lcode14amt1+lcode15amt1+lcode16amt1+lcode17amt1+lcode25amt1) ''lsamsungvbqty2=(lcode1qty2+lcode2qty2+lcode3qty2+lcode4qty2+lcode10qty2+lcode11qty2+lcode12qty2+lcode13qty2+lcode14qty2+lcode15qty2+lcode16qty2+lcode17qty2+lcode25qty2) ''lsamsungvbamt2=(lcode1amt2+lcode2amt2+lcode3amt2+lcode4amt2+lcode10amt2+lcode11amt2+lcode12amt2+lcode13amt2+lcode14amt2+lcode15amt2+lcode16amt2+lcode17amt2+lcode25amt2) ' lcode35qty = lcode35qty + cdbl(Rsinven1("inv_qty1"))+ cdbl(Rsinven1("inv_qty2"))+ cdbl(Rsinven1("inv_qty3")) ' lcode35amt = lcode35amt + cdbl(Rsinven1("inv_amt1"))+ cdbl(Rsinven1("inv_amt2"))+ cdbl(Rsinven1("inv_amt3")) ' lcode35qty4 = lcode35qty4 + cdbl(Rsinven1("inv_qty4")) ' lcode35amt4 = lcode35amt4 + cdbl(Rsinven1("inv_amt4")) ' lcode35qty1 = lcode35qty1 + cdbl(Rsinven1("inv_qty1")) ' lcode35amt1 = lcode35amt1 + cdbl(Rsinven1("inv_amt1")) ' lcode35qty2 = lcode35qty2 + cdbl(Rsinven1("inv_qty2")) ' lcode35amt2 = lcode35amt2 + cdbl(Rsinven1("inv_amt2")) ' lcode35qty3 = lcode35qty3 + cdbl(Rsinven1("inv_qty3")) ' lcode35amt3 = lcode35amt3 + cdbl(Rsinven1("inv_amt3")) lsamsungvbqty=lcode35qty lsamsungvbamt=lcode35amt lsamsungvbqty4=lcode35qty4 lsamsungvbamt4=lcode35amt4 lsamsungvbqty1=lcode35qty1 lsamsungvbamt1=lcode35amt1 lsamsungvbqty2=lcode35qty2 lsamsungvbamt2=lcode35amt2 lsamsungvbqty3=lcode35qty3 lsamsungvbamt3=lcode35amt3 ' totalvbqty=totalvbqty + cdbl(Rsinven1("inv_qty1"))+ cdbl(Rsinven1("inv_qty2"))+ cdbl(Rsinven1("inv_qty3"))+ cdbl(Rsinven1("inv_qty4")) ' totalvbamt=totalvbamt + cdbl(Rsinven1("inv_amt1"))+ cdbl(Rsinven1("inv_amt2"))+ cdbl(Rsinven1("inv_amt3"))+ cdbl(Rsinven1("inv_amt4")) ' if Rsinven1("cust_cd")<>"20001" then ' totalvbqty1=totalvbqty1 + cdbl(Rsinven1("inv_qty1")) ' totalvbqty2=totalvbqty2+ cdbl(Rsinven1("inv_qty2")) ' totalvbamt1=totalvbamt1 + cdbl(Rsinven1("inv_amt1")) ' totalvbamt2=totalvbamt2 + cdbl(Rsinven1("inv_amt2")) ' totalvbqty3=totalvbqty3 + cdbl(Rsinven1("inv_qty3")) ' totalvbqty4=totalvbqty4 + cdbl(Rsinven1("inv_qty4")) ' totalvbamt3=totalvbamt3 + cdbl(Rsinven1("inv_amt3")) ' totalvbamt4=totalvbamt4 + cdbl(Rsinven1("inv_amt4")) lvbinv=0 if lvbinv=1 then %> <% end if %> ACTUAL INVENTORY
Generated: <%=time%>   OB WH3 Nordika WH4 OB Transfer
OB Total
Others WH3 Nordika WH4 Others Transfer WH2
Others Total
TOTAL
Qty
M2
Dlls
Samsung
Obsolete
<%=(lSamsungObsOB1WH3)%> <%=(lSamsungObsOB1WH4)%> <%=(lSamsungObsOB1WH1)%>
<%=(lSamsungObsOB1)%>
<%=(lSamsungObsOT1WH3)%> <%=(lSamsungObsOT1WH4)%> <%=(lSamsungObsOT1WH1)%>  
<%=(lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2)%>
<%=formatnumber(lSamsungObsOB1+lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2,0)%>
<%=formatnumber(lTotalM2Inv1-lTotalM2InvD,0)%>
$<%=formatnumber(lTotalDllInvobs)%>
 
Actual
<%=lOBSamsung2WH3%> <%=lOBSamsung2WH4%> <%=lOBSamsung2WH1%>
<%=lOBSamsung2%>
<%=lOTSamsungWH3%> <%=lOTSamsungWH4%> <%=lOTSamsungWH1%>  
<%=lOTSamsung2+lOTSamsung%>
<%=formatnumber(lTotalQtyInvD+lOTSamsung,0)%>
<%=formatnumber(lTotalM2InvD,0)%>
$<%=formatnumber(lTotalDllInvD-lsamsungvbamt-lsamsungvbamt4)%>
  VB Actual         <%=(lSamsungvbqty3)%> <%=lSamsungvbqty4%> <%=lSamsungvbqty1%> <%=lSamsungvbqty2%> <%=(lSamsungvbqty)%> <%=formatnumber(lSamsungvbqty,0)%>   $<%=formatnumber(lsamsungvbamt)%>
  Total Samsung      
<%=(lSamsungObsOB1+lOBSamsung2)%>
       
<%=(lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2+lOTSamsung2+lOTSamsung+lSamsungvbqty)%>
<%=formatnumber((lSamsungObsOB1+lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2+lTotalQtyInvD+lOTSamsung+lSamsungvbqty),0)%>
<%=formatnumber(lTotalM2Inv1,0)%>
$<%=formatnumber(lTotalDllInvobs+(lTotalAmtInvOB+lTotalAmtInvOT)+(lsamsungvbamt))%>
Others
Obsolete
     
0
<%=(lOther3Obs1)%>
<%=(lOther4Obs1)%>
<%=(lOther1Obs1)%>
<%=(lOther2Obs1)%>
<%=(lOtherObs1)%>
<%=(lOtherObs1)%>
<%=formatnumber(lOtherObsM2,0)%>
$<%=formatnumber(lOtherObsDll)%>
 
Actual
     
0
<%=(lOthers13-lOther3Obs1-totalvbqty3)%>
<%=(lOthers14-lOther4Obs1-totalvbqty4)%>
<%=(lOthers11-lOther1Obs1-totalvbqty1)%>
<%=(lOthers12-lOther2Obs1-totalvbqty2)%>
<%=(lOthers1-lOtherObs1-(totalvbqty3+totalvbqty4+totalvbqty1+totalvbqty2))%>
<%=formatnumber(lOthers1-lOtherObs1-(totalvbqty3+totalvbqty4+totalvbqty1+totalvbqty2),0)%>
<%=formatnumber(lTotalM2Inv2-lOtherObsM2,0)%>
$<%=formatnumber(lOtherInvDll-lOtherObsDll-(totalvbamt3+totalvbamt4+totalvbamt1+totalvbamt2))%>
  VB         <%=totalvbqty3 %> <%=totalvbqty4 %> <%=totalvbqty1 %> <%=totalvbqty2 %> <%=totalvbqty3+totalvbqty4+totalvbqty1+totalvbqty2 %> <%=totalvbqty3+totalvbqty4+totalvbqty1+totalvbqty2 %>  
$<%=formatnumber(totalvbamt3+totalvbamt4+totalvbamt1+totalvbamt2)%>
 
Total Others
     
0
<%=lOthers13%>
<%=lOthers14%>
<%=lOthers11%>
<%=lOthers12%>
<%=lOthers1%>
<%=formatnumber(lOthers1,0)%>
<%=formatnumber(lTotalM2Inv2,0)%>
$<%=formatnumber(lTotalDllInv2)%>
Total        
<%=(lSamsungObsOB1+lOBSamsung2)%>
       
<%=((lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2+lOTSamsung2+lOTSamsung+lSamsungvbqty)+lOthers1)%>
<%=formatnumber((lSamsungObsOB1+lSamsungObsOT1WH3+lSamsungObsOT1WH4+lSamsungObsOT1WH1+lSamsungObsOT1WH2+lTotalQtyInvD+lOTSamsung+lSamsungvbqty)+lOthers1,0)%>
<%=formatnumber(lTotalM2Inv1+lTotalM2Inv2,0)%>
$<%=formatnumber((lTotalDllInvobs+(lTotalAmtInvOB+lTotalAmtInvOT)+(lsamsungvbamt))+lTotalDllInv2)%>

 

R W R <% if lboxrwr=0 then%> <%else%> <%end if%> <% if lboxrwr=0 then%> <%else%> <%end if%>
 
TOTAL
Qty
 
BOX
No Data
<%=formatnumber(lboxrwr,0)%>
 
 
0
<%=formatnumber(lboxrwr,0)%>