%@ LANGUAGE = "VBScript" %> <% 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) '''''''''''''''''''''''''''''''''''''' 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") %>
Actual Month |
Period: |
<%=period1%> | <%=period2%> | ||||||||
<%=lbl_month%> |
Last Year |
||||||||||
| Total Sales Qty: | Total Sales Amt: | Total M2: | By Piece: | By M2: | Sales Qty: | Sales Amt: | M2: | By Piece: | By M2: | ||
| Bookings | <%=formatnumber(qtybook)%> |
$<%=formatnumber(amtbook)%> |
<%=formatnumber(m2book)%> |
$<%=formatnumber(CtoPiece_book,3)%> |
$<%=formatnumber(CtoM2_book,3)%> |
<%=formatnumber(qtybook2)%> |
$<%=formatnumber(amtbook2)%> |
<%=formatnumber(m2book2)%> |
$<%=formatnumber(CtoPiece_last1)%> |
$<%=formatnumber(CtoM2_last1)%> |
|
| Plant 1 | <%=formatnumber(Tot_sales_qty)%> |
$<%=formatnumber(Tot_sales_amt)%> |
<%=formatnumber(Tot_sales_m2)%> |
$<%=formatnumber(CtoPiece,3)%> |
$<%=formatnumber(CtoM2,3)%> |
<%=formatnumber(qtyplant1)%> |
$<%=formatnumber(amtplant1)%> |
<%=formatnumber(m2plant1)%> |
$<%=formatnumber(CtoPiece_last2)%> |
$<%=formatnumber(CtoM2_last2)%> |
|
| Plant 2 | <%=formatnumber(Tot_sales_qty2-lqtyvboard)%> |
$<%=formatnumber(Tot_sales_amt2-lamtvboard)%> |
<%=formatnumber(Tot_sales_m2_2)%> |
$<%=formatnumber(CtoPiece2,3)%> |
$<%=formatnumber(CtoM2_2,3)%> |
<%=formatnumber(qtyplant2)%> |
$<%=formatnumber(amtplant2)%> |
<%=formatnumber(m2plant2)%> |
$<%=formatnumber(CtoPiece_last3)%> |
$<%=formatnumber(CtoM2_last3)%> |
|
| Samsung | <%=formatnumber(Tot_sales_qty_sam)%> |
$<%=formatnumber(Tot_sales_amt_sam)%> |
<%=formatnumber(Tot_sales_m2_sam)%> |
$<%=formatnumber(CtoPiece_sam,3)%> |
$<%=formatnumber(CtoM2_sam,3)%> |
<%=formatnumber(qtysamsung)%> |
$<%=formatnumber(amtsamsung)%> |
<%=formatnumber(m2samsung)%> |
$<%=formatnumber(CtoPiece_last4)%> |
$<%=formatnumber(CtoM2_last4)%> |
|
| V-Board | <%=formatnumber(lqtyvboard)%> |
$<%=formatnumber(lamtvboard)%> |
$<%=formatnumber(lamtvboard/lqtyvboard,3)%> |
$ |
$ |
$ |
$ |
||||
| Inter Company | <%=formatnumber(qtyinterc)%> |
$<%=formatnumber(amtinterc)%> |
<%=formatnumber(m2interc)%> |
$<%=formatnumber(CtoPiece_inter,3)%> |
$<%=formatnumber(CtoM2_inter,3)%> |
<%=formatnumber(qtyinterc2)%> |
$<%=formatnumber(amtinterc2)%> |
<%=formatnumber(m2interc2)%> |
$<%=formatnumber(CtoPiece_last5)%> |
$<%=formatnumber(CtoM2_last5)%> |
|
| Total: | <%=formatnumber(Tot_sales_qtyAll)%> |
$<%=formatnumber(Tot_sales_amtAll)%> |
<%=formatnumber(Tot_sales_m2All)%> |
$<%=formatnumber(TotPiece1,3)%> |
$<%=formatnumber(Totm2_1,3)%> |
<%=formatnumber(Totqtylast)%> |
$<%=formatnumber(Totamtlast)%> |
<%=formatnumber(Totm2last)%> |
$<%=formatnumber(Totpiece2)%> |
$<%=formatnumber(Totm2_2)%> |
|
| Current Sales: | Invoiced Sales: | Daly AVG: | Projection: | |
| Plant 1 | $<%=formatnumber(Tot_sales_amt)%> |
$<%=formatnumber(lamtplantInv)%> |
$<%=formatnumber(DailyAvg1)%> |
$<%=formatnumber(Projection1)%> |
| Plant 2 | $<%=formatnumber(Tot_sales_amt2)%> |
$<%=formatnumber(lamtplantInv2)%> |
$<%=formatnumber(DailyAvg2)%> |
$<%=formatnumber(Projection2)%> |
| Samsung | $<%=formatnumber(Tot_sales_amt_sam)%> |
$<%=formatnumber(Tot_sales_amt_sam)%> |
$<%=formatnumber(DailyAvg3)%> |
$<%=formatnumber(Projection3)%> |
| Total | $<%=formatnumber(Tot_sales_amtAll)%> |
$<%=formatnumber(Tot_sales_amtAll2)%> |
$<%=formatnumber(Total_2)%> |
$<%=formatnumber(Total_3)%> |
| Forecast | Bussines Plan |
$<%=formatnumber(forecast)%> |
$<%=formatnumber(Bussines)%> |
<%=formatnumber(fulfillment1*100)%> % |
<%=formatnumber(fulfillment2*100)%> % |
<%=lbl_lastyear%> vs <%=lbl_actualyear%> |
|||||||||||||
| January | February | March | April | May | June | July | August | September | October | November | December | Total | |
<%=lbl_lastyear%> |
$<%=formatnumber(jan1)%> |
$<%=formatnumber(feb1)%> |
$<%=formatnumber(mar1)%> |
$<%=formatnumber(apr1)%> |
$<%=formatnumber(May1)%> |
$<%=formatnumber(jun1)%> |
$<%=formatnumber(jul1)%> |
$<%=formatnumber(aug1)%> |
$<%=formatnumber(sep1)%> |
$<%=formatnumber(oct1)%> |
$<%=formatnumber(nov1)%> |
$<%=formatnumber(dec1)%> |
$<%=formatnumber(totyear1)%> |
<%=lbl_actualyear%> |
$<%=formatnumber(jan2)%> |
$<%=formatnumber(feb2)%> |
$<%=formatnumber(mar2)%> |
$<%=formatnumber(apr2)%> |
$<%=formatnumber(may2)%> |
$<%=formatnumber(jun2)%> |
$<%=formatnumber(jul2)%> |
$<%=formatnumber(aug2)%> |
$<%=formatnumber(sep2)%> |
$<%=formatnumber(oct2)%> |
$<%=formatnumber(nov2)%> |
$<%=formatnumber(dec2)%> |
$<%=formatnumber(totyear2)%> |
V_BOARD <%=lbl_lastyear%> vs <%=lbl_actualyear%> |
|||||||||||||
| January | February | March | April | May | June | July | August | September | October | November | December | Total | |
V-Board Samsung <%=lbl_lastyear%> |
$<%=formatnumber(VBS1)%> |
$<%=formatnumber(VBS2)%> |
$<%=formatnumber(VBS3)%> |
$<%=formatnumber(VBS4)%> |
$<%=formatnumber(VBS5)%> |
$<%=formatnumber(VBS6)%> |
$<%=formatnumber(VBS7)%> |
$<%=formatnumber(VBS8)%> |
$<%=formatnumber(VBS9)%> |
$<%=formatnumber(VBS10)%> |
$<%=formatnumber(VBS11)%> |
$<%=formatnumber(VBS12)%> |
<%
VBStotyear1=(VBS1+VBS2+VBS3+VBS4+VBS5+VBS6+VBS7+VBS8+VBS9+VBS10+VBS11+VBS12) %>
$<%=formatnumber(VBStotyear1)%> |
V-Board Others <%=lbl_lastyear%> |
$<%=formatnumber(VBO1)%> |
$<%=formatnumber(VBO2)%> |
$<%=formatnumber(VBO3)%> |
$<%=formatnumber(VBo4)%> |
$<%=formatnumber(VBO5)%> |
$<%=formatnumber(VBO6)%> |
$<%=formatnumber(VBO7)%> |
$<%=formatnumber(VBO8)%> |
$<%=formatnumber(VBO9)%> |
$<%=formatnumber(VBO10)%> |
$<%=formatnumber(VBO11)%> |
$<%=formatnumber(VBO12)%> |
<%
VBOtotyear1=(VBo1+VBo2+VBo3+VBo4+VBo5+VBo6+VBo7+VBo8+VBo9+VBo10+VBo11+VBo12) %>
$<%=formatnumber(VBOtotyear1)%> |
| Total V-Board <%=lbl_lastyear%> | $<%=formatnumber(VBO1+VBS1)%> | $<%=formatnumber(VBO2+VBS2)%> | $<%=formatnumber(VBO3+VBS3)%> | $<%=formatnumber(VBO4+VBS4)%> | $<%=formatnumber(VBO5+VBS5)%> | $<%=formatnumber(VBO6+VBS6)%> | $<%=formatnumber(VBO7+VBS7)%> | $<%=formatnumber(VBO8+VBS8)%> | $<%=formatnumber(VBO9+VBS9)%> | $<%=formatnumber(VBO10+VBS10)%> | $<%=formatnumber(VBO11+VBS11)%> | $<%=formatnumber(VBO12+VBS12)%> | $<%=formatnumber(VBStotyear1+VBOtotyear1)%> |
V-Board Samsung <%=lbl_actualyear%> |
$<%=formatnumber(VBS2_1)%> |
$<%=formatnumber(VBS2_2)%> |
$<%=formatnumber(VBS2_3)%> |
$<%=formatnumber(VBS2_4)%> |
$<%=formatnumber(VBS2_5)%> |
$<%=formatnumber(VBS2_6)%> |
$<%=formatnumber(VBS2_7)%> |
$<%=formatnumber(VBS2_8)%> |
$<%=formatnumber(VBS2_9)%> |
$<%=formatnumber(VBS2_10)%> |
$<%=formatnumber(VBS2_11)%> |
$<%=formatnumber(VBS2_12)%> |
<%
VBStotyear2=(VBS2_1+VBS2_2+VBS2_3+VBS2_4+VBS2_5+VBS2_6+VBS2_7+VBS2_8+VBS2_9+VBS2_10+VBS2_11+VBS2_12) %>
$<%=formatnumber(VBStotyear2)%> |
V-Board Others <%=lbl_actualyear%> |
$<%=formatnumber(VBO2_1)%> |
$<%=formatnumber(VBO2_2)%> |
$<%=formatnumber(VBO2_3)%> |
$<%=formatnumber(VBO2_4)%> |
$<%=formatnumber(VBO2_5)%> |
$<%=formatnumber(VBO2_6)%> |
$<%=formatnumber(VBO2_7)%> |
$<%=formatnumber(VBO2_8)%> |
$<%=formatnumber(VBO2_9)%> |
$<%=formatnumber(VBO2_10)%> |
$<%=formatnumber(VBO2_11)%> |
$<%=formatnumber(VBO2_12)%> |
<%
VBOtotyear2=(VBo2_1+VBo2_2+VBo2_3+VBo2_4+VBo2_5+VBo2_6+VBo2_7+VBo2_8+VBo2_9+VBo2_10+VBo2_11+VBo2_12) %>
$<%=formatnumber(VBOtotyear2)%> |
| Total V-Board <%=lbl_actualyear%> | $<%=formatnumber(VBO2_1+VBS2_1)%> | $<%=formatnumber(VBO2_2+VBS2_2)%> | $<%=formatnumber(VBO2_3+VBS2_3)%> | $<%=formatnumber(VBO2_4+VBS2_4)%> | $<%=formatnumber(VBO2_5+VBS2_5)%> | $<%=formatnumber(VBO2_6+VBS2_6)%> | $<%=formatnumber(VBO2_7+VBS2_7)%> | $<%=formatnumber(VBO2_8+VBS2_8)%> | $<%=formatnumber(VBO2_9+VBS2_9)%> | $<%=formatnumber(VBO2_10+VBS2_10)%> | $<%=formatnumber(VBO2_11+VBS2_11)%> | $<%=formatnumber(VBO2_12+VBS2_12)%> | $<%=formatnumber(VBStotyear2+VBOtotyear2)%> |
<% '********************************************************** 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, 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' 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' 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' 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' 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' 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' 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") 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 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 Rsinven1.MoveFirst Do While Not Rsinven1.EOF 'response.write (lqtybook&",") 'response.write (Rsinven1("po_qty")&",") 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")) lSubqty = cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lSubAmt = cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) set Rsinven3=dbsql.execute("select * from stb040t where cust_cd='" & Rsinven1("cust_cd") & "' and good_nm='" & Rsinven1("item") & "'") if not rsinven3.eof then localm2=((cdbl(Rsinven3("sht_size1")) * cdbl(Rsinven3("sht_size2")) / 1000000) / cdbl(Rsinven3("poksu")) / cdbl(Rsinven3("julsu")) * cdbl(Rsinven3("hapsu")) * lSubqty) end if lm2inven = lm2inven + cdbl(localm2) 'localm2=((cdbl(Rsinven1("sht_size1")) * cdbl(Rsinven1("sht_size2")) / 1000000) / cdbl(Rsinven1("poksu")) / cdbl(Rsinven1("julsu")) * cdbl(Rsinven1("hapsu")) * cdbl(Rsinven1("po_qty"))) 'lm2inven = lm2inven + localm2 if Rsinven1("cust_cd")="20001" then 'CTE 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")) lTotalQtyInvD = lTotalQtyInvD + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH3 = lOTSamsungWH3 + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH1 = lOTSamsungWH1 + cdbl(Rsinven1("inv_qty1")) lTotalM2InvD = lTotalM2InvD + localm2 lTotalDllInvD =lTotalDllInvD + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) 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" 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")) lSamsungObsOB1WH3 = lSamsungObsOB1WH3 + cdbl(Rsinven1("inv_qty3")) lSamsungObsOB1WH1 = lSamsungObsOB1WH1 + cdbl(Rsinven1("inv_qty1")) 'lTotalM2Inv1 = lTotalM2Inv1 + localm2 'lTotalDllInv1 =lTotalDllInv1 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) 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")) lSamsungObsOT1WH3 = lSamsungObsOT1WH3 + cdbl(Rsinven1("inv_qty3")) lSamsungObsOT1WH1 = lSamsungObsOT1WH1 + cdbl(Rsinven1("inv_qty1")) 'lTotalM2Inv1 = lTotalM2Inv1 + localm2 'lTotalDllInv1 =lTotalDllInv1 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) end if else lOBSamsung2 = lOBSamsung2 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lOBSamsung2WH3 = lOBSamsung2WH3 + cdbl(Rsinven1("inv_qty3")) lOBSamsung2WH1 = lOBSamsung2WH1 + cdbl(Rsinven1("inv_qty1")) lTotalQtyInvD = lTotalQtyInvD + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lTotalM2InvD = lTotalM2InvD + localm2 lTotalDllInvD =lTotalDllInvD + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) end if 'NA end if 'PAD else lOTSamsung = lOTSamsung + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH3 = lOTSamsungWH3 + cdbl(Rsinven1("inv_qty3")) lOTSamsungWH1 = lOTSamsungWH1 + cdbl(Rsinven1("inv_qty1")) end if 'RS lTotalQtyInv1 = lTotalQtyInv1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lTotalM2Inv1 = lTotalM2Inv1 + localm2 lTotalDllInv1 =lTotalDllInv1 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) Rsinven2.Close Set Rsinven2 = Nothing else set Rsother=cnn.execute("select * from Items where good_nm='" & Rsinven1("item") & "'") 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")) lOtherObsM2 = lOtherObsM2 + localm2 lOtherObsDll =lOtherObsDll + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) end if ELSE end if lOthers1 = lOthers1 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lOthers2 = 0 lTotalQtyInv2 = lTotalQtyInv2 + cdbl(Rsinven1("inv_qty1")) + cdbl(Rsinven1("inv_qty2")) + cdbl(Rsinven1("inv_qty3")) lTotalM2Inv2 = lTotalM2Inv2 + localm2 lTotalDllInv2 =lTotalDllInv2 + cdbl(Rsinven1("inv_amt1")) + cdbl(Rsinven1("inv_amt2")) + cdbl(Rsinven1("inv_amt3")) end if Rsinven1.MoveNext Loop End If Rsinven1.Close Set Rsinven1 = Nothing '**************end inventory '********************************************************** Inventory V-Board 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.desc_note) desc_note, 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_qty6) inv_qty6 from ( select a.crp_id, a.cust_cd, a.good_cd, a.good_nm, max(a.desc_note) desc_note, 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, 0 inv_qty6 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, max(a.desc_note), 0, sum(isnull(a.jego_qty,0) - isnull(a.sales_qty,0)) inv_qty2, 0, 0,0,0 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 = '2' 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, max(a.desc_note), 0, 0, sum(isnull(a.mov_qty,0)), 0,0,0 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, max(a.desc_note), 0, 0, 0, sum(isnull(a.jego_qty,0) - isnull(a.sales_qty,0)), 0,0 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 = '3' 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, max(a.desc_note) desc_note, 0 inv_qty1, 0 inv_qty2, 0 inv_qty3, 0 inv_qty4, sum(isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)),0 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 = 'A' 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, max(a.desc_note) desc_note, 0 inv_qty1, 0 inv_qty2, 0 inv_qty3, 0 inv_qty4,0, sum(isnull(a.jego_qty,0) - isnull(a.mov_qty,0) - isnull(a.sales_qty,0)) 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 = '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 ) 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_nm ") 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" lcode1qty=0 lcode1amt=0 lcode2qty=0 lcode2amt=0 lcode3qty=0 lcode3amt=0 lcode4qty=0 lcode4amt=0 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" lcode1qty=0 lcode1amt=0 lcode2qty=0 lcode2amt=0 lcode3qty=0 lcode3amt=0 lcode4qty=0 lcode4amt=0 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") %>
V-Board Inventory| Item | TOTAL |
|
|---|---|---|
Qty |
Dlls |
|
| <%=lcode1%> | <%=lcode1qty%> | <%=formatnumber(lcode1amt,2)%> |
| <%=lcode2%> | <%=lcode2qty%> | <%=formatnumber(lcode2amt,2)%> |
| <%=lcode3%> | <%=lcode3qty%> | <%=formatnumber(lcode3amt,2)%> |
| <%=lcode4%> | <%=lcode4qty%> | <%=formatnumber(lcode4amt,2)%> |
<%=formatnumber((lcode1qty+lcode2qty+lcode3qty+lcode4qty),0)%> |
<%=formatnumber((lcode1amt+lcode2amt+lcode3amt+lcode4amt),2)%> |
|
| OB WH3 Nordika | OB Transfer | OB Total |
Others WH3 Nordika | Others Transfer | Others Total |
TOTAL |
||||
|---|---|---|---|---|---|---|---|---|---|---|
Qty |
M2 |
Dlls |
||||||||
| Samsung | Obsolete |
<%=(lSamsungObsOB1WH3)%> | <%=(lSamsungObsOB1WH1)%> | <%=(lSamsungObsOB1)%> |
<%=(lSamsungObsOT1WH3)%> | <%=(lSamsungObsOT1WH1)%> | <%=(lSamsungObsOT1)%> |
<%=formatnumber(lSamsungObsOB1+lSamsungObsOT1,0)%> |
<%=formatnumber(lTotalM2Inv1-lTotalM2InvD,0)%> |
$<%=formatnumber(lTotalDllInv1-lTotalDllInvD)%> |
Actual |
<%=lOBSamsung2WH3%> | <%=lOBSamsung2WH1%> | <%=lOBSamsung2%> |
<%=lOTSamsungWH3%> | <%=lOTSamsungWH1%> | <%=lOTSamsung2+lOTSamsung%> |
<%=formatnumber(lTotalQtyInvD+lOTSamsung,0)%> |
<%=formatnumber(lTotalM2InvD,0)%> |
$<%=formatnumber(lTotalDllInvD)%> |
|
| Total Samsung | <%=(lSamsungObsOB1+lOBSamsung2)%> |
<%=(lSamsungObsOT1+lOTSamsung2+lOTSamsung)%> |
<%=formatnumber(lTotalQtyInv1,0)%> |
<%=formatnumber(lTotalM2Inv1,0)%> |
$<%=formatnumber(lTotalDllInv1)%> |
|||||
| Others | Obsolete |
0 |
<%=(lOtherObs1)%> |
<%=(lOtherObs1)%> |
<%=formatnumber(lOtherObsM2,0)%> |
$<%=formatnumber(lOtherObsDll)%> |
||||
Actual |
0 |
<%=(lOthers1-lOtherObs1)%> |
<%=formatnumber(lTotalQtyInv2-lOtherObs1,0)%> |
<%=formatnumber(lTotalM2Inv2-lOtherObsM2,0)%> |
$<%=formatnumber(lTotalDllInv2-lOtherObsDll)%> |
|||||
Total Others |
0 |
<%=lOthers1%> |
<%=formatnumber(lTotalQtyInv2,0)%> |
<%=formatnumber(lTotalM2Inv2,0)%> |
$<%=formatnumber(lTotalDllInv2)%> |
|||||
| Total | <%=(lSamsungObsOB1+lOBSamsung2)%> |
<%=(lOthers1+lSamsungObsOT1+lOTSamsung2+lOTSamsung)%> |
<%=formatnumber(lTotalQtyInv1+lTotalQtyInv2,0)%> |
<%=formatnumber(lTotalM2Inv1+lTotalM2Inv2,0)%> |
$<%=formatnumber(lTotalDllInv1+lTotalDllInv2)%> |
|||||
W I P
TOTAL |
|||
|---|---|---|---|
Qty |
Dlls |
||
| SHEET | <% if lsheetwip=0 then%>No Data |
<%else%>
<%=formatnumber(lsheetwip,0)%> |
<%end if%>
|
| BOX | <% if lboxwip=0 then%>No Data |
<%else%>
<%=formatnumber(lboxwip,0)%> |
<%end if%>
|
<%=formatnumber((lsheetwip+lboxwip),0)%> |
|||
R W R
TOTAL |
|||
|---|---|---|---|
Qty |
|||
| BOX | <% if lboxrwr=0 then%>No Data |
<%else%>
<%=formatnumber(lboxrwr,0)%> |
<%end if%>
|
0 |
|||