§K¶O¶}©±
¢x
·µØ°ê»Ú
¢x
Ápµ¸§ÚÌ
¢x
¦^º¶
<% dim sql,goods1,goods2,beginDate,endDate,stockDate1,stockDate2,stockDate,totalQTY,totalSum,dateKey beginDate=trim(request.QueryString("bDate")) endDate=trim(request.QueryString("eDate")) goods1=trim(request.QueryString("goods1")) goods2=trim(request.QueryString("goods2")) if beginDate="" and endDate="" then dateKey="" elseif beginDate<>"" and endDate="" then dateKey=" and a.OutDate >='"&beginDate&"'" elseif beginDate="" and endDate<>"" then datekey=" and a.OutDate <='"&endDate&"'" else dateKey=" and a.OutDate between '"&beginDate&"' and '"&endDate&"'" end if sql="select a.OutDate from "&shopid&"ITURN a,"&shopid&"ITURITEM b where a.outno=b.outno and b.goodsmodel between '"&goods1&"' and '"&goods2&"'"&dateKey set rs=server.CreateObject("adodb.recordset") rs.open sql,conn,1,1 if rs.eof then response.Write("
¨S¦³²Å¦Xn¨Dªº°h³f³æ
") else stockDate1=rs("OutDate") rs.movelast stockDate2=rs("OutDate") rs.movefirst stockDate=replace(stockDate1&"~"&stockDate2,"/","-") rs.close sql="create table ##goods_TH ("&_ "goodsmodel varchar(20),goodsName varchar(50),outDate datetime,outNo varchar(30),comname varchar(50),"&_ "qty int,price money,unit char(4) )" conn.execute(sql) sql="select a.OutDate,a.outNO,b.goodsmodel,b.qty,b.Price,c.goodsname,c.unit,d.comname"&_ " from "&shopid&"ITURN a,"&shopid&"ITURITEM b,"&shopid&"goods c,"&shopid&"goodsprovider d"&_ " where a.outNO=b.OutNo and b.Goodsmodel=c.Goodsmodel and a.cno=d.comno and b.goodsmodel between '"&goods1&"' and '"&goods2&"'"&dateKey&" order by b.goodsmodel" createXlsSql="select b.goodsmodel as '°Ó«~½s¸¹',c.goodsname as '°Ó«~¦WºÙ',convert(char(10),a.OutDate,111) as '¶i³f³æ¤é´Á',a.outNO as '¶i³f³æ½s¸¹',d.comname as '¨ÑÀ³°Ó¦WºÙ',b.qty as '¼Æ¶q',b.Price as '³æ»ù',c.unit as '³æ¦ì',b.qty*b.price as '¤pp' "&_ " from "&shopid&"ITURN a,"&shopid&"ITURITEM b,"&shopid&"goods c,"&shopid&"goodsprovider d"&_ " where a.outNO=b.OutNo and b.Goodsmodel=c.Goodsmodel and a.cno=d.comno and b.goodsmodel between '"&goods1&"' and '"&goods2&"'"&dateKey&" order by b.goodsmodel" rs.open sql,conn,1,1 recordCounts=rs.recordcount nowID="" nextID="" do while not rs.eof nowID=trim(rs("goodsmodel")) rs.movenext if not rs.eof then nextID=trim(rs("goodsmodel")) rs.moveprevious if nowID<>nextID or rs.absoluteposition=recordCounts then sql="insert into ##goods_TH (goodsmodel,goodsName) values ('"&rs("goodsmodel")&"','"&rs("goodsName")&"')" conn.execute(sql) end if sql="insert into ##goods_TH values ('"&rs("goodsmodel")&"','"&rs("goodsName")&"','"&rs("outDate")&"','"&rs("outNo")&"','"&rs("comname")&"',"&rs("qty")&","&rs("price")&",'"&rs("unit")&"')" conn.execute(sql) rs.movenext loop rs.close sql="select * from ##goods_TH order by goodsmodel,outno" rs.open sql,conn,1,1 tmpRecordCounts=rs.recordcount if tmpRecordCounts mod reportRows = 0 then pageCounts=tmpRecordCounts/reportRows else pageCounts=int(tmpRecordCounts/reportRows+1) end if showTable for i=1 to pageCounts call showPage(i,recordCounts) next response.Write("") end if sub showPage(currentPage,recordC) response.Write("
") response.Write(getshopname()) response.Write("
"&request.QueryString("title")) response.Write("
") %>
°h³f¤é´Á¡G<%=stockDate%>
»sªí¤é´Á¡G<%=date()%>
¬d¸ßµ²ªG¡G¦@
<%=recordCounts%>
µ§
¶¦¸
¡G<%=i%>/<%=pageCounts%> ¶
°h³f³æ¤é´Á
°h³f³æ½s¸¹
¼t°Ó¦WºÙ
¼Æ¶q
³æ¦ì
³æ»ù
¤pp
<% totalQTY=0 totalSum=0 rs.pagesize=reportRows rs.absolutepage=currentPage for ii=1 to rs.pagesize if isNull(rs("outno")) then with response .Write("
") .Write("
") .Write("
°Ó«~½s¸¹¡G"&rs("goodsmodel")&" °Ó«~¦WºÙ¡G"&rs("goodsname")&"
") .Write("
") .Write("
") end with else %>
<%=rs("OutDate")%>
<%=rs("outNO")%>
<%=rs("comname")%>
<%=rs("qty")%>
<%=rs("unit")%>
<%=rs("price")%>
<%=trim(rs("qty"))*trim(rs("price"))%>
<% totalQTY=totalQTY+trim(rs("qty")) totalSum=totalSum+trim(rs("qty"))*trim(rs("price")) end if rs.movenext if rs.eof then exit for next %>
¦Xp
°h³f¼Æ¶q¡G<%=totalQTY%>
°h³fª÷ÃB¡G<%=totalSum%>
<% response.Write("
") end sub rs.close:set rs=nothing closeConn() %>