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

📄 mfunstate.asp

📁 功能最强大的ASP网站
💻 ASP
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/func.asp"-->
<%
FunCode="F304"
session("title")="帐务统计"
session("headline")="首页 -> 注册系统 -> 帐务统计"
%>
<!--#include file="../inc/head2.asp"-->
<%
'call list_1()
if request("field") = "" then
	call list_1()
else
	call List_2(request("field"))
end if

FUnction getAccountF(field,musername,agentlist)
set rs = conn.execute ("select sum("&field&") from account where username in (select username from [user] where manageuser='" & session("username") & "') ")
getAccountF = rs(0)
rs.close
end Function


Function GetAccountSum(direction, date1, date2, musername,agentlist)
sql = "select sum(amount) from accountdetail where direction='" & direction & "'"
if date1 <> "" then sql = sql & " and regtime >= '" & date1 & "' " 
if date2 <> "" then sql = sql & " and regtime <= '" & date2 & "' " 
sql = sql & " and ( username in (select username from [user] where manageuser='" & session("username") & "'))  "

set rs = conn.execute (sql )
GetAccountSum = rs(0)
rs.close
end Function

'公司帐务状态
sub list_1()
yyyy=datepart("yyyy",date())
mm=datepart("m",date())
acttype = request("acttype")
if acttype = "" then acttype = "1" end if
%>
<br>
<img src='../images/dotdb.gif' width='10' height='10'> 
            
			系统的财务平衡关系如下:<br>
			<font color='#FF0000'>
&nbsp;&nbsp;&nbsp;&nbsp;银行存款 = 真实入帐 - 真实扣帐<br>
&nbsp;&nbsp;&nbsp;&nbsp;业务收入 = 自动扣帐 + 业务扣帐 - 业务退款<br>
&nbsp;&nbsp;&nbsp;&nbsp;银行存款 + 客户欠款 = 业务收入 + 客户余额<br>
			</font><br><br>
<table border=1 bordercolor=#3770A9 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=50% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center"><b>财务概况</b></td></tr>
<tr><td class='color01' bgcolor='#efefef' align="center" width="40%">统计类型</td>
<td>
<form action="mFunState.asp" name="fun">
<select name="acttype" onchange="return submit()">
<option value="1" <%if acttype="1" then response.write "selected"%>>客户帐务统计</option>
<option value="2" <%if acttype="2" then response.write "selected"%>>记帐流水汇总</option>
<option value="3" <%if acttype="3" then response.write "selected"%>>本日记帐流水统计</option>
<option value="4" <%if acttype="4" then response.write "selected"%>>本月记帐流水统计</option>
<option value="5" <%if acttype="5" then response.write "selected"%>>本年记帐流水统计</option>
<option value="6" <%if acttype="6" then response.write "selected"%>>全部统计</option>
</select>

</td>
</form>
</tr>
<tr><td class='color01' bgcolor='#efefef'>统计类型</td><td class='color01' bgcolor='#efefef'>金额</td></tr>
<%if acttype = "1" or acttype="6" then %>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center">客户帐务统计</td></tr>
<tr><td><a href="mFunState.asp?field=balance">客户余额总额</a></td><td>&nbsp;<%=getAccountF("balance","",agentlist)%>元</td></tr>
<tr><td><a href="mFunState.asp?field=debit">客户欠款总额</a></td><td>&nbsp;<%=getAccountF("debit","",agentlist)%>元</td></tr>
<tr><td><a href="mFunState.asp?field=freeze">客户冻结总额</a></td><td>&nbsp;<%=getAccountF("freeze","",agentlist)%>元</td></tr>
<%end if
if acttype = "2" or acttype="6" then
%>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center">记帐流水汇总</td></tr>
<tr><td><font color='#FF0000'>银行存款总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("真实入帐","","","",agentlist)-GetAccountSum("真实扣帐","","","",agentlist)%>元</font></td></tr>
<tr><td><font color='#FF0000'>业务收入总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("业务扣帐","","","",agentlist)-GetAccountSum("业务退帐","","","",agentlist)+GetAccountSum("扣帐","","","",agentlist)%>元</font></td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实入帐">真实入帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实入帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实扣帐">真实扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实扣帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=扣帐">自动扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("扣帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务扣帐">业务扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务扣帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务退帐">业务退帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务退帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款入帐">借款入帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款入帐","","","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款扣帐">借款扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款扣帐","","","",agentlist)%>元</td></tr>
<%end if
if acttype = "3" or acttype="6" then
%>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center">本日记帐流水汇总</td></tr>
<tr><td><font color='#FF0000'>本日银行存款总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("真实入帐",date(),date(),"",agentlist)-GetAccountSum("真实扣帐",date(),date(),"",agentlist)%>元</font></td></tr>
<tr><td><font color='#FF0000'>本日业务收入总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("业务扣帐",date(),date(),"",agentlist)-GetAccountSum("业务退帐",date(),date(),"",agentlist)+GetAccountSum("扣帐",date(),date(),"",agentlist)%>元</font></td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实入帐&date1=<%=date()%>&date2=<%=date()%>">本日真实入帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实入帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实扣帐&date1=<%=date()%>&date2=<%=date()%>">本日真实扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实扣帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=扣帐&date1=<%=date()%>&date2=<%=date()%>">本日自动扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("扣帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务扣帐&date1=<%=date()%>&date2=<%=date()%>">本日业务扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务扣帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务退帐&date1=<%=date()%>&date2=<%=date()%>">本日业务退帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务退帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款入帐&date1=<%=date()%>&date2=<%=date()%>">本日借款入帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款入帐",date(),date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款扣帐&date1=<%=date()%>&date2=<%=date()%>">本日借款扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款扣帐",date(),date(),"",agentlist)%>元</td></tr>
<%end if
if acttype = "4" or acttype="6" then
%>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center">本月记帐流水汇总</td></tr>
<tr><td><font color='#FF0000'>本月银行存款总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("真实入帐",yyyy&"-"&mm&"-1",date(),"",agentlist)-GetAccountSum("真实扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</font></td></tr>
<tr><td><font color='#FF0000'>本月业务收入总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("业务扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)-GetAccountSum("业务退帐",yyyy&"-"&mm&"-1",date(),"",agentlist)+GetAccountSum("扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</font></td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实入帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月真实入帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实入帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实扣帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月真实扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=扣帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月自动扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务扣帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月业务扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务退帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月业务退帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务退帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款入帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月借款入帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款入帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款扣帐&date1=<%=yyyy&"-"&mm&"-1"%>&date2=<%=date()%>">本月借款扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款扣帐",yyyy&"-"&mm&"-1",date(),"",agentlist)%>元</td></tr>
<%end if
if acttype = "5" or acttype="6" then
%>
<tr><td class='color01' bgcolor='#efefef' colspan="4" align="center">本年记帐流水汇总</td></tr>
<tr><td><font color='#FF0000'>本年银行存款总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("真实入帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)-GetAccountSum("真实扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</font></td></tr>
<tr><td><font color='#FF0000'>本年业务收入总额</font></td><td>&nbsp;<font color='#FF0000'><%=GetAccountSum("业务扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)-GetAccountSum("业务退帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)+GetAccountSum("扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</font></td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实入帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年真实入帐总额</a></a></td><td>&nbsp;<%=GetAccountSum("真实入帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=真实扣帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年真实扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("真实扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=扣帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年自动扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务扣帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年业务扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=业务退帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年业务退帐总额</a></td><td>&nbsp;<%=GetAccountSum("业务退帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款入帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年借款入帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款入帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<tr><td><a href="mFunDetail.asp?direction=借款扣帐&date1=<%=yyyy&"-01-01"%>&date2=<%=yyyy&"-12-31"%>">本年借款扣帐总额</a></td><td>&nbsp;<%=GetAccountSum("借款扣帐",yyyy&"-01-01",yyyy&"-12-31","",agentlist)%>元</td></tr>
<%end if%>
</table>
<br><br>
<%
end sub

sub List_2(field)
	sql = " select * from account where " & field & " > 0 and username in (select username from [user] where manageuser='" & session("username") & "') "

	set rs=server.createobject("adodb.recordset")
	rs.open sql,conn,1,1
	 %>
<br>
<img src='../images/dotdb.gif' width='10' height='10'> 
            <font color='#000000'>共计 <%=rs.recordcount%>条记录</font><br><br>
<table border=1 bordercolor=#3770A9 bordercolordark=#ffffff cellpadding=3 cellspacing=0 width=88% class='size09' align='center'>
<tr><td class='color01' bgcolor='#efefef' colspan="10" align="center"><b>用户帐户状况</b></td></tr>
<tr><td class='color01' bgcolor='#efefef'>序号</td><td class='color01' bgcolor='#efefef'>用户名</td><td class='color01' bgcolor='#efefef'>余额</td><td class='color01' bgcolor='#efefef'>冻结金额</td><td class='color01' bgcolor='#efefef'>借款金额</td></tr>
	<% 
i=1
do while not rs.eof %> 	   
<tr><td><%=i+(pagecount-1)*pagesize%></td><td><a href="../userself/funddetail.asp?username=<%=rs("username")%>"><%=rs("username")%></a></td><td><%=rs("balance")%></td><td><%=rs("freeze")%></td><td><%=rs("debit")%></td></tr>
<% i=i+1                                                                                                  
          rs.movenext                                                                                                  
          if i>rs.PageSize then exit do 
		  loop                                                                    
           %> 
<%	 
end sub 


%>

<!--#include file="../inc/bottom2.asp"-->

⌨️ 快捷键说明

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