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

📄 popaymentcheck.asp

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

dim conn
dim rs 
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring

if request("statusindex")<>"" then
	transactid=split(request("collectionstatus"&request("statusindex")),",")
	sql="select * from materialtransaction where popaymentid="&request("statusindex")
	set rsq=conn.execute(sql)
	do while not rsq.eof
		
		bexisted=false
		for k=0 to ubound(transactid)
			temptransactid=cint(transactid(k))
			if cint(rsq("transactid"))=temptransactid then bexisted=true
		next
		
		if bexisted and rsq("collectionstatus")="未付" then
			sql="update materialtransaction set collectionstatus='已付',collectionverifydate='"&date()&"' where transactid="&rsq("transactid")
			conn.execute(sql)
		end if
		
		if bexisted=false and rsq("collectionstatus")="已付" then
			sql="update materialtransaction set collectionstatus='未付',collectionverifydate=null where transactid="&rsq("transactid")
			conn.execute(sql)
		end if
	rsq.movenext
	loop
	sql="select collectionstatus from materialtransaction where collectionstatus='未付' and popaymentid="&request("statusindex")
	set rsq=conn.execute(sql)

	if rsq.eof then 
		conn.execute("update popayment set paymentstatus='已销',verifpaymentdate='"&date()&"' where paymentid="&request("statusindex"))
	else
		conn.execute("update popayment set paymentstatus='未销',verifpaymentdate=null where paymentid="&request("statusindex"))
	end if
end if

if request.Form("fromdate")<>"" then fromdate=request.Form("fromdate")
if request.Form("todate")<>"" then todate=request.Form("todate")

if request.querystring("accountid")<>"" then
	strwhere =" and accountid="&request.querystring("accountid")
	straccount=request.querystring("accountid")
	straccountname=getfieldvalue("account","accountid",request.querystring("accountid"),"account")
end if
if request.Form("account")<>"" then
	strwhere =" and accountid="&request.Form("account")
	straccount=request.Form("account")
	straccountname=getfieldvalue("account","accountid",request.Form("account"),"account")
end if
if request.form("status")="" or request.form("status")="未销" then
	strwhere=strwhere&" and status='未销'"
elseif request.form("status")="已销" then
	strwhere=strwhere&" and status='已销'"
elseif request.form("status")="全部" then
	strwhere=strwhere&" and status like '%%'"
end if

if fromdate<>"" then
	strwhere=strwhere&" and createdate>='"&fromdate&"' "
end if
if todate<>"" then
	strwhere=strwhere&" and createdate<='"&todate&"' "
end if

sql="select * from v_popaymentcheck_all where sysaccountid="&sysid&" "&strwhere&" order by createdate"
'response.Write(sql)
rs.Open sql,conn,1,1
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>收款</title>
</head>
<script language=javascript>
function showit(objname,imgn){
		if (eval(objname+'.style.display=="block"') == true)
		{
			eval(objname+'.style.display="none";');
			eval('IMG'+objname+'.style.display="block";');			
			eval('IMG1'+objname+'.style.display="none";');			
			//alert('IMG'+objname+'.src = "../images/button2.gif";');
			//eval('IMG'+objname+'.src = "../images/button2.gif";');
		}
		else
		{
			eval(objname+'.style.display="block";');
			eval('IMG'+objname+'.style.display="none";');			
			eval('IMG1'+objname+'.style.display="block";');			
			//alert('IMG'+objname+'.src = "../images/button1.gif";');
			//eval('IMG'+objname+'.src = "../images/button1.gif";');
		}
}
</script>
<script language=javascript src="../tools/newcalendar.js"></script>
<body leftmargin="10" rightmargin="0" topmargin="10">
<form name="form1" method="post" action="">
<input type=hidden name=status>
  <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="150" >从 
        <input type="text" name="fromdate" size="9" language=javascript id="dupdatetimefrom" value="<%=fromdate%>" readonly>
        <% call AddImg("datefrom")%>
        - </td>
      <td width="400" nowrap> 
        <div id=strvalue1 <%if request("strfield")<>"username" or request("strfield")=""  then response.write "style=display:block" else response.write "style=display:none" end if%>> 
          <input type="text" name="todate" size="9" language=javascript id="dupdatetimeto" value="<%=todate%>" readonly>
          <% call AddImg("dateto")%>
          <input type = hidden name=clicksource>
          <input type = hidden name=clickresult >
          客户
<input name="account" type="hidden" size="8" value="<%=straccount%>">
          <input name="accountname" type="text" size="25" value="<%=straccountname%>" readonly>
          <input type="button" name="bnaccount" onClick="JavaScript:opensubwin2('form1','account')"    value=...  class=black>
        </div></td>
      <td>
<input name="image" type=image style="cursor:hand" src="../images/button_submit.gif" border=0>
      </td>
    </tr>
    <tr> 
      <td height="25" colspan=3><strong><font class=title>应付对帐</font></strong> 
        &nbsp;&nbsp;
        <a style="cursor:hand" onclick="form1.status.value='全部';form1.submit();">
			<%if request.form("status")="全部" then%><font color=red><%else%><font color=#0070bc><%end if%>
			全部业务
			</font>
        </a>
         <a style="cursor:hand" onclick="form1.status.value='未销';form1.submit()">
			<%if request.form("status")="未销" or request.form("status")="" then%><font color=red><%else%><font color=#0070bc><%end if%>
			未销业务
			</font>
		</a> 
        <a style="cursor:hand" onclick="form1.status.value='已销';form1.submit()">
        <%if request.form("status")="已销" then%><font color=red><%else%><font color=#0070bc><%end if%>
		已销业务
		</font>
		</a></td>
    </tr>
    <tr > 
      <td height="16" colspan="3" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr> 
      <td height=4 colspan=3></td>
    </tr>
  </table>
  <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="DECFAD">
    <tr bgcolor="efefef"> 
      <td width="10%" height=15 align=center>发生日期</td>
      <td width="10%" height=15 align=center>应结日期</td>
      <td width="10%" height="15" align=center>凭证编号</td>
      <td height="15" align=center>摘要</td>
      <td width="10%" height="15" align=center>应付增加</td>
      <td width="10%" height="15" align=center>应付减少</td>
      <td width="10%" height="15" align=center>应付余额</td>
      <td width="10%" height="15" align=center>销账</td>
      <td width="10%" height="15" align=center>销账日期</td>
  </tr>
  <%
  sql="select sum(paymentincrease) as allpaymentincrease,sum(paymentdecrease) as allpaymentdecrease from v_popaymentcheck_all where sysaccountid="&sysid&" and accountid="&straccount&" and createdate<'"&fromdate&"'"
  set rsq=conn.execute(sql)
  if isnull(rsq("allpaymentincrease")) then a=0 else a=csng(rsq("allpaymentincrease"))
  if isnull(rsq("allpaymentdecrease")) then b=0 else b=csng(rsq("allpaymentdecrease"))
  x=a-b
  'x=csng(rsq("allpaymentincrease"))-csng(rsq("allpaymentdecrease"))
  %>
    <tr bgcolor="#FFFFFF"> 
    <td align=center></td>
	<td align=center height=18></td>
    <td align=center></td>
    <td align=center>此前余额</td>
    <td align=center></td>
    <td align=center></td>
    <td align=center><%=x%></td>
    <td align=center></td>
    <td align=center></td>
  </tr>

  <%
  do while not rs.EOF
  if rs("documenttype")="popay" then
	x=x-csng(rs("paymentdecrease"))
  else
	x=x+csng(rs("paymentincrease"))
  end if
  %>
    <tr bgcolor="#FFFFFF"> 
    <td align=center><%=rs("createdate")%></td>
	<td align=center height=18><%=rs("closedate")%></td>
    <td align=center><%=rs("documentno")%></td>
    <td align=center>
        <%if rs("type")="应付帐款" then%>
         <table width=100%>
          <tr id="IMGtr1<%=i%>" style="display:block"> 
            <td width=90% align=center><a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 40, top=40, menubar=no, location=no, toolbar=no ,width=750, height=500','../po/poreceivedetail.asp?poreceiveid=<%=rs("poreceiveid")%>');" title="查看收货单"><%=rs("type")%><%if csng(rs("paymentincrease"))<0 then response.write "(<font color=red>退货</font>)" else response.write "(收货)"%></a></td>
            <td width=10% align=right><a href="javascript:showit('tr1<%=i%>',1)" title="查看收货明细"><img src="../images/button1.gif" border=0></a> 
            <td></tr>
          <tr id="IMG1tr1<%=i%>" style="display:none"> 
            <td width=90% align=center><a href="javascript:opensubwin('resizable=yes, scrollbars=yes, left= 40, top=40, menubar=no, location=no, toolbar=no ,width=750, height=500','../po/poreceivedetail.asp?poreceiveid=<%=rs("poreceiveid")%>');" title="查看收货单"><%=rs("type")%><%if csng(rs("paymentincrease"))<0 then response.write "(<font color=red>退货</font>)" else response.write "(收货)"%></a></td>
            <td width=10% align=right><a href="javascript:showit('tr1<%=i%>',1)" title="隐藏收货明细"><img src="../images/button2.gif" border=0></a></td>
          </tr>
        </table>
    <%else%>
		<%=rs("type")%>
    <%end if%>
    </td>
      <td align=center> 
        <div align="right">
          <%if rs("paymentincrease")<>"" then response.write formatnumber(rs("paymentincrease"),2)%>
        </div></td>
      <td align=center> 
        <div align="right">
          <%if rs("paymentdecrease")<>"" then response.write formatnumber(rs("paymentdecrease"),2)%>
        </div></td>
      <td align=center> 
        <div align="right"><%=formatnumber(x,2)%></div></td>
    <td align=center><%=rs("status")%>
    <%if rs("status")="已销" then%>
		<a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200','../tools/setstatus.asp?documenttype=<%=rs("documenttype")%>&id=<%=rs("id")%>&status=<%=rs("status")%>');">(<font color=red>撤销</font>)</a>
    <%else%>
		<a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200','../tools/setstatus.asp?documenttype=<%=rs("documenttype")%>&id=<%=rs("id")%>&status=<%=rs("status")%>');">(销账)</a>
	<%end if%>
    </td>
    <td align=center><%=rs("verifdate")%></td>
  </tr>
  
      <%if rs("type")="应付帐款" then%> 
   <tr bgcolor="#FFFFFF" border=0  id='tr1<%=i%>' style=display:none> 
      <td colspan=10> 
        <%
		set rsdeliverline=conn.execute("select * from v_MaterialTransaction where (popaymentid="&rs("id")&")")
		%>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="ffffff">
          <tr> 
            <td width="5%" height="15" align=center bgcolor="DEDFDE">序号</td>
            <td width="15%" height=15 align=center bgcolor="DEDFDE">货号</td>
            <td height="15" align=center bgcolor="DEDFDE">型号</td>
            <td width="5%" height="15" align=center bgcolor="DEDFDE">数量</td>
            <td width="8%" height="15" align=center bgcolor="DEDFDE">收货成本</td>
            <td width="8%" height="15" align=center bgcolor="DEDFDE">调准成本</td>
            <td width="10%" height="15" align=center bgcolor="DEDFDE">收货金额</td>
            <td width="10%" align=center bgcolor="DEDFDE">应付金额</td>
            <td width="5%" height="15" align=center bgcolor="DEDFDE">备注</td>
            <td width="8%" height="15" align=center bgcolor="DEDFDE">付款日期</td>
            <td width="8%" height="15" align=center bgcolor="DEDFDE">付款状态</td>
          </tr>
          <%j=1
			do while not rsdeliverline.EOF
			%>
          <tr> 
            <td align=center bgcolor="efefef"><%=j%></td>
            <td height=18 align=center bgcolor="efefef"><%=rsdeliverline("productcode")%></td>
            <td align=center bgcolor="efefef"><%=rsdeliverline("model")%></td>
            <td align=center bgcolor="efefef"><%=rsdeliverline("qty")%></td>
            <td align=center bgcolor="efefef"><%if rsdeliverline("cost")<>"" then response.Write formatnumber(rsdeliverline("cost"),2)%></td>
            <td align=center bgcolor="efefef"><a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200','../tools/SetMaterialTransaction.asp?transactid=<%=rsdeliverline("transactid")%>&fieldname=adjustcost');" title="调准收货成本"><%=formatnumber(rsdeliverline("adjustcost"),2)%></a></td>
            <td align=center bgcolor="efefef"><%if rsdeliverline("qty")<>"" and rsdeliverline("cost")<>"" then response.write formatnumber(csng(rsdeliverline("qty"))*csng(rsdeliverline("cost")),2)%></td>
            <td align=center bgcolor="efefef"><a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200','../tools/SetMaterialTransaction.asp?transactid=<%=rsdeliverline("transactid")%>&orderpaymentid=<%=rsdeliverline("orderpaymentid")%>&fieldname=receiveamount');" title="调准应付金额"><%if rsdeliverline("receiveamount")<>"" then response.write formatnumber(rsdeliverline("receiveamount"),2)%></a></td>
            <td align=center bgcolor="efefef"><a href="javascript:opensubwin('resizable=no, scrollbars=no, left= 300, top=220, menubar=no, location=no, toolbar=no ,width=300, height=200','../tools/SetMaterialTransaction.asp?transactid=<%=rsdeliverline("transactid")%>&fieldname=description');" title="查看/修改备注">备注</a></td>
            <td align=center bgcolor="efefef"><%=rsdeliverline("collectionverifydate")%></td>
            <td align=center bgcolor="efefef">
            <%if rsdeliverline("collectionstatus")="已付" then%>
            <input type=checkbox name="collectionstatus<%=rs("id")%>" value=<%=rsdeliverline("transactid")%> checked>
            <%else%>
            <input type=checkbox name="collectionstatus<%=rs("id")%>" value=<%=rsdeliverline("transactid")%>>
            <%end if%>
            </td>
          </tr>
          <%
		j=j+1
		rsdeliverline.MoveNext
		loop
  
		rsdeliverline.Close
		set rsdeliverline=nothing
		%>
        <tr><td colspan=10></td><td align=center><a href="javascript:form1.statusindex.value=<%=rs("id")%>;form1.submit();" title="保存付款状态">保存</a></td></tr>
        </table></td>
    </tr>
   <%end if%> 
  
  <%
  i=i+1
  rs.MoveNext
  loop
%>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="50">
      <td>&nbsp;</td>
    </tr></table>
<%
  rs.Close
  set rs=nothing
  conn.Close 
  set conn=nothing
%>
<input type=hidden name=statusindex>
</form>
</body>
</html>

⌨️ 快捷键说明

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