📄 setmaterialtransaction.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "payment","edit"
set objcheck=nothing
fieldname=request("fieldname")
if fieldname="receiveamount" then
title="应收/应付金额"
elseif fieldname="adjustcost" then
title="调准成本"
elseif fieldname="invoiceamount" then
title="开票金额"
elseif fieldname="description" then
title="备注"
end if
set conn=server.CreateObject("adodb.connection")
conn.open connstring
if fieldname="receiveamount" then
strfieldname="receiveamount"
elseif fieldname="invoiceamount" then
strfieldname="invoiceamount"
elseif fieldname="poreceiveamount" then
strfieldname="receiveamount"
elseif fieldname="poinvoiceamount" then
strfieldname="invoiceamount"
end if
if Request("Mod") = "save" then
if fieldname="description" then
sql="update materialtransaction set "&fieldname&"='"&request.form(fieldname)&"' where transactid="&request("transactid")
set rs=conn.execute(sql)
%>
<script language=javascript>
//window.opener.location.reload();
window.close();
</script>
<%
else
sql="update materialtransaction set "&strfieldname&"="&request.form(fieldname)&" where transactid="&request("transactid")
set rs=conn.execute(sql)
if fieldname="receiveamount" then
strfieldname="receiveamount"
sql="select sum(receiveamount) as totalamount from materialtransaction where orderpaymentid="&request("orderpaymentid")
set rs=conn.execute(sql)
sql="update orderpayment set amount="&rs("totalamount")&" where paymentid="&request("orderpaymentid")
conn.execute(sql)
elseif fieldname="invoiceamount" then
strfieldname="invoiceamount"
sql="select sum(invoiceamount) as totalamount from materialtransaction where orderpaymentid="&request("orderpaymentid")
set rs=conn.execute(sql)
sql="update orderpayment set invoiceamount="&rs("totalamount")&" where paymentid="&request("orderpaymentid")
conn.execute(sql)
elseif fieldname="poreceiveamount" then
strfieldname="receiveamount"
sql="select sum(receiveamount) as totalamount from materialtransaction where popaymentid="&request("popaymentid")
set rs=conn.execute(sql)
sql="update popayment set amount="&rs("totalamount")&" where paymentid="&request("popaymentid")
conn.execute(sql)
elseif fieldname="poinvoiceamount" then
strfieldname="invoiceamount"
sql="select sum(invoiceamount) as totalamount from materialtransaction where popaymentid="&request("popaymentid")
set rs=conn.execute(sql)
sql="update popayment set invoiceamount="&rs("totalamount")&" where paymentid="&request("popaymentid")
conn.execute(sql)
end if
%>
<script language=javascript>
window.opener.location.reload();
window.close();
</script>
<%
end if
else
sql="select "&strfieldname&" from materialtransaction where transactid="&request("transactid")
'response.write sql
set rs=conn.execute(sql)
strfieldname=rs(""&strfieldname&"")
if rs.eof then
response.write "记录没有找到"
response.end
end if
end if
%>
<title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Link href="../global.css" rel=stylesheet type=text/css>
<Script Language="javascript" >
function dosub()
{
form1.Mod.value = "save";
if (form1.type.value!='description'){
var strtype=form1.type.value;
if(isNaN(form1.all(strtype).value)){
alert('请输入数字');
form1.all(strtype).focus();
return;
}
}
form1.submit();
}
</Script>
</head>
<body bgcolor="#FFFFFF" text="#000000" >
<form method="post" id=form1 name=form1 action="">
<input type=hidden name="Mod" >
<input type=hidden name=type value="<%=request("fieldname")%>" >
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="FFFFFF">
<tr height=50>
<td class=title><%=title%><div align="center"><textarea name=<%=fieldname%> cols="35" rows="4"><%=strdescription%><%=strfieldname%></textarea></div></td>
</tr>
<tr>
<td align="center" height=45><br>
<a onclick="return dosub()"><img src="../images/button_confirm.gif" style="cursor:hand"></a>
<img src="../images/button_cancel.gif" style="cursor:hand" border=0 language=javascript onclick="window.close();">
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -