%@ 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 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 %>
| 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)%> | <% '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 %><%=lboxtype%> |
| <%=ltotwh1%> | <%=ltotwha1%> | <%=ltotwh2%> | <%=ltotwha2%> | <%=ltotwh3%> | <%=ltotwha3%> | <%=ltotwh4%> | <%=ltotwha4%> | <%=(ltotwh1+ltotwh2+ltotwh3+ltotwh4)%> | <%=(ltotwha1+ltotwha2+ltotwha3+ltotwha4)%> |
| 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)%> |
| 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
TOTAL |
|||
|---|---|---|---|
Qty |
|||
| BOX | <% if lboxrwr=0 then%>No Data |
<%else%>
<%=formatnumber(lboxrwr,0)%> |
<%end if%>
|
| <% if lboxrwr=0 then%> | 0 |
<%else%>
<%=formatnumber(lboxrwr,0)%> |
<%end if%>
|