<!--#include file="XTG.asp"-->
<%
exec="select distinct goodsid,goods.memorycode from c_gccs,goods where c_gccs.goodsid = goods.goodsid and c_gccs.billdate >='2007-01-01' and c_gccs.billdate <='2007-01-25' order by goods.barcode"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>规格及型号</title>
<style fprolloverstyle>A:hover {color: red; font-weight: bold}
</style>
<meta name="Microsoft Theme" content="expeditn 011, default">
</head>
<body background="_themes/expeditn/exptextb.jpg" bgcolor="#FFFFFF" text="#000000" link="#993300" vlink="#666600" alink="#CC3300"><!--mstheme--><font face="宋体">
<div align="center">
<center>
<!--mstheme--></font><table border="1" width="807" height="66" style="border-style: solid; border-width: 1" bordercolordark="#660000" bordercolorlight="#CC9966">
<tr>
<td width="300" rowspan="2" height="38" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">规格及型号</font><!--mstheme--></font></td>
<td width="210" rowspan="2" height="38" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">期初数量</font><!--mstheme--></font></td>
<td width="576" colspan="3" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">本月入库</font><!--mstheme--></font></td>
<td width="960" colspan="5" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">本月出库</font><!--mstheme--></font></td>
<td width="192" rowspan="2" height="38" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">本月结存</font><!--mstheme--></font></td>
<tr>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">包装入库</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">客户退回</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">小计</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">客户销售</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">退返修组</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">发样品组</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">其它发货</font><!--mstheme--></font></td>
<td width="192" height="16" valign="middle" align="center"><!--mstheme--><font face="宋体"><font face="楷体_GB2312" size="1">小计</font><!--mstheme--></font></td>
<%
do while not rs.eof
abc = rs("goodsid")
exec1="select sum(billqty) as a from c_gccs where goodsid ="&abc
set rs1=server.createobject("adodb.recordset")
rs1.open exec1,conn,1,1
exec2="SELECT sum(i_otherind.qty) as b FROM i_otherind ,i_otherin WHERE i_otherind.billid = i_otherin.billid and OINTYPEID = 1 AND i_otherind.goodsid = "&ABC
set rs2=server.createobject("adodb.recordset")
rs2.open exec2,conn,1,1
exec3="SELECT SUM(QTY*-1) as c FROM S_SENDD WHERE qty<0 and goodsid =" &abc
set rs3=server.createobject("adodb.recordset")
rs3.open exec3,conn,1,1
exec4="SELECT SUM(QTY) as d FROM S_SENDD WHERE qty>0 and goodsid =" &abc
set rs4=server.createobject("adodb.recordset")
rs4.open exec4,conn,1,1
exec5="SELECT sum(i_otherind.qty*-1) as e FROM i_otherind ,i_otherin WHERE i_otherind.billid = i_otherin.billid and OINTYPEID = 2 AND i_otherind.goodsid = "&ABC
set rs5=server.createobject("adodb.recordset")
rs5.open exec5,conn,1,1
exec6="SELECT sum(i_otheroutd.qty) as f FROM i_otherout ,i_otheroutd WHERE i_otherout.billid = i_otheroutd.billid and i_otherout.OOUTTYPEID = 3 AND i_otheroutd.goodsid = "&ABC
set rs6=server.createobject("adodb.recordset")
rs6.open exec6,conn,1,1
exec7="SELECT sum(i_otheroutd.qty) as g FROM i_otherout ,i_otheroutd WHERE i_otherout.billid = i_otheroutd.billid and i_otherout.OOUTTYPEID = 1 AND i_otheroutd.goodsid = "&ABC
set rs7=server.createobject("adodb.recordset")
rs7.open exec7,conn,1,1
%>
<tr>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font face="宋体" size="1"><%=rs("MEMORYCODE")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs1("a")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs2("B")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs3("c")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs2("b")+rs3("c")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs4("d")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs5("e")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs6("F")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs7("g")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs4("d")+rs5("e")+rs6("f")+rs7("g")%></font><!--mstheme--></font></td>
<td width="192" height="16"><!--mstheme--><font face="宋体"><font size="1"><%=rs1("a")+rs2("b")+rs3("c")-rs4("d")-rs5("e")-rs6("f")-rs7("g")%></font><!--mstheme--></font></td>
<%
rs.movenext
loop
%>
</table><!--mstheme--><font face="宋体">
</center>
</div>
<!--mstheme--></font></body>
</html>