📄 newpayment.asp
字号:
<!--#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='popayment'")
'编辑取记录
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_popayment 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")
strreceiveamount=rsq("receivedamount")
strpaymenttype=rsq("paymenttype")
strPaymentDate=rsq("PaymentDate")
strdescription=rsq("description")
strinvoiceamount=rsq("invoiceamount")
strinvoicedate=rsq("invoicedate")
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
end if
if request("amount")<>"" then
Dim objpopayment
Set objpopayment=Server.CreateObject("SmartSales.POPayment")
objpopayment.SavePOPayment
set objpopayment=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">
</head>
<!--#include file="../calendar/style.asp"-->
<script language=javascript src="../tools/newcalendar.js"></script>
<script language="javascript">
function save(){
if (form1.paymenttype.value!='应付帐款'){
if (form1.account.value==-1){
alert('请选择客户');
form1.account.focus();
return;
}
}
if (form1.paymenttype.value=='应付帐款'){
if (form1.amount.value!=form1.receiveamount.value){
if (form1.description.value==''){
alert('应收金额和收货金额不相等,请输入描述');
form1.description.focus();
return;
}
}
}
if (form1.paymenttype.value=='应付帐款'){
if (form1.invoiceamount.value!=form1.receiveamount.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> </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 width="10%" bgcolor="DEDFDE"> <div align="center">客户</div></td>
<td width="40%" nowrap bgcolor="efefef">
<%if strpaymenttype="应付帐款" then%>
<%=strpoaccountname%>
<%else%>
<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"><input name="receiveamount" type="hidden" size="8" value=<%=strreceiveamount%>><%=formatnumber(strreceiveamount,2)%>
</td>
</tr>
<tr bgcolor="white">
<td nowrap bgcolor="DEDFDE"><div align="center">应付帐类型</div></td>
<td colspan="3" bgcolor="efefef">
<%if strpaymenttype="应付帐款" then%>
<%=strpaymenttype%> <input type=hidden name=paymenttype value=<%=strpaymenttype%>>
<%else%>
<select name="paymenttype" id="select2">
<option value="其他应付" <%if strpaymenttype="其他应付" then response.Write("selected")%>>其他应付</option>
</select>
<%end if%>
</td>
</tr>
<tr bgcolor="white">
<td nowrap bgcolor="DEDFDE"><div align="center">应付金额</div></td>
<td bgcolor="efefef">
<%if strpaymenttype="应付帐款" then%>
<input name=amount type=hidden value="<%=stramount%>" size="16"><%=stramount%>
<%else%>
<input name=amount type=text value="<%=stramount%>" size="16">
<%end if%>
</td>
<td nowrap bgcolor="DEDFDE"><div align="center">应付日期</div></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 strpaymenttype="应付帐款" then%>
<input name=invoiceamount type=hidden value="<%=strinvoiceamount%>" size="16"> <%=formatnumber(strinvoiceamount,2)%>
<%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"> <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 + -