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

📄 newpayment.asp

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

if request("id")<>"" then
	objcheck.CheckUserFunction "payment","edit"
else
	objcheck.CheckUserFunction "payment","add"
end if
set objcheck=nothing

'取参数
dim connpara
set connpara=server.CreateObject("adodb.connection")
connpara.Open connstring
set rspara=connpara.Execute("select * from parameter where type='payment'")

'编辑取记录
if request("id")<>"" then
	dim connq
	dim rsq
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from v_orderpayment where paymentid="&request("id"),connq,2,3,1
	if rsq("paymenttype")="期初应收" or rsq("paymenttype")="期初应开票" then
		response.write "<br><br><br><LINK href='../global.css' rel=stylesheet type=text/css>"
		response.Write "<div align=center>"
		response.Write "<FONT SIZE=2 class=title>"
		response.write "<img src=../images/jg.gif>"
		response.write "期初值不能修改"
		response.write "</div>"
		response.end
	end if 
	straccount=rsq("accountid")
	straccountname=getfieldvalue("[account]","accountid",rsq("accountid"),"account")
	stramount=rsq("amount")
	strpaymenttype=rsq("paymenttype")
	strPaymentDate=rsq("PaymentDate")
	strdescription=rsq("description")
	strdeliveryamount=rsq("deliveryamount")
	strinvoiceamount=rsq("invoiceamount")
	strinvoicedate=rsq("invoicedate")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else
	strpaymentdate=date()
	straccount=-1
	strinvoicedate=date()
end if

if request("amount")<>"" then
	Dim objpayment
	Set objpayment=Server.CreateObject("SmartSales.Payment")
	objpayment.SavePayment
	set objpayment=nothing
%>
<script language=javascript>
	window.opener.location.reload();
	window.close();
</script>
<%
end if
%>
<HTML><HEAD><TITLE>
<%if request("id")="" then%>
新建应收帐
<%else%>
编辑应收帐
<%end if%>
</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<!--#include file="../calendar/style.asp"-->
<script language=javascript src="../tools/calendar.js"></script>
<script language=javascript src="../tools/newcalendar.js"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<script language="javascript">
function save(){
	if (form1.account.value==-1&&form1.bpayment.value==0){
		alert('请选择客户');
		form1.account.focus();
		return;
	}
	/*if (form1.bpayment.value==1){
		if (form1.amount.value!=form1.deliveryamount.value){
			if (form1.description.value==''){
				alert('应收金额和发货金额不相等,请输入描述');
				form1.description.focus();
				return;
			}
		}
		if (form1.invoiceamount.value!=form1.deliveryamount.value){
			if (form1.description.value==''){
				alert('开票金额和发货金额不相等,请输入描述');
				form1.description.focus();
				return;
			}
		}
	}
	*/
	if (form1.amount.value==''){
		alert('请输入金额');
		form1.amount.focus();
		return;
	}
	if (isNaN(form1.amount.value)){
		alert('请输入数字');
		form1.amount.focus();
		return;
	}
		if (form1.invoiceamount.value==''){
		alert('请输入金额');
		form1.invoiceamount.focus();
		return;
	}
	if (isNaN(form1.invoiceamount.value)){
		alert('请输入数字');
		form1.invoiceamount.focus();
		return;
	}
	
	
form1.submit();
}
</script>
 <form name=form1  method="post"  id=form1>
       <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
   <tr> 
    <td height="25"><strong><font size="2" class=title><b><%if request("id")="" then%>新建应收帐<%else%>编辑应收帐<%end if%></b></font></strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
 </table>
  <table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE"> <div align="center">客户</div></td>
      <td width="40%" nowrap bgcolor="efefef"> 
        <%if request("id")<>"" and strpaymenttype="应收帐款" then%>
        <input name="account" type="hidden" size="8" value="<%=straccount%>"> <input name="bpayment" type="hidden" size="8" value=1> 
        <input name="deliveryamount" type="hidden" size="8" value=<%=strdeliveryamount%>> 
        <%response.write straccountname%>
        <%else%>
        <input name="bpayment" type="hidden" size="8" value=0> <input name="account" type="hidden" size="8" value="<%=straccount%>"> 
        <input name="accountname" type="text" size="16" value="<%=straccountname%>" readonly> 
        <input type="button" name="bnaccount" onClick="JavaScript:opensubwin2('form1','account')"    value=...  class=black> 
        <%end if%>
      </td>
      <td width="10%" bgcolor="DEDFDE" nowrap> <div align="center">发货金额</div></td>
      <td width="40%" bgcolor="efefef"> 
        <%response.write strdeliveryamount%>
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td nowrap bgcolor="DEDFDE"><div align="center">应收帐类型</div></td>
      <td colspan="3" bgcolor="efefef"> 
        <%if request("id")<>"" and strpaymenttype="应收帐款" then%>
        <input name="paymenttype" type="hidden" size="8" value="<%=strpaymenttype%>"> 
        <%response.write strpaymenttype%>
        <%else%>
        <select name="paymenttype" id="paymenttype">
          <option value="其他应收" <%if strpaymenttype="其他应收" then response.Write("selected")%>>其他应收</option>
        </select> 
        <%end if%>
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td height="24" nowrap bgcolor="DEDFDE"> <div align="center">应收金额</div></td>
      <td bgcolor="efefef">
	  <%if request("id")<>"" and strpaymenttype="应收帐款" then%>
	  <%=stramount%>
	  <input name=amount type=hidden value="<%=stramount%>" size="16">
	  <%else%>
	  <input name=amount type=text value="<%=stramount%>" size="16">
	  <input name=deliveryamount type=hidden value=0 size="16">
	  <%end if%>
	  </td>
      <td nowrap bgcolor="DEDFDE">应收日期</td>
      <td bgcolor="efefef"><input type="text" name="paymentdate" size="12" language=javascript id="dupdatetime" value="<%=strpaymentdate%>" readonly> 
        <% call AddImg("date")%>
        <input type = hidden name=clicksource> <input type = hidden name=clickresult > 
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="10%" nowrap bgcolor="DEDFDE"> <div align="center">应开票金额</div></td>
      <td bgcolor="efefef">
	  <%if request("id")<>"" and strpaymenttype="应收帐款" then%>
		<%=strinvoiceamount%>
	  <input name=invoiceamount type=hidden value="<%=strinvoiceamount%>" size="16"> 
	  <%else%>
	  <input name=invoiceamount type=text value="<%=strinvoiceamount%>" size="16"> 
	  <%end if%>
      </td>
      <td nowrap bgcolor="DEDFDE"> <div align="center">应开日期</div></td>
      <td bgcolor="efefef"><input type="text" name="invoicedate" size="12" language=javascript id="dupdatetimeinvoice" value="<%=strinvoicedate%>" readonly> 
        <% call AddImg("dateinvoice")%>
      </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE" > <div align="center">描述</div></td>
      <td colspan="3" bgcolor="efefef"> <textarea name="description" cols="45" rows="4"><%=strdescription%></textarea> 
      </td>
    </tr>
  </table>
	<table>
    <tr> 
      <td height=10 colspan="4"></a></td>
    </tr>
    <tr> 
      <td></td>
      <td style="cursor:hand">&nbsp;&nbsp;<a onclick="save();"><img src="../images/button_save.gif" style="cursor:hand"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="window.close();"><img src="../images/button_cancel.gif"  style="cursor:hand"></a> 
      </td>
      <td style="cursor:hand">&nbsp;</td>
      <td style="cursor:hand">&nbsp;</td>
    </tr>
  </table>
</form>

⌨️ 快捷键说明

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