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

📄 save_inward_2.asp

📁 物流进销存系统 全功能,MSSQL 2000数据库. 可做物流公司信息系统开发的源程序
💻 ASP
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%const title="确认数据"%>
<%
response.buffer=true
Response.Expires = 0
Response.CacheControl = "Private" 
%>
<!-- #include file=../data/username.inc-->
<!-- #include file=../data/connect.asp-->
<!--#include file=../data/myPrg.asp-->
<head>
<meta http-equiv="Content-Type"content="text/html; charset=gb_2312-80">
<title><%=title%></title>
<link rel="stylesheet" type="text/css" href="../data/forum.css">
</head>
<body topmargin=0>
<%
newcompanyid = request("companyid")
if newcompanyid = "" then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""请先选择公司再做此步操作!"");"
	Response.write "history.go(-1);"
	Response.Write "</script>"
	Response.End
elseif not isnumeric(newcompanyid) then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""companyid必须为整数!"");history.go(-1);"
	Response.Write "</script>"
	Response.End
else
	newcompanyid = cint(newcompanyid)  
end if
'得到INWARD表中的对应系统编号
dim inwardid
inwardid = request("id")
if not isnumeric(inwardid) then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""id必须为整数!"");history.go(-1);"
	Response.Write "</script>"
	Response.End
end if
'是否已入库
dim inwa_flag
inwa_flag = 0

arra = split(session("username"),";")
UserCompanyid = arra(0)
flag = arra(1)
User = arra(2)
userno = arra(4)
if flag > 4 then
	call closedatabase
	Response.End 
end if
ShowTitle(title)
msg=""


dc_id = request("dc_id")
dc_id = replace(dc_id,"'","")
prod_id = request("smalllocation")
prod_id = replace(prod_id,"'","")
if prod_id = "" then
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "alert(""请务必先选择产品编号!"");"
	Response.Write "history.go(-1);"
	Response.Write "</script>"
	Response.End 
end if


'得到库存表相对应的ID,以免由于管理员忘记初始化库存而引起误操作.
sql = "select inve_id from inventory where inve_dc_id = "&dc_id&" and inve_prod_id = "&prod_id&" and inve_disabled = 0 and inve_companyid = "&newcompanyid&""
'Response.Write sql&"<br>"
'Response.Write flag
'Response.End 
set rs_inve = conn.execute(sql)
if not rs_inve.eof then
	id = rs_inve("inve_id")

'入库数量inwa_no
inwa_no = trim(Request.Form("inwa_no"))

inve_last_date = now()

'将各相关信息存入COOKIES以便调用
Response.Cookies("inwa_prod_id") = request("biglocation")


''''''''''''''''''''''''''''''''''''''''
'保存数据模块,以下所有命令必须全部执行,否则会造成数据的不完整
'建议做成存储过程
'如为在途,则更新库存的是入库数量;如是入库,则更新库存的是实收数量
sql = "insert into inward_detail(idetail_inwa_id,idetail_prod_id,idetail_no,idetail_rec_no,idetail_date,idetail_man,idetail_io_flag,idetail_flag) values("&inwardid&","&prod_id&","&inwa_no&",0,'"&now()&"','"&User&"',0,0)"
conn.execute(sql)
sql = "update inward set inwa_flag = 0 where inwa_id = "&inwardid&" "
conn.execute(sql)
if inwa_flag = 0 then 'o为在途
   sql = "update inventory set inve_zaitu = inve_zaitu + " & inwa_no & ",inve_total = inve_total + " & inwa_no & ",inve_last_date = '" & inve_last_date &"' where inve_dc_id = "&dc_id&" and inve_prod_id = "&prod_id&" and inve_companyid = "&newcompanyid&" and inve_disabled = 0 "
   conn.execute(sql)  
end if
'执行结束
''''''''''''''''''''''''''''''''''''''''
database = trim(request("database"))
	rs_inve.close
	set rs_inve = nothing
	call closedatabase
	Response.Write "<script language=javascript>"
	Response.Write "var myTime = new Date(); "
	Response.Write "var timeNow = myTime.getTime();"
	Response.Write "{if (confirm(""数据已确认,继续进行该笔单子的入库操作吗?""))"
	if database = "" then
		Response.Write "window.location ='inward_2.asp?id="&inwardid&"&companyid="&newcompanyid&"&inward_second=yes&tt='+timeNow;"
	else
		Response.Write "window.location ='inward_2.asp?id="&inwardid&"&database=yes&companyid="&newcompanyid&"&inward_second=yes&tt='+timeNow;"
	end if
	Response.Write "else "
	Response.Write "{alert(""注意:接下来将打印入库通知书!!!"");"
	Response.Write "window.location ='inward.asp?companyid="&newcompanyid&"&tt='+timeNow;"
	Response.Write "window.open('rukutongzhi.asp?id="&inwardid&"&companyid="&newcompanyid&"&tt='+timeNow,'defgh');"
	Response.Write "}"
	Response.Write "}"
	Response.Write "</script>"
	Response.End 
else
	rs_inve.close
	set rs_inve = nothing
	call closedatabase
	Response.Write "您没有权限对这个数据进行操作<br>"
	Response.Write "想要更多操作,请与管理员联系<br>"
	Response.Write "<a href=javascript:history.go(-1);>后退</a>"
end if
%>


⌨️ 快捷键说明

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