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

📄 reports_jd.asp

📁 财务预算管理 财务支出
💻 ASP
字号:
<%@language=vbscript codepage=936 %>
<%
Option Explicit
%>
<!--#include file="sysconfig.asp"-->
<!--#include file="Inc/Function_1.asp"-->
<%
dim id,sql,sql_jh,sql_detail,sql_detail1,sqlguikou,rs,rsguikou,rs_jh,rs_detail,rs_detail1,guikou_id,totalput,sum_y,sum_j,sum_r
dim count_sum_y,count_sum_j,count_sum_r
dim r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,updatetime_r
guikou_id=Trim(request("guikou_id"))
totalput=0
dim strFileName
strFileName="reports_jd.asp?guikou_id=" & guikou_id
sql="select * from danwei where cost_delete=0"
if guikou_id<>"" then
	sql=sql & " and guikou_id='" & guikou_id & "'"
end if
sql=sql & " order by id "
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
totalPut=rs.recordcount
%>
<!-- #include file="Inc/Head.asp" -->
<table cellpadding="2" cellspacing="1" border="0" align="center" class="a2">
  <tr>
		
    <td width="1000" height="25" align="center" class="a1"><strong>报 表 管 理 </strong></td>
	</tr>
	<tr class="a4">
		
    <td align="center"> 
      <table width="100%" border="0" align="center" cellpadding="5" cellspacing="2" class="border">
        <tr class="title"> 
          <td height="25" bgcolor="#C0C0C0" class="t1"><a href="reports_jd.asp">所有单位</a> 
            |&nbsp; 
            <%
'分类选择
sqlguikou="select * from guikou where cost_delete=0"
Set rsguikou= Server.CreateObject("ADODB.Recordset")
rsguikou.open sqlguikou,conn,1,1
if rsguikou.eof then 
	response.Write("还没有任何归口,请首先添加归口。")
end if
do while not rsguikou.eof
	if rsguikou("id")=guikou_id then
		response.Write("<a href='reports_jd.asp?guikou_id=" & rsguikou("id") & "'><font color='#FF0000'>" & rsguikou("guikou_name") & "</font></a> | ")
		else
		response.Write("<a href='reports_jd.asp?guikou_id=" & rsguikou("id") & "'>" & rsguikou("guikou_name") & "</a> | ")
	end if
	rsguikou.movenext
loop
rsguikou.close
set rsguikou=nothing
%>
          </td>
        </tr>
</table>
 <table width="100%" border="0" cellpadding="0" cellspacing="2">
          <tr> 
            
          <td height="25" bgcolor="#CCCCCC" class="t1"><a href="reports_jd.asp">&nbsp;所有单位</a> 
            &gt;&gt; 
            <%
	if guikou_id<>"" then
			set rsguikou=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
			response.write "<a href='reports_jd.asp?guikou_id=" & guikou_id & "'>" &rsguikou("guikou_name")& "</a>&nbsp;&nbsp;"
			else
				response.write "所有单位"
	end if
%>
            </td>
            
          <td width="150" bgcolor="#CCCCCC" class="t1">&nbsp; 
            <%
  	if rs.eof and rs.bof then
		response.write "共有 0 个单位</td></tr></table>"
	else
   	response.Write "共找到 " & totalPut & " 个单位"
%>
            </td>
          </tr>
        </table>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" class="border">
		<tr bgcolor="#C0C0C0" class="title"> 
          <td height="25" colspan="5" align="center" bgcolor="#C0C0C0" class="t1" ><strong>荆州市政府采购预算分月执行进度表 
            <input   type="hidden"   name="out_word3"   onclick="vbscript:buildDoc"   value="导出到word"   class="notPrint">
            <input   type="hidden"   name="out_excel2"   onclick="AutomateExcel();"   value="导出到excel"   class="notPrint">
            <input   name="out_excel12"   type="button"   class="notPrint" id="out_excel12"   onclick="javascript:AutomateExcel()   "   value="打印到excel">
            <input   type="button"   name="out_word22"   onclick="vbscript:buildDoc"   value="打印到word"   class="notPrint">
            </strong></td>
        </tr>    
      </table>  
      <table width="100%" border="0" cellpadding="0" cellspacing="2" class="border" id="reports" >
        <tr bgcolor="#C0C0C0" class="t1"> 
          <td width="10%" height="24" align="center" bgcolor="#C0C0C0" ><strong>单位名称</strong></td>
          <td width="10%" align="center" bgcolor="#C0C0C0" ><strong>年初采购<br>
            预算</strong></td>
          <td width="10%" align="center" bgcolor="#C0C0C0" ><strong>申报采购<br>
            计划金额</strong></td>
          <td width="5%" align="center" bgcolor="#C0C0C0" ><strong>元月</strong></td>
          <td width="5%" align="center" bgcolor="#C0C0C0" ><strong>二月</strong></td>
          <td width="5%" align="center" bgcolor="#C0C0C0" ><strong>三月</strong></td>
          <td width="5%" align="center" ><strong>四月</strong></td>
          <td width="5%" align="center" ><strong>五月</strong></td>
          <td width="5%" align="center" ><strong>六月</strong></td>
          <td width="5%" align="center" ><strong>七月</strong></td>
          <td width="5%" align="center" ><strong>八月</strong></td>
          <td width="5%" align="center" ><strong>九月</strong></td>
          <td width="5%" align="center" ><strong>十月</strong></td>
          <td width="5%" align="center" ><strong>十一月</strong></td>
          <td width="5%" align="center" ><strong>十二月</strong></td>
          <td width="10%" align="center" ><strong>政府采购<br>
            预算余额</strong></td>
        </tr>
        <%
		 count_sum_y=0
		  count_sum_j=0
		  count_sum_r=0
		  do while not rs.eof%>
        <% sum_y=0
		  id=rs("id")
		  sql_jh="select * from cost_jh where cost_delete=0 and danwei_id="&id 
		  Set rs_jh= Server.CreateObject("ADODB.Recordset")
          rs_jh.open sql_jh,conn,1,1
          if not(rs_jh.bof and rs_jh.eof) then
             do while not rs_jh.eof
             sum_y=sum_y+rs_jh("cost_number")
             rs_jh.movenext
             loop
          else
          end if
          rs_jh.close
          set rs_jh=nothing
  	    r1=0
		r2=0
		r3=0
		r4=0
		r5=0
		r6=0
		r7=0
		r8=0
		r9=0
		r10=0
		r11=0
		r12=0
		sum_j=0
	     sum_r=0

		  sql_detail="select * from cost_detail where cost_delete=0 and danwei_id="&id 
		  Set rs_detail= Server.CreateObject("ADODB.Recordset")
          rs_detail.open sql_detail,conn,1,1
          if not(rs_detail.bof and rs_detail.eof) then
             do while not rs_detail.eof
			 updatetime_r=rs_detail("updatetime_r")
             sum_j=sum_j+rs_detail("cost_number_j")
	         sum_r=sum_r+rs_detail("cost_number_r")
 		if month(updatetime_r)=1 then
			 r1=r1+rs_detail("cost_number_r")
		 else
			if month(updatetime_r)=2 then
			 r2=r2+rs_detail("cost_number_r")
		 else
			if month(updatetime_r)=3 then
			 r3=r3+rs_detail("cost_number_r")
		else
	if month(updatetime_r)=4 then
			 r4=r4+rs_detail("cost_number_r")
		else
	if month(updatetime_r)=5 then
			 r5=r5+rs_detail("cost_number_r")
		else
	if month(updatetime_r)=6 then
			 r6=r6+rs_detail("cost_number_r")
			 else
	if month(updatetime_r)=7 then
			 r7=r7+rs_detail("cost_number_r")
			 else
	if month(updatetime_r)=8 then
			 r8=r8+rs_detail("cost_number_r")
			 else
	if month(updatetime_r)=9 then
			 r9=r9+rs_detail("cost_number_r")
			 else 
	if month(updatetime_r)=10 then
			 r10=r10+rs_detail("cost_number_r")
			 else
	if month(updatetime_r)=11 then
			 r11=r11+rs_detail("cost_number_r")
			 else
	if month(updatetime_r)=12 then
			 r12=r12+rs_detail("cost_number_r")
			 else
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
			 end if
             rs_detail.movenext
             loop
          else
          end if
          rs_detail.close
          set rs_detail=nothing
          %>
		  
        <tr class="t1"> 
          <td width="10%" height="22" align="center" bgcolor="#E3E3E3"><%=rs("danwei_name")%> </td>
          <td width="10%" align="center" bgcolor="#E3E3E3"> <%=(sum_y/10000)%>万</td>
          <td width="10%" align="center" bgcolor="#E3E3E3"> <%=(sum_j/10000)%>万 </td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r1/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r2/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r3/10000%><%'select * from cost_detail where updatetime_r>='2008-3-1' and updatetime_r<='2008-3-31' %></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r4/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r5/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r6/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r7/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r8/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r9/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r10/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r11/10000%></td>
          <td width="5%" align="center" bgcolor="#E3E3E3"><%=r12/10000%></td>
          <td width="10%" align="center" bgcolor="#E3E3E3"><%=(sum_y-sum_j)/10000%>万</td>
        </tr>
        <%
		  count_sum_y=count_sum_y+sum_y
		  count_sum_j=count_sum_j+sum_j
		  count_sum_r=count_sum_r+sum_r
		   rs.movenext
	     loop
       %>
        <tr bgcolor="#E3E3E3" class="t1"> 
          <td width="10%"> 
            <div align="center"><strong>合计</strong></div></td>
          <td width="10%"> 
            <div align="center"><strong><%=count_sum_y/10000%>万</strong></div></td>
          <td width="10%" bgcolor="#E3E3E3"> <div align="center"><strong><%=count_sum_j/10000%>万</strong></div></td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%"> 
            <div align="center"></div></td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="5%">&nbsp;</td>
          <td width="10%"><div align="center"><strong><%=(count_sum_y-count_sum_j)/10000%>万</strong></div></td>
        </tr>
        <tr bgcolor="#E3E3E3" class="t1" > 
          <td width="10%" height="25" align="center" >内容: </td>
          <td width="10%" height="25" align="center" >
            <%if guikou_id<>"" then
			set rsguikou=conn.execute("select * from guikou where cost_delete=0 and id="&guikou_id&"")
			response.write rsguikou("guikou_name")
			else
				response.write "所有单位"
			end if
			%>
          </td>
          <td width="10%" height="25" align="center" >制表人:<%=Session("username")%></td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" height="25" align="center" >&nbsp;</td>
          <td width="5%" height="25" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="5%" align="center" >&nbsp;</td>
          <td width="10%" align="center" >时间<%=month(now())%>月<%=day(now())%>日</td>
        </tr>
      </table>
        <%
   end if 
%>
      <br>
      <BR>
		</td>
	</tr>

</table>
<!--#include file="print.asp"-->
<BR>
<%
call htmlend
rs.close
set rs=nothing  
call CloseConn()
%>

⌨️ 快捷键说明

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