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

📄 deliveryhistoryreport.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"

if Request.Form("amount")<>"" then
	strwhere =strwhere&" and totalamount"&Request.Form("operate")&Request.Form("amount")*10000&""
end if

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

if Request.Form("startdate")<>"" then
	strwhere=strwhere&" and lastdate>='"&Request.Form("startdate")&"'"
end if

if  Request.Form("enddate")<>"" then
	strwhere=strwhere&" and lastdate<='"&Request.Form("enddate")&"'"
end if

if objcheck.CheckUserFunction2("delivery","edit") or objcheck.CheckUserFunction2("payment","edit") then
else
	strwhere=strwhere&" and (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"') or accountid in(select accountid from accountshare where shareto='"&session("loginid")&"'))"
end if

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

sql="select * from v_deliveryhistory where 1=1 "&strwhere&" order by lastdate desc,totalamount desc"
'response.write sql
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()">
  <table align="center" width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr align="left"> 
      <td colspan=3> 
        <div align="left"><strong><font size="4" face="黑体">客户发货统计</font></strong></div></td>
    </tr>
	<tr><td  colspan="3" height=4></td></tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
    <tr bgcolor="006699"> 
      <td 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="8%" height="18" align=center><font color="#FFFFFF">发货次数</font></td>
      <td width="8%" height="18" align=center><font color="#FFFFFF">发货数量</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">累计金额</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">平均金额/件</font></td>
      <td width="12%" height="18" align=center><font color="#FFFFFF">平均金额/次</font></td>
    </tr>
    <%
  i=1
  do while not rs.EOF
%>
    <tr bgcolor="#FFFFFF"> 
      <td height=18><%=rs("account")%></td>
      <td align=center><%=rs("username")%></td>
      <td align=center><%=rs("firstdate")%></td>
      <td align=center><%=rs("lastdate")%></td>
      <td align=center><%=rs("deliverytimes")%></td>
      <td align=center><%=rs("totalqty")%></td>
      <td align=right><%=formatnumber(rs("totalamount"),2)%></td>
      <td align=right><%=formatnumber((ccur(rs("totalamount"))/ccur(rs("totalqty"))),2)%></td>
      <td align=right><%=formatnumber((ccur(rs("totalamount"))/ccur(rs("deliverytimes"))),2)%></td>
    </tr>

    <%
  i=i+1
  previous=owner
  rs.MoveNext
  loop
  
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
  </table>
  
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr> 
    <td width="15%"> <div align="right">最近发货日期(从):</div></td>
    <td width="10%"> <%=request.form("startdate")%> <div align="left"></div></td>
    <td width="4%"><div align="center">(至)</div></td>
    <td width="10%"><%=request.form("enddate")%> <div align="right"></div></td>
    <td>&nbsp;</td>
   </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td height=2 bgcolor="#4A699C"></td>
  </tr>
  <tr>
    <td><div align="left"><%=getfieldvalue("company","id","1","company")%>&nbsp;&nbsp;<%=getfieldvalue("company","id","1","address")%></div></td>
  </tr>
</table>
</body>
</html>
<%set objcheck=nothing%>

⌨️ 快捷键说明

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