📄 invoicepostat.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "report","read"
set objcheck=nothing
%>
<%
sysid=checkandgetsysaccountid()
set conninvoicereport=server.createobject("adodb.connection")
conninvoicereport.open connstring
if request("statSearch")<>"" then
strstatSearch=request.form("statSearch")
else
strstatSearch="account"
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
Set rsinvoicereport=Server.CreateObject("ADODB.Recordset")
sql="SELECT "&strstatSearch&",COUNT(*) AS subnum,SUM(amount) AS subtamount FROM v_poinvoice where 1=1 "&strwhere&" and sysaccountid="&sysid
sql=sql & " GROUP BY "&strstatSearch&" ORDER BY subtamount DESC "
'response.write sql
rsinvoicereport.open sql,conninvoicereport,1,1
alls=rsinvoicereport.Recordcount
if request.form("statSearch")="CreateDate" then
dispname="每日"
elseif request.form("statSearch")="CreateMonth" then
dispname="每月"
elseif request.form("statSearch")="account" or request.form("statSearch")="" then
dispname="供应商"
elseif request.form("statSearch")="poinvoiceid" then
dispname="进项发票编号"
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=="invoice"){
link="InvoiceStat.asp";
document.location.href=link;
}
if (form1.StatType.value=="poinvoice"){
link="InvoicePOStat.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="account" <%if request("statSearch")="account" then Response.Write " selected"%>>按供应商</option>
<option value="poinvoiceid" <%if request("statSearch")="poinvoiceid" 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>
从<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")%>
<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>进项发票统计 </b></font></strong>
<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="poinvoice" <%if request("StatType")="poinvoice" then Response.Write " selected"%>>--进项发票统计--</option>
<option value="invoice" <%if request("StatType")="invoice" then Response.Write " selected"%>>--销项发票统计--</option>
</select>
</td>
</tr>
<tr >
<td height="16" colspan="2" background="../images/title.gif"> </td>
</tr>
</table>
</td>
</tr>
<tr class="linecolor"><td height="2"></td></tr>
<tr height="5px"><td></td></tr>
</tbody>
</table>
<table align="center" cellspacing=1 cellpadding=1 width="100%" border=0 bgcolor="#ffffff" style="font-size:10pt">
<tr bgcolor="#dedfde">
<td align="center" width="5%" rowspan="2">排名</td>
<td align="center" width="40%"><%=dispname%>数</td>
<td align="center" width="10%">进项发票笔数</td>
<td align="center" width="10%">占总进项金额</td>
<td align="center" width="10%">进项金额</td>
<td align="center">图示</td>
</tr>
<%
TotalAmount=0
Totalnum=0
for i=1 to alls
if rsinvoicereport.EOF then exit for
TotalAmount=TotalAmount+Ccur(rsinvoicereport("subtamount"))
Totalnum=Totalnum+cint(rsinvoicereport("subnum"))
rsinvoicereport.MoveNext
Next
rsinvoicereport.close
%>
<tr bgcolor="#efefef">
<td align="center"><%=alls%></td>
<td align="center"><%=Totalnum%></td>
<td align="center">100.00%</td>
<td align="center"><%=(formatnumber(ccur(TotalAmount),2))%></td>
<td align="left"><img src="../images/statpic.jpg" height="10" width="100" >(100%)</td>
</tr>
</table>
<%
rsinvoicereport.open sql,conninvoicereport,1,1
for i=1 to alls
if rsinvoicereport.EOF then exit for
subtamount=Ccur(rsinvoicereport("subtamount"))
if totalamount=0 then totalamount=1
%>
<table align="center" cellspacing=1 cellpadding=1 width="100%" border=0 bgcolor="#ffffff" style="font-size:10pt">
<tr bgcolor="#FFFFFF">
<td align="center" width="5%"><%=i%></td>
<td align="center" width="40%">
<%
if request("statsearch")="poinvoiceid" then
response.write getfieldvalue("v_poinvoice","poinvoiceid",cint(rsinvoicereport(""&strstatSearch&"")),"invoiceno")
else
response.write rsinvoicereport(""&strstatSearch&"")
end if
%>
</td>
<td align="center" width="10%"><% =rsinvoicereport("subnum")%></td>
<td align="center" width="10%"><% =(formatnumber((ccur((subtamount/TotalAmount)*10000)/100),2))%>%</td>
<td align="center" width="10%"><%=(formatnumber(ccur(rsinvoicereport("subtamount")),2))%></td>
<td align="left"><img src="../images/statpic.jpg" height="10" width="<% =int((subtamount/TotalAmount)*100)%>"></td>
</tr>
<%
response.write "<tr ><td height=1 colspan=6 bgcolor=#000000></td></tr>"
rsinvoicereport.MoveNext
next
%>
</table>
<br>
<div align="center" id=CharDisp <%if request("char")="" then response.write "style=display:none" else response.write "style=display:block" end if%>>
<table align="center" cellspacing=0 cellpadding=1 width="100%" border=0 bgcolor="#ffffff" style="font-size:10pt">
<tr><td></td><td WIDTH=450 align="right"><input type=button name="closechar" onClick="JavaScript:form1.char.value='';form1.submit();" value="关闭图例" class=black></td><td></td></tr>
<tr><td></td>
<td WIDTH=450>
<APPLET CODE="HanengCharts.class" ARCHIVE="HanengCharts2.jar" WIDTH=450 HEIGHT=250 VIEWASTEXT>
<PARAM NAME="ChartType" VALUE="<%=request("char")%>">
<%
rsinvoicereport.close
rsinvoicereport.open sql,conninvoicereport,1,1
for i=1 to alls
if rsinvoicereport.EOF then exit for
%>
<PARAM NAME="value_<%=i%>" VALUE="<% =rsinvoicereport("subtamount")%>">
<PARAM NAME="text_<%=i%>" VALUE="<% =rsinvoicereport(""&strstatSearch&"")%>">
<%
rsinvoicereport.MoveNext
next
%>
</APPLET>
</td><td></td>
</tr>
</table>
</div>
<%
rsinvoicereport.close
conninvoicereport.close
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -