⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 whsreport.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "report","read"

strwhere=strwhere&" and model like '%"&Request.Form("Contain")&"%'"

if Request.Form("locationtype")<>"" then
	strwhere=strwhere&" and locationtype="&Request.Form("locationtype")
end if

if Request.Form("whse")<>"" then
	strwhere=strwhere&" and whseid="&Request.Form("whse")
end if

if Request.Form("producttype")<>"" then
	strwhere=strwhere&" and producttype="&Request.Form("producttype")
end if

if Request.Form("account")<>"" then
	strwhere=strwhere&" and manufacturer="&Request.Form("account")
end if

if Request.Form("nonnet")<>"" then
	strwhere=strwhere&" and nonnet="&Request.Form("nonnet")
end if

if Request.Form("storedays")<>"" then
	strwhere=strwhere&" and days>"&Request.Form("storedays")
end if

if Request.Form("recentsaledays")<>"" then
	strwhere=strwhere&" and recentsaledays>"&Request.Form("recentsaledays")
end if

if Request.Form("orderby")<>"" then
	strwhere=strwhere&" order by "&Request.Form("orderby")&" "&Request.Form("orderbymethod")
end if

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring

sql="select * from vw_product_location where qty_on_hand>0 "&strwhere

rs.Open sql,conn,1,1

%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>库存报表</title>
</head>
<script language="JavaScript">
function window_onload()
{
window.moveTo(-2,-2);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>
<body leftmargin="10" rightmargin="10" topmargin="10" onload="window_onload()">
<form name="form1" method="post" action="account.asp">
  <table align="center" width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr align="left"> 
      <td> 
        <div align="left"><strong><em><font size="4" face="黑体">库存报表</font></em></strong></div></td>
    </tr>
  <tr> 
    <td height=2 colspan="3" bgcolor="#4A699C"></td>
  </tr>
	<tr><td  colspan="3" height=4></td></tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
    <tr> 
      <td width="10%"> <div align="right"><em>库存时间:</em></div></td>
      <td width="10%"> <div align="center"> <%=Request.Form("storedays")%>(天)</div></td>
      <td width="10%"> <div align="right"><em>货位类型:</em></div></td>
      <td width="10%"><div align="center">
	<%=getfieldvalue("userdefine","id",Request.Form("locationtype"),"name")%></div></td>
      <td width="10%"><div align="right"><em>非净货位:</em></div></td>
      <td width="10%"> <div align="center"><%if Request.Form("nonnet")="1" then response.write "是" else response.write "否" end if%></div></td>
      <td>&nbsp;</td>
    </tr>
  </table>  
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="#006699"> 
      <td height=18 align=center><font color="#FFFFFF">序号</font></td>
      <td height=18 align=center><font color="#FFFFFF">名称</font></td>
      <td height=18 align=center><font color="#FFFFFF">型号</font></td>
      <td width="8%" height="18" align=center><font color="#FFFFFF">仓库</font></td>
      <td width="8%" height="18" align=center><font color="#FFFFFF">货位</font></td>
      <td width="10%" height="18" align=center><font color="#FFFFFF">数量</font></td>
      <td width="10%" height="18" align=center><font color="#FFFFFF">平均成本</font></td>
      <td width="6%" height="18" align=center><font color="#FFFFFF">非净</font></td>
      <td width="6%" align=center><font color="#FFFFFF">在库时间</font></td>
      <td width="8%" height="18" align=center><font color="#FFFFFF">最近销售天数</font></td>
    </tr>
    <%
    i=1
    totalqty=0
    totalcost=0
  do while not rs.EOF%>
    <tr bgcolor="#99CCCC"> 
      <td align=center><%=i%></td>
      <td height=18 align=center><%=rs("name")%></td>
      <td height=18 align=center><%=rs("model")%></td>
      <td align=center><%=rs("whse")%></td>
      <td align=center><%=rs("location")%></td>
      <td align=center><%=rs("qty_on_hand")%></td>
      <td align=right> 
        <%if objcheck.CheckUserFunction2("viewcost","read") then%>
        <%=formatnumber(rs("averagecost"),2)%> 
        <%end if%>
        </td>
      <td align=center>
        <%if rs("nonnet") then Response.Write "是" else Response.Write "否"%>
      </td>
      <td align=center><%=rs("days")%>天</td>
      <td align=center><%if rs("recentsaledays")>38000 then response.write "未销售" else response.Write rs("recentsaledays")&"天"%></td>
    </tr>
    <%
  totalqty=totalqty+rs("qty_on_hand")
  totalcost=csng(totalcost)+csng(rs("averagecost"))*csng(rs("qty_on_hand"))
  i=i+1
  rs.MoveNext
  loop
  
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
    <tr bgcolor="#99CCCC"> 
      <td align=center>合计</td>
      <td height=18 align=center></td>
      <td align=center></td>
      <td align=center></td>
      <td align=center></td>
      <td align=center><%=totalqty%></td>
      <td align=right>
        <%if objcheck.CheckUserFunction2("viewcost","read") then%>
        <%=formatnumber(totalcost,2)%>
        <%end if%>
      </td>
      <td align=center></td>
      <td align=center></td>
      <td align=center></td>
    </tr>
  </table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td><div align="left"><%=getfieldvalue("company","id","1","company")%>&nbsp;&nbsp;<%=getfieldvalue("company","id","1","address")%></div></td>
  </tr>
  <tr> 
    <td height=2 bgcolor="#4A699C"></td>
  </tr>
</table>
</body>
</html>
<%set objcheck=nothing%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -