📄 showhistory.asp
字号:
<!--#include file="config.ini"-->
<!--#include file="commfunction.inc" -->
<%sysid=checkandgetsysaccountid()%>
<html>
<head>
<title>最近10次历史价格</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="global.css" rel=stylesheet type=text/css>
</head>
<body>
<%
set conn=server.CreateObject("adodb.connection")
conn.Open connstring
%>
<%if Request.QueryString("theType")="po" then%>
<font class=title>最近10次历史价格</font>
<table width="100%" bgcolor=cdcdcd cellspacing=1>
<tr bgcolor=efefef>
<td align=center height=20 nowrap>货号</td>
<td align=center nowrap>型号</td>
<td align=center nowrap>价格</td>
<td align=center nowrap>供应商</td>
<td align=center nowrap>采购单号</td>
<td align=center nowrap>成交日期</td>
</tr>
<%
if cint(Request.QueryString("theAccountid"))=-1 then
sql = "select top 10 * from v_MaterialTransaction_history where productid="&Request.QueryString("theproductid")&" and poowner='"&session("loginid")&"' and sysaccountid="&sysid
else
sql = "select top 10 * from v_MaterialTransaction_history where productid="&Request.QueryString("theproductid")&" and poaccountid="&Request.QueryString("theAccountid")&" and sysaccountid="&sysid
end if
'Response.Write sql
set rs=conn.Execute(sql)
if not rs.EOF and not rs.BOF then
while not rs.EOF
%>
<tr bgcolor=white>
<td align="center" nowrap><%=rs("productcode")%></a></td>
<td align="center" nowrap><%=rs("model")%></a></td>
<td align="center" nowrap><font color=red><%=formatnumber(rs("cost"),2)%></font></a></td>
<td align="center" nowrap><%=rs("poaccount")%></a></td>
<td align="center" nowrap><%=rs("pono")%></a></td>
<td align="center" nowrap><%=rs("Transactdate")%></a></td>
</tr>
<%
rs.MoveNext
wend
else
Response.Write "<tr bgcolor=white><td colspan=6>无历史记录</td></tr>"
end if
%>
</table>
<%elseif Request.QueryString("theType")="quoteandorder" then%>
<font class=title>最近10次历史价格</font>
<table width="100%" bgcolor=cdcdcd cellspacing=1>
<tr bgcolor=efefef>
<td align=center height=20 nowrap>货号</td>
<td align=center nowrap>型号</td>
<td align=center nowrap>价格</td>
<td align=center nowrap>客户</td>
<td align=center nowrap>合同号</td>
<td align=center nowrap>成交日期</td>
</tr>
<%
if cint(Request.QueryString("theAccountid"))=-1 then
set rs=conn.Execute("select approver from approve where approver='"&session("loginid")&"'")
if not rs.eof then
sql = "select top 100 * from v_MaterialTransaction_history where Transactcode='发货单发货' and productid="&Request.QueryString("theproductid")&" and sysaccountid="&sysid&" order by Transactdate desc"
else
sql = "select top 10 * from v_MaterialTransaction_history where Transactcode='发货单发货' and productid="&Request.QueryString("theproductid")&" and orderaccountid="&Request.QueryString("theAccountid")&" and sysaccountid="&sysid&" order by Transactdate desc"
end if
else
sql = "select top 10 * from v_MaterialTransaction_history where Transactcode='发货单发货' and productid="&Request.QueryString("theproductid")&" and orderaccountid="&Request.QueryString("theAccountid")&" and sysaccountid="&sysid&" order by Transactdate desc"
end if
set rs=conn.Execute(sql)
if not rs.EOF and not rs.BOF then
while not rs.EOF
%>
<tr bgcolor=white>
<td align="center" nowrap><%=rs("productcode")%></a></td>
<td align="center" nowrap><%=rs("model")%></a></td>
<td align="center" nowrap><font color=red><%if rs("price")<>"" then Response.Write formatnumber(rs("price"),2) else Response.Write "--"%></font></a></td>
<td align="center" nowrap><%=rs("orderaccount")%></a></td>
<td align="center" nowrap><%=rs("ordernum")%></a></td>
<td align="center" nowrap><%=rs("Transactdate")%></a></td>
</tr>
<%
rs.MoveNext
wend
else
Response.Write "<tr bgcolor=white><td colspan=6>无历史记录</td></tr>"
end if
%>
</table>
<%end if
rs.close
Set rs = nothing
conn.Close
set conn = nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -