📄 sale.asp
字号:
<!--#include file="../function/connect.asp"-->
<!--#include file="../function/function.asp"-->
<%
Sales_OPP_ID=request("Sales_OPP_ID")
Client_id=session("Client_id")
if request("submit")<>"" and request("meth")="add" then
Regarding=getString(request("Regarding"))
client_ID=request("client_ID")
Contact_ID=request("Contact_ID")
sale_Date=request("sale_Date")
order_num=request("order_num")
Currency_ID=request("Currency_ID")
Invoice_ID=request("Invoice_ID")
Amount=request("Amount")
Paid_Amount=request("Paid_Amount")
Invoiced_Amount=request("Invoiced_Amount")
Details=getString(request("Details"))
IsPublic=getString(request("IsPublic"))
strsql="insert into SalesOpportunities(Regarding,client_ID,Contact_ID,sale_Date,order_num,Currency_ID,Invoice_ID,Amount,Paid_Amount,Invoiced_Amount,Details,IsPublic,Creator) values('"
strsql=strsql & Regarding & "','"
strsql=strsql & client_ID & "','"
strsql=strsql & Contact_ID & "','"
strsql=strsql & sale_Date & "','"
strsql=strsql & order_num & "','"
strsql=strsql & Currency_ID & "','"
strsql=strsql & Invoice_ID & "','"
strsql=strsql & Amount & "','"
strsql=strsql & Paid_Amount & "','"
strsql=strsql & Invoiced_Amount & "','"
strsql=strsql & Details & "','"
strsql=strsql & IsPublic & "','"
strsql=strsql & session("loginuser") & "')"
'response.write strsql
'response.end
objConn.execute strsql
strsql="select @@identity as Sales_OPP_ID"
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
Sales_OPP_ID=objrs.fields("Sales_OPP_ID")
response.redirect "sale.asp?Sales_OPP_ID=" & Sales_OPP_ID
response.end
end if
if request("submit")<>"" and request("meth")="edit" then
Regarding=getString(request("Regarding"))
Sales_OPP_ID=request("Sales_OPP_ID")
client_ID=request("client_ID")
Contact_ID=request("Contact_ID")
sale_Date=request("sale_Date")
order_num=request("order_num")
Currency_ID=request("Currency_ID")
Invoice_ID=request("Invoice_ID")
Amount=request("Amount")
Paid_Amount=request("Paid_Amount")
Invoiced_Amount=request("Invoiced_Amount")
Details=getString(request("Details"))
strsql="update SalesOpportunities set "
strsql=strsql & "Regarding='"& Regarding & "',"
strsql=strsql & "client_ID='"& client_ID & "',"
strsql=strsql & "Contact_ID='" & Contact_ID & "',"
strsql=strsql & "sale_Date='"& sale_Date & "',"
strsql=strsql & "order_num='" & order_num & "',"
strsql=strsql & "Currency_ID='" & Currency_ID & "',"
strsql=strsql & "Invoice_ID='" & Invoice_ID & "',"
strsql=strsql & "Amount='" & Amount & "',"
strsql=strsql & "Paid_Amount='" & Paid_Amount & "',"
for i=31 to 35
strsql=strsql & "User" & i & "='" & request("User" & i) & "',"
strsql=strsql & "Dict" & i & "_ID='" & request("Dict" & i & "_ID") & "',"
next
strsql=strsql & "Invoiced_Amount='" & Invoiced_Amount & "',"
strsql=strsql & "Details='" & Details & "' "
strsql=strsql & " where Sales_OPP_ID=" & Sales_OPP_ID
'response.write strsql
'response.end
objConn.execute strsql
response.redirect "sale.asp?Sales_OPP_ID=" & Sales_OPP_ID
response.end
end if
if Sales_OPP_ID<>"" then
strsql="select *,(select sum(Amount) from OrderDetails where Sales_OPP_ID=" & Sales_OPP_ID & ") as Amount1 from SalesOpportunities where Sales_OPP_ID=" & Sales_OPP_ID
'response.write strsql
Set objRs = Server.CreateObject("adodb.recordset")
objRs.Open strsql,objConn,1,1
if not objrs.eof then
Regarding=objrs.fields("Regarding")
client_ID=objrs.fields("client_ID")
Contact_ID=objrs.fields("Contact_ID")
sale_Date=objrs.fields("sale_Date")
order_num=objrs.fields("order_num")
Currency_ID=objrs.fields("Currency_ID")
Invoice_ID=objrs.fields("Invoice_ID")
Amount=objrs.fields("Amount1") & ""
if Amount="" then
Amount=objrs.fields("Amount")
end if
Paid_Amount=objrs.fields("Paid_Amount")
Invoiced_Amount=objrs.fields("Invoiced_Amount")
Details=objrs.fields("Details")
end if
'response.write order_num
end if
%>
<html>
<head>
<title>销售</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../cssD.css" rel=stylesheet>
<STYLE>
.memusty2{BORDER-BOTTOM: #99ccff 1px inset;BORDER-LEFT: #99ccff 1px inset;BORDER-RIGHT: #99ccff 1px inset;BORDER-TOP: #99ccff 1px inset;COLOR: #ffffff;CURSOR: hand;PADDING-BOTTOM: 3px;PADDING-LEFT: 3px;PADDING-RIGHT: 3px;PADDING-TOP: 3px}
.tab {BORDER-RIGHT: gray 1px solid; BORDER-TOP: #FFFFFF 1px solid; BORDER-LEFT: #FFFFFF 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 9pt; COLOR:#00000;FONT-FAMILY: Verdana; TEXT-ALIGN: center}
.selTab {BORDER-RIGHT: black 1px solid; BORDER-TOP: #FFFFFF 2px solid; BORDER-LEFT: white 1px solid; FONT-WEIGHT: normal; FONT-SIZE: 9pt; COLOR:#000000;TEXT-ALIGN: center;}
</STYLE>
<script language = "javascript" src="../function/date-picker.js"></script>
<SCRIPT language="JavaScript">
function init(){
oldtabContent=t1Contents;
currentTab = t1;
tabBase = t1base;
}
function changeTabs(){
if(window.event.srcElement.className == "tab"){
currentTab.className = "tab";
tabBase.style.backgroundColor = "white";
currentTab = window.event.srcElement;
tabBaseID = currentTab.id + "base";
tabContentID = currentTab.id + "Contents";
tabBase = document.all(tabBaseID);
tabContent = document.all(tabContentID);
currentTab.className = "selTab";
tabBase.style.backgroundColor = "";
oldtabContent.style.display="none";
tabContent.style.display="";
oldtabContent=tabContent;
}
}
function check(){
if(document.form1.Regarding.value==""){
alert("主题不能为空");
document.form1.Regarding.focus();
return false;
}
if(document.form1.client_ID.value==""){
alert("相关客户不能为空");
document.form1.client_ID.focus();
return false;
}
if(document.form1.Contact_ID.value==""){
alert("相关联系人不能为空");
document.form1.Contact_ID.focus();
return false;
}
if(document.form1.order_num.value==""){
alert("进货单号不能为空");
document.form1.order_num.focus();
return false;
}
}
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
function fnDo(strTable,strFIdName,strIdName,strIDValue,strShowName)
{
var xmlDom = new ActiveXObject("Msxml2.DOMDocument");
var strURL = "GetCity.asp?strIDValue=" + strIDValue + "&strIdName="+strIdName+"&strTable="+strTable+"&strShowName="+strShowName+"&strFIdName="+strFIdName;
//alert(strURL);
xmlhttp.Open("POST",strURL , true);
xmlhttp.onreadystatechange = fnRun;
xmlhttp.Send(xmlDom);
}
//--------------------------------------------------------
function fnRun()
{
var state = xmlhttp.readyState;
var xmlDom = new ActiveXObject("Msxml2.DOMDocument");
if (state == 4)
{
xmlDom.loadXML(xmlhttp.responseXML.xml);
//alert(xmlDom.documentElement.selectSingleNode("//objXML").text)
var getInfo = xmlDom.documentElement.selectSingleNode("//objXML").text;
//document.write(getInfo);
subcat = new Array();
eval(getInfo);
changelocation(subcat)
}
}
function changelocation(subcat)
{
document.form1.Contact_ID.length = 0;
var i;
document.form1.Contact_ID.options[0] = new Option('====选择====','');
for (i=0;i <subcat.length; i++)
{
document.form1.Contact_ID.options[document.form1.Contact_ID.length] = new Option(subcat[i][0], subcat[i][1]);
if(subcat[i][1]=='<%=Contact_ID%>')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -