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

📄 financestat.asp

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

if request("statSearch")<>"" then
	strstatSearch=request.form("statSearch")
else
	strstatSearch="username"
end if

if Request.Form("namesearch")<>"" then
	strwhere =strwhere&" and userid='"&Request.Form("namesearch")&"'"
else
	if objcheck.CheckUserFunction2("payment","edit") then
	else
		strwhere =strwhere &"and (creator='"&session("loginid")&"' or userid='"&session("loginid")&"' or userid in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
	end if
end if

if Request.Form("FdateSearch")<>"" then
	strFdate=Request.Form("FdateSearch")
	strwhere=strwhere&" and CreateDate>='"&cdate(strFdate)&"'"
else
	strFdate=date()-7
	strwhere=strwhere&" and CreateDate>='"&cdate(strFdate)&"'"
end if

if  Request.Form("EdateSearch")<>"" then
	strEdate=Request.Form("EdateSearch")
	strwhere=strwhere&" and CreateDate<'"&cdate(strEdate)+1&"'"
else
	strEdate=date()
	strwhere=strwhere&" and CreateDate<'"&cdate(strEdate)+1&"'"
end if

if Request.Form("CollectionStat")="Collected" then
	strwhere=strwhere&" and collectionstatus='已销'"
elseif Request.Form("CollectionStat")="Collecting" then
	strwhere=strwhere&" and collectionstatus='未销'"
end if

if Request.Form("InvoiceStat")="Invoiced" then
	strwhere=strwhere&" and invoicestatus='已销'"
elseif Request.Form("InvoiceStat")="Invoicing" then
	strwhere=strwhere&" and invoicestatus='未销'"
elseif Request.Form("InvoiceStat")="NoInvoice" then
	strwhere=strwhere&" and invoice=0"
end if

Set rsarreport=Server.CreateObject("ADODB.Recordset")
if request("statSearch2")="" then
	sql="SELECT "&strstatSearch&",COUNT(*) AS subnum,SUM(amount) AS subtamount FROM v_OrderPayMent where 1=1 "&strwhere&" and sysaccountid="&sysid
	sql=sql & " GROUP BY "&strstatSearch&" ORDER BY subtamount DESC "
else
	sql="SELECT "&strstatSearch&","&request("statSearch2")&",COUNT(*) AS subnum, SUM(amount) AS subtamount FROM v_OrderPayMent where 1=1 "&strwhere&" and sysaccountid="&sysid
	sql=sql & " GROUP BY "&strstatSearch&","&request("statSearch2")&" ORDER BY "&strstatSearch&" DESC "
end if

'response.write sql
rsarreport.open sql,connarreport,1,1
alls=rsarreport.Recordcount

if request.form("statSearch")="username" or request.form("statSearch")="" then
	dispname="销售员"
elseif request.form("statSearch")="CreateDate" then
	dispname="每日"
elseif request.form("statSearch")="CreateMonth" then
	dispname="每月"
elseif request.form("statSearch")="account" then
	dispname="客户"
elseif request.form("statSearch")="paymentno" then
	dispname="应收编号"
end if

if request.form("statSearch2")="username" then
	dispname2="销售员"
elseif request.form("statSearch2")="expensedate" then
	dispname2="每日"
elseif request.form("statSearch2")="expensemonth" then
	dispname2="每月"
elseif request.form("statSearch2")="account" then
	dispname2="客户"
elseif request.form("statSearch2")="paymentno" then
	dispname2="应收编号"
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../global.css" rel=stylesheet type=text/css>
<style type="text/css"></style>
<title>应收统计</title>
</head>
<SCRIPT language=JavaScript>
function opensubwin(attrstr,targ1)
{
	var tempwin=window.open(targ1,null,attrstr);
	tempwin.location.href=targ1;
	tempwin.opener=this;
}
function submit1(){
	window.form1.submit();
	return true;
}
function submit3(){
	if (form1.StatType.value=="ar"){
		link="financeStat.asp";
		document.location.href=link;
	}
	if (form1.StatType.value=="pay"){
		link="financePOStat.asp";
		document.location.href=link;
	}
}
</SCRIPT>
<script language=javascript src="../tools/newcalendar.js"></script>
<body leftmargin="10" rightmargin="10" topmargin="10">
<table align="center" border="0" cellPadding="0" width="100%"  style="font-size:10pt">
<form id=form1 name=form1 action="" method=post>
	<tr>
    <td><select name=statSearch size=1 id=select  language=javascript  onChange="submit1()">
        <option value="username" <%if request("statSearch")="username" then Response.Write " selected"%>>按销售员</option>
        <option value="account" <%if request("statSearch")="account" then Response.Write " selected"%>>按客户</option>
        <option value="paymentno" <%if request("statSearch")="paymentno" then Response.Write " selected"%>>按应收编号</option>
        <option value="CreateDate" <%if request("statSearch")="CreateDate" then Response.Write " selected"%>>按每日</option>
        <option value="CreateMonth" <%if request("statSearch")="CreateMonth" then Response.Write " selected"%>>按每月</option>
      </select> 
      <select name=statSearch2 size=1 ID=Select1  LANGUAGE=javascript  onchange="submit1()">
	<option value="" <%if request("statSearch2")="" then Response.Write " selected"%>>--第二条件--</option>
	<option value="username" <%if request("statSearch2")="username" then Response.Write " selected"%>>按销售员</option>
	<option value="account" <%if request("statSearch2")="account" then Response.Write " selected"%>>按客户</option>
        <option value="paymentno" <%if request("statSearch2")="paymentno" then Response.Write " selected"%>>按应收编号</option>
	<option value="CreateDate" <%if request("statSearch2")="CreateDate" then Response.Write " selected"%>>按每日</option>
	<option value="CreateMonth" <%if request("statSearch2")="CreateMonth" then Response.Write " selected"%>>按每月</option>
	</select>
	从<input name=FdateSearch size=9 language=javascript id=dupdatetime value='<%=strFdate%>' readonly><% call AddImg("date")%>
                <input type = hidden name=clicksource>
                <input type = hidden name=clickresult >
	到<input name=EdateSearch size=9 language=javascript id=dupdatetime2 value='<%=strEdate%>'  readonly><% call AddImg("date2")%>
	<select name=nameSearch size=1 ID=Select1  LANGUAGE=javascript  onchange="submit1()">
	<option value="">--选择销售员--</option>
	<%getsubordinate Request.Form("namesearch")%>
	</select>
	<input type=submit name="Search" value="提交"></td></tr>
</form1>
</table>

<table cellspacing=0 cellpadding=0 width="100%" border=0>
  <tbody> 
  <tr> 
    <td> 
      <table cellspacing=0 cellpadding=0 width="100%" border=0>
    <tr> 
      <td height="25"><strong><font class=title><b>应收统计&nbsp;&nbsp;</b></font></strong>
		<select name=CollectionStat size=1 LANGUAGE=javascript  onchange="submit1()">
			<option value="" <%if request("CollectionStat")="" then Response.Write " selected"%>>--收款状态--</option>
			<option value="Collected" <%if request("CollectionStat")="Collected" then Response.Write " selected"%>>已收款</option>
			<option value="Collecting" <%if request("CollectionStat")="Collecting" then Response.Write " selected"%>>未收款</option>
		</select>
		<select name=InvoiceStat size=1 LANGUAGE=javascript  onchange="submit1()">
			<option value="" <%if request("InvoiceStat")="" then Response.Write " selected"%>>--开票状态--</option>
			<option value="Invoiced" <%if request("InvoiceStat")="Invoiced" then Response.Write " selected"%>>已开票</option>
			<option value="Invoicing" <%if request("InvoiceStat")="Invoicing" then Response.Write " selected"%>>未开票</option>
			<option value="NoInvoice" <%if request("InvoiceStat")="NoInvoice" then Response.Write " selected"%>>不开票</option>
		</select>
		<select name=char size=1 ID=Select1 LANGUAGE=javascript  onchange="submit1()">
			<option value="" <%if request("char")="" then Response.Write " selected"%>>--查看图例--</option>
			<option value="pie" <%if request("char")="pie" then Response.Write " selected"%>>饼图</option>
			<option value="3dbar" <%if request("char")="3dbar" then Response.Write " selected"%>>3D柱形图</option>
			<option value="bar" <%if request("char")="bar" then Response.Write " selected"%>>柱形图</option>
			<option value="Line" <%if request("char")="Line" then Response.Write " selected"%>>线形图</option>
			<option value="filledline" <%if request("char")="filledline" then Response.Write " selected"%>>填充线形图</option>
		</select>
	  </td>
	  <td align="right">
		<select name=StatType  LANGUAGE=javascript  onchange="submit3()">
			<option value="ar" <%if request("StatType")="ar" then Response.Write " selected"%>>--应收统计--</option>
			<option value="pay" <%if request("StatType")="pay" then Response.Write " selected"%>>--应付统计--</option>
		</select>
	  </td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
      </table>
    </td>
  </tr>
  <tr class="linecolor"><td height="2"></td></tr>
 <tr height="5px"><td></td></tr>

⌨️ 快捷键说明

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