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

📄 expenseprintresult.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 "expense","read"
set objcheck=nothing

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
rs.Open "select * from v_expense where expenseid="&request("expenseid"),conn,1,1
if rs.EOF then
	Response.Write "记录不存在"
	Response.End 
end if

'取公司信息
dim rsco
set rsco=conn.Execute("select * from company")
'取打印参数
dim rspara
set rspara=conn.Execute("select * from printsetup where type='打印报价单'")
if rspara.EOF then
	Response.Write "打印参数未找到,请检查系统设置 -> 打印参数设置"
	Response.End 
end if

%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>打印<%=rs("expenseno")%></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%" border="0" cellpadding="1" cellspacing="0">
  <tr valign="bottom"> 
    <td>&nbsp;</td>
    <td colspan="4"><div align="center"><font color="#000000" size="4"><font face="黑体" size=3><%=rsco("company")%></font><br>
        <u><%=rs("subject")%>单</u><br>
        <br>
        </font></div></td>
    <td align="right"><font size=4>□</font>&nbsp;&nbsp;已支付</td>
  </tr>
  <tr valign="bottom"> 
    <td width="6%" align="right">部门</td>
    <td width="20%">&nbsp;&nbsp;<%=rs("department")%></td>
    <td width="6%" align="right">报销日期</td>
    <td width="20%">&nbsp;&nbsp;<%=year(rs("lastmoddate"))%>-<%=month(rs("lastmoddate"))%>-<%=day(rs("lastmoddate"))%></td>
    <td align="right">&nbsp;</td>
    <td  align="right"> 
      <%
	if request.QueryString("thepage")="" then
		response.Write "第1页"
	else
		response.Write "第"&request.QueryString("thepage")&"页"
	end if
	%>
      / 
      <%
	if request.QueryString("thepage")="" then
		response.Write "共1页"
	else
		response.Write "共"&request.QueryString("totalpages")&"页"
	end if
	%>
    </td>
  </tr>
  <tr valign="bottom"> 
    <td width="6%" valign="middle"> <div align="right"><font color="#000000">编号</font></div></td>
    <td width="20%">&nbsp;&nbsp;<font color="#000000"><%=rs("expenseno")%></font></td>
    <td width="6%"> <div align="right">报&nbsp;销&nbsp;人</div></td>
    <td width="20%">&nbsp;&nbsp;<%=rs("username")%></td>
    <td align="right">&nbsp;</td>
    <td width="16%" align="right">打印日期&nbsp;&nbsp;<font color="#000000"><%=date()%></font></td>
  </tr>
</table>
<%
dim connexpenseline
dim rsexpenseline
set connexpenseline=server.CreateObject("adodb.connection")
set rsexpenseline=server.CreateObject("adodb.recordset")
connexpenseline.Open connstring
rsexpenseline.Open "select * from v_expenseline where (expenseid='"&request("expenseid")&"') order by lineid",connexpenseline,1,1
%>

<!-- 
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
	<tr>	
    <td><font color="#000000">商品或服务明细</font></td>
  </tr>
</table>
-->

<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333" bgcolor="#333333">
  <tr bgcolor="#FFFFFF"> 
    <td width="6%" height="20" align=center><font color="#000000">序号</font></td>
    <td width="14%" align=center><font color="#000000">费用类型</font></td>
    <td width="40%" align=center><font color="#000000">备注</font></td>
    <td width="8%" align=center><font color="#000000">金额</font></td>
    <td width="22%" align=center><font color="#000000">科目</font></td>
    <td width="10%" align=center><font color="#000000">单据张数</font></td>
  </tr>
  <tr bgcolor=white>
    <%i=1
  if rsexpenseline.RecordCount>0 then
  	response.Write "<td align=center valign=top>"
 
	if Request.QueryString("thepage")="" then
		do while not rsexpenseline.EOF
			response.write i&"<br>"
			i=i+1
			rsexpenseline.MoveNext
		loop
	elseif Request.QueryString("thepage")<>Request.QueryString("totalpages") then
		for x=(Request.QueryString("thepage")-1)*rspara("line")+1 to (Request.QueryString("thepage")-1)*rspara("line")+rspara("line")
			Response.Write x&"<br>"
		next
	else
		for x=(Request.QueryString("thepage")-1)*rspara("line")+1 to rsexpenseline.RecordCount
			Response.Write x&"<br>"
		next
	end if
	
	if Request.QueryString("thepage")="" then		
		if i<rspara("line") then
			for x=1 to rspara("line")-i
				Response.Write "<br>"
			next
		end if
	elseif Request.QueryString("totalpages")=Request.QueryString("thepage") then
			if rsexpenseline.RecordCount mod rspara("line")<>0 then
				for x=1 to rspara("line")-(rsexpenseline.RecordCount mod rspara("line"))
					Response.Write "<br>"
				next
			end if
	end if
	 response.Write "</td>"
 end if
 %>
 <%
  if rsexpenseline.RecordCount>0 then
	response.Write "<td align=center valign=top>"
	if Request.QueryString("thepage")="" then
		rsexpenseline.movefirst
		do while not rsexpenseline.EOF
			response.write rsexpenseline("expensetype")&"<br>"
			rsexpenseline.MoveNext
		loop
	else
		rsexpenseline.movefirst
		k=(Request.QueryString("thepage")-1)*rspara("line")
		rsexpenseline.Move k
		do while not rsexpenseline.EOF
			if k<=Request.QueryString("thepage")*rspara("line")-1 then
				Response.write rsexpenseline("expensetype")&"<br>"
			end if
			rsexpenseline.MoveNext
			k=k+1
		loop
	end if	
	response.Write "</td>"
 end if
 %>
 <%
  if rsexpenseline.RecordCount>0 then
	response.Write "<td align=center valign=top>"
	if Request.QueryString("thepage")="" then
		rsexpenseline.movefirst
		do while not rsexpenseline.EOF
			response.write rsexpenseline("account")&"&nbsp;"&rsexpenseline("contact")&"&nbsp;"&rsexpenseline("description")&"<br>"
			rsexpenseline.MoveNext
		loop
	else
		rsexpenseline.movefirst
		k=(Request.QueryString("thepage")-1)*rspara("line")
		rsexpenseline.Move k
		do while not rsexpenseline.EOF
			if k<=Request.QueryString("thepage")*rspara("line")-1 then
				Response.write rsexpenseline("account")&"&nbsp;"&rsexpenseline("contact")&"&nbsp;"&rsexpenseline("description")&"<br>"
			end if
			rsexpenseline.MoveNext
			k=k+1
		loop
	end if	
	response.Write "</td>"
 end if
 %>
 <%
  if rsexpenseline.RecordCount>0 then
	response.Write "<td align=center valign=top>"
	if Request.QueryString("thepage")="" then
		rsexpenseline.movefirst
		do while not rsexpenseline.EOF
			response.write formatnumber(rsexpenseline("amount"),2)&"<br>"
			rsexpenseline.MoveNext
		loop
	else
		rsexpenseline.movefirst
		k=(Request.QueryString("thepage")-1)*rspara("line")
		rsexpenseline.Move k
		do while not rsexpenseline.EOF
			if k<=Request.QueryString("thepage")*rspara("line")-1 then
				Response.write formatnumber(rsexpenseline("amount"),2)&"<br>"
			end if
			rsexpenseline.MoveNext
			k=k+1
		loop
	end if	
	response.Write "</td>"
 end if
 %>
 <%
  if rsexpenseline.RecordCount>0 then
	response.Write "<td align=center valign=top>"
	if Request.QueryString("thepage")="" then
		rsexpenseline.movefirst
		do while not rsexpenseline.EOF
			response.write "<br>"
			rsexpenseline.MoveNext
		loop
	else
		rsexpenseline.movefirst
		k=(Request.QueryString("thepage")-1)*rspara("line")
		rsexpenseline.Move k
		do while not rsexpenseline.EOF
			if k<=Request.QueryString("thepage")*rspara("line")-1 then
				Response.write "<br>"
			end if
			rsexpenseline.MoveNext
			k=k+1
		loop
	end if	
	response.Write "</td>"
 end if
 %>
 <%
  if rsexpenseline.RecordCount>0 then
	response.Write "<td align=center valign=top>"
	if Request.QueryString("thepage")="" then
		rsexpenseline.movefirst
		do while not rsexpenseline.EOF
			response.write "<img src=../images/blank.jpg>"&"<br>"
			rsexpenseline.MoveNext
		loop
	else
		rsexpenseline.movefirst
		k=(Request.QueryString("thepage")-1)*rspara("line")
		rsexpenseline.Move k
		do while not rsexpenseline.EOF
			if k<=Request.QueryString("thepage")*rspara("line")-1 then
			response.write "<img src=../images/blank.jpg>"&"<br>"
			end if
			rsexpenseline.MoveNext
			k=k+1
		loop
	end if	
	response.Write "</td>"
 end if
 %>
  </tr>
  <%
  rsexpenseline.Close
  set rsexpenseline=nothing
  connexpenseline.Close 
  set connexpenseline=nothing
  %>

  <%if Request.QueryString("thepage")="" or (Request.QueryString("thepage")<>"" and Request.QueryString("thepage")=Request.QueryString("totalpages")) then%>
  <tr bgcolor="#FFFFFF"> 
    <td width=60% height=20 bgcolor="#FFFFFF" colspan=3> 
      <div align="right"><font color="#000000">合计小写(<%=rs("currencyname")%>)&nbsp;&nbsp;</font></div></td>
    <td width=40% height=20 bgcolor="#FFFFFF" colspan=3><font color="#000000"><%=rs("totalamount")%></font> 
      <div align="center"></div></td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td width=60% height=20 bgcolor="#FFFFFF" colspan=3> 
      <div align="right"><font color="#000000">合计大写(<%=rs("currencyname")%>)&nbsp;&nbsp;</font></div></td>
    <td width=40% height=20 bgcolor="#FFFFFF" colspan=3><font color="#000000"><%=convertcurrency(rs("totalamount"))%></font></td>
  </tr>
  <%end if%>
</table>
<br>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
  <tr> 
    <td width="20%">财会主管___________________</td>
    <td width="20%">出纳___________________</td>
    <td width="20%">部门主管___________________</td>
    <td width="20%">复核___________________</td>
    <td width="20%">领款人___________________</td>
  </tr>
</table>
<%
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
  %>
  <script language="JavaScript">window.print();</script>
</body>
</html>

⌨️ 快捷键说明

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