📄 xsaddok.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../Connections/sell.asp" -->
<%
if(Request("hxsph") <> "") then varxsph = Request("hxsph")
if(Request("hspname") <> "") then varspname = Request("hspname")
if(Request("hjc") <> "") then varjc = Request("hjc")
if(Request("hcd") <> "") then varcd = Request("hcd")
if(Request("hgg") <> "") then vargg = Request("hgg")
if(Request("hbz") <> "") then varbz = Request("hbz")
if(Request("hdw") <> "") then vardw = Request("hdw")
if(Request("hdj") <> "") then vardj = Request("hdj")
if(Request("hje") <> "") then varje = Request("hje")
if(Request("hkhname") <> "") then varkhname = Request("hkhname")
if(Request("hxsdate") <> "") then varxsdate = Request("hxsdate")
if(Request("hczy") <> "") then varczy = Request("hczy")
if(Request("hjsr") <> "") then varjsr = Request("hjsr")
if(Request("hjsfs") <> "") then varjsfs = Request("hjsfs")
if(Request("hsl") <> "") then varsl = Request("hsl")
if(Request("hid") <> "") then varid = Request("hid")
if(Request("hws") <> "") then varws = Request("hws")
if(Request("hss") <> "") then varss = Request("hss")
if(Request("hys") <> "") then varys = Request("hys")
if(Request("hws") > 0 ) then
varwhether = "否"
else
varwhether = "是"
end if
'查询入库结账表中的最大单据号
set rsmaxph = Server.CreateObject("ADODB.Recordset")
sql_max = "SELECT MAX(ID) AS MAXID FROM dbo.tab_selljz "
rsmaxph.open sql_max,conn,1,3
'生成结款票号
no=trim(rsmaxph("MAXID"))
if (month(date())<10) then
cmonth="0"+Cstr(month(date()))
else
cmonth=Cstr(month(date()))
end if
if (day(date())<10) then
cday="0"+Cstr(day(date()))
else
cday=Cstr(day(date()))
end if
select case len(int(Right(no,5)+1))
case 1
cno="0000"+Cstr(int(Right(no,5)+1))
case 2
cno="000"+Cstr(int(Right(no,5)+1))
case 3
cno="00"+Cstr(int(Right(no,5)+1))
case 4
cno="0"+Cstr(int(Right(no,5)+1))
case 5
cno=Cstr(int(Right(no,5)+1))
case Else
cno="00001"
end select
intno="JK"+Cstr(year(date()))+cmonth+cday+cno
'查询库存数量
set rssl= Server.CreateObject("ADODB.Recordset")
sql_sl="SELECT kcsl FROM dbo.tab_kucun WHERE ID ='"+varid+"'"
rssl.open sql_sl,conn,1,3
'保存销售信息
Ins_sell = "INSERT INTO dbo.tab_sell (id, spid, spname, jc, cd, gg, bz, dw, dj,"&_
" sl, je, khname, xsdate, czy, jsr, jsfs) VALUES ('" + Replace(varxsph, "'", "''") +_
"','" + Replace(varid, "'", "''") + "','" + Replace(varspname, "'", "''") + "','" +_
Replace(varjc, "'", "''") + "','" + Replace(varcd, "'", "''") + "','" +_
Replace(vargg, "'", "''") + "','" + Replace(varbz, "'", "''") + "','" +_
Replace(vardw, "'", "''") + "'," + Replace(vardj, "'", "''") + "," +_
Replace(varsl, "'", "''") + "," + Replace(varje, "'", "''") + ",'" +_
Replace(varkhname, "'", "''") + "','" + Replace(varxsdate, "'", "''") +_
"','" + Replace(varczy, "'", "''") + "','" + Replace(varjsr, "'", "''") +_
"','" + Replace(varjsfs, "'", "''") + "') "
conn.Execute(Ins_sell)
'保存销售票号信息
Ins_sellph = "INSERT INTO dbo.tab_sellph (xsph, sl, ys, ss, ws, khname, xsdate,"&_
" czy, jsr, jsfs, whether) VALUES ('" + Replace(varxsph, "'", "''") + "'," +_
Replace(varsl, "'", "''") + "," + Replace(varys, "'", "''") + "," +_
Replace(varss, "'", "''") + "," + Replace(varws, "'", "''") + ",'" +_
Replace(varkhname, "'", "''") + "','" + Replace(varxsdate, "'", "''") +_
"','" + Replace(varczy, "'", "''") + "','" + Replace(varjsr, "'", "''") + "','" +_
Replace(varjsfs, "'", "''") + "','" + Replace(varwhether,"'","''") + "') "
conn.Execute(Ins_sellph)
'保存销售结账信息
Ins_jk="INSERT INTO dbo.tab_selljz (ID,xsid,khname,bcjk,ye,jkdate,czy,jsr) VALUES ('"&intno&_
"','"&varxsph&"','"&varkhname&"',"&varss&","&varws&",'"&varxsdate&"','"&varczy&"','"&varjsr&"')"
conn.Execute(Ins_jk)
'更新库存信息
UP_kc = "UPDATE dbo.tab_kucun SET kcsl = kcsl-"+ Replace(varsl, "'", "''") +_
",kcje = (kcsl-" + Replace(varsl,"'","''")+")*dj WHERE ID ='"+varid+"'"
conn.Execute(UP_kc)
%>
<html>
<head>
<title>网上商品交易系统--商品销售</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="../../images/bg.gif">
<table width="590" border="0" cellspacing="-2" cellpadding="-2" height="246">
<tr>
<td>
<div align="center">
<p><b><font color="990000">商品销售信息保存成功!</font></b></p>
<p><font color="#990000"><b>单击“ <a href="./spxs.asp" class="l" target="_self">返回</a>
”继续销售。</b></font></p>
</div>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -