📄 newpay.asp
字号:
<SCRIPT language='javascript'>window.resizeTo(450,300);window.focus()</SCRIPT>
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
if request("id")<>"" then
objcheck.CheckUserFunction "popayment","edit"
else
objcheck.CheckUserFunction "popayment","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='pay'")
if request("id")<>"" then
dim connq
dim rsq
dim strpopaymentno
set connq=server.CreateObject("adodb.connection")
set rsq=server.CreateObject("adodb.recordset")
connq.Open connstring
rsq.Open "select * from v_pay where payid="&request("id"),connq,2,3,1
stramount=rsq("amount")
straccount=rsq("accountid")
straccountname=getfieldvalue("[account]","accountid",rsq("accountid"),"account")
strpaytype=rsq("paytype")
strreceiveddate=rsq("receiveddate")
strdescription=rsq("description")
strpopaymentno=rsq("popaymentno")
if rsq("popaymentid")<>"" then strpopaymentid=rsq("popaymentid") else strpaymentid=-1
if rsq("poid")<>"" then strpoid=rsq("poid") else strpoid=-1
strpono=rsq("pono")
rsq.Close
set rsq=nothing
connq.Close
set connq=nothing
else
if Request("accountid")<>"" then
straccount=Request("accountid")
straccountname=Request("accountname")
else
straccount=-1
end if
stramount=request("paymentamount")
if request("straccount")<>"" then straccountname=request("straccount")
if request("straccountid")<>"" then straccount=request("straccountid")
if request("paymentno")<>"" then strpopaymentno=request("paymentno")
if request("popaymentid")<>"" then strpopaymentid=request("popaymentid")
if request("stramount")<>"" then stramount=request("stramount")
if request("strpoid")<>"" then strpoid=cint(request("strpoid"))
if request("strpono")<>"" then strpono=request("strpono")
strreceiveddate=date()
end if
if request("amount")<>"" then
dim conn
dim rs
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
if request("id")="" then
rs.Open "select * from pay order by payid desc",conn,2,3,1
x=1
for l=1 to rspara("len")
x=x*10
next
if not rs.EOF then
x=x+rs("payid")+1
else
x=x+1
end if
rs.close
rs.Open "select * from pay",conn,2,3,1
rs.AddNew
rs("paymentstatus")="未销"
rs("creator")=session("loginid")
rs("createdate")=date()
rs("payno")=rspara("prefix")&right(x,len(x)-1)
rs("sysaccountid")=getsysaccount("sysaccountid")
else
rs.Open "select * from pay where payid="&request("id"),conn,2,3,1
rs("lastmoduser")=session("loginid")
rs("lastmoddate")=now()
end if
rs("accountid")=request("account")
rs("paytype")=request("paytype")
rs("amount")=request("amount")
rs("receiveddate")=request("receiveddate")
rs("description")=request("description")
if request.form("po")<>"" then rs("poid")=request.form("po")
rs("pono")=request("poname")
if request("popayment")<>"" then rs("popaymentid")=request("popayment")
rs.Update
rs.Close
set rs=nothing
conn.Close
set conn=nothing
%>
<script language=javascript>
window.opener.location.reload();
window.close();
</script>
<%
end if
%>
<HTML><HEAD><TITLE>付款</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function save(){
if (form1.account.value==-1){
alert('请选择客户');
form1.account.focus();
return;
}
if (form1.amount.value==''){
alert('请输入金额');
form1.amount.focus();
return;
}
if (isNaN(form1.amount.value)){
alert('请输入数字');
form1.amount.focus();
return;
}
form1.submit();
}
</script>
<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>
<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> </td>
</tr>
<tr >
<td height="16" colspan="2" background="../images/title.gif"> </td>
</tr>
<tr>
<td height=4></td>
</tr>
</table>
<table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
<tr bgcolor="white">
<td height="22" bgcolor="DEDFDE">
<div align="center">应付帐款</div></td>
<td bgcolor="efefef" ><input name="popaymentname" type="text" value="<%=strpopaymentno%>" size="16" readonly>
<input type="button" name="bnpayment" onClick="JavaScript:opensubwin2('form1','popayment',form1.po.value)" value=... class=black>
<input name="popayment" type="hidden" size="8" value="<%=strpopaymentid%>">
</td>
<td bgcolor="DEDFDE"><div align="center">金额</div></td>
<td bgcolor="efefef"><input name=amount type=text value="<%=stramount%>" size=16></td>
</tr>
<tr bgcolor="white">
<td width="10%" bgcolor="DEDFDE" nowrap> <div align="center">采购单号</div></td>
<td width="40%" bgcolor="efefef" ><input name="poname" type="text" value="<%=strpono%>" size="16" readonly>
<input type="button" name="bnpo" onClick="JavaScript:opensubwin2('form1','CPO')" value=... class=black>
<input type="hidden" name="po" id=po value="<%=strpoid%>">
</td>
<td width="10%" bgcolor="DEDFDE"> <div align="center">付款类型</div></td>
<td width="40%" bgcolor="efefef"><select name="paytype" id="select">
<option value="付款" <%if strpaytype="应付款" then response.Write("selected")%>>应付款</option>
<option value="预付款" <%if strpaytype="预付款" then response.Write("selected")%>>预付款</option>
<option value="其他付款" <%if strpaytype="其他应付款" then response.Write("selected")%>>其他应付款</option>
</select></td>
</tr>
<tr bgcolor="white">
<td width="10%" bgcolor="DEDFDE" nowrap> <div align="center">客户</div></td>
<td bgcolor="efefef"> <input name="accountname" type="text" size="16" value="<%=straccountname%>" readonly>
<input type="button" name="bnaccount" onClick="JavaScript:opensubwin2('form1','account')" value=... class=black>
<input name="account" type="hidden" size="8" value="<%=straccount%>">
</td>
<td width="10%" bgcolor="DEDFDE"> <div align="center">付款日期</div></td>
<td bgcolor="efefef"><input type="text" name="receiveddate" size="12" language=javascript id="receiveddate" value="<%=strreceiveddate%>" readonly>
<% call AddImg("date")%>
<input type = hidden name=clicksource> <input type = hidden name=clickresult >
</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"> <a onclick="save();"><img src="../images/button_save.gif"></a> <a onclick="window.close();"><img src="../images/button_cancel.gif"></a>
</td>
<td style="cursor:hand"> </td>
<td style="cursor:hand"> </td>
</tr>
</table>
</form>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -