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

📄 pay_rec_new_exe.asp

📁 一个比较完整的企业erp系统
💻 ASP
字号:
<!--#include file="../config2.asp"-->
<!--#include file="../inc/check_login.asp"-->
<!--#include file="../inc/functions.asp"-->
<%
Application_ID = 3000400	'本功能编号,含义请查看编码表
if not CheckAuth(Session("Employee_ID"),Application_ID)	then	'验证权限
	Server.Transfer "../err/un_authorized.htm"
	response.end
end if
%>
<!--**************身份验证部分****************-->
<%
Contract_ID = request("Contract_ID")
Rec_Date = request("Rec_Date")
Account = request("Account")
Rec_Content = request("Rec_Content")
if not IsNot(Contract_ID,"n") then
	response.write "合同编号丢失"
	response.end
end if
if not IsNot(Rec_Date,"d") then
	response.write "合同日期“" & Rec_Date & "”书写错误,请按照yyyy-mm-dd格式书写"
	response.end
end if
if not IsNot(Account,"n") then
	response.write "金额“" & Account & "”书写错误"
	response.end
end if

Set conn = Server.CreateObject("ADODB.Connection")
conn.open connstr
sql = "insert into Contracts_Pay_Rec(Contract_ID,Rec_Date,Account,Rec_Content,Employee_ID) values(" & Contract_ID & ",'" & Rec_Date & "'," & Account & ",'" & Rec_Content & "'," & Session("Employee_ID") & ")"
'response.write sql
conn.execute(sql)

'更新合同金额记录
'conn.execute("sp_Contract_Account_Change " & Contract_ID)
'****
'收款记录*
sql = "select SUM(Account) as Account_Pay from Contracts_Pay_Rec where Contract_ID = " & Contract_ID
set rs=conn.execute(sql)
if rs.eof then
	Account_Pay = 0
else
	Account_Pay = rs("Account_Pay")
end if
'/* 外包费记录 */
sql = "select SUM(Account) as Account_Other from Contracts_Other_Rec where Contract_ID = " & Contract_ID
set rs=conn.execute(sql)
if rs.eof then
	Account_Other = 0
else
	Account_Other = rs("Account_Other")
end if
'/* 基础业务费记录 */
sql = "select SUM(Account) as Account_Base from Contracts_Base_Rec where Contract_ID = " & Contract_ID
set rs=conn.execute(sql)
if rs.eof then
	Account_Base = 0
else
	Account_Base = rs("Account_Base")
end if
'/* 合同变更记录 */
sql = "select SUM(Account) as Account_Chgfrom Contracts_Chg_Rec where Contract_ID = " & Contract_ID
set rs=conn.execute(sql)
if rs.eof then
	Account_Chgfrom = 0
else
	Account_Chgfrom = rs("Account_Chgfrom")
end if
'/* 更新合同记录 */
sql = "update Contracts set Other_Cost = " & Account_Other & ",Base_Cost = " & Account_Base & ",Chg_Account=" & Account_Chg & ", Received = " & Account_Pay & "		where Contract_ID = " & Contract_ID
conn.execute sql
set conn = nothing

'操作日志
Rec_Content = "添加合同收款记录"
Command_Line = sql
call Op_Rec(Rec_Content,Command_Line)
%>
成功添加合同收款记录!
<script language="JavaScript" type="text/javascript">
	parent.main.location.reload();
</script>

⌨️ 快捷键说明

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