📄 direct_save_outward_2.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
arra = split(session("username"),";")
UserCompanyid = arra(0)
flag = arra(1)
User = arra(2)
userno = arra(4)
database = request("database")
'产品编号
prod_no = trim(request("prod_no"))
if prod_no = "" then
prod_no = " "
else
prod_no = replace(prod_no,"'","’")
end if
'产品描述
prod_type = trim(request("prod_type"))
if prod_type = "" then
prod_type = " "
else
prod_type = replace(prod_type,"'","’")
end if
'产品备注
prod_color = trim(request("prod_color"))
if prod_color = "" then
prod_color = " "
else
prod_color = replace(prod_color,"'","’")
end if
direct = trim(request("direct"))
if direct = 1 then
inwa_take_address = Request.Cookies("take_address")
inwa_line_no = trim(Request.Cookies("line_no"))
if inwa_line_no = "" then inwa_line_no = " "
inwa_take_no = trim(Request.Cookies("take_no"))
if inwa_take_no = "" then inwa_take_no = " "
else
direct = 0
end if
msg=""
'得到OUTWARD表中的对应系统编号
dim outwardid
outwardid = request("id")
if not isnumeric(outwardid) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""id必须为整数!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
dc_id = request("dc_id")
if not isnumeric(dc_id) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""dc_id必须为整数!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
'出库数量outw_no
outw_no = trim(Request.Form("outw_no"))
if not isnumeric(outw_no) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""outw_no必须为整数!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
'出库方式outw_type
'目的地outw_where,收货人订单号takeman_id,时限要求yuji_time
'出库摘要outw_beizu
outw_where = trim(Request.Form("outw_where"))
outw_type = request("outw_type")
takeman_id = trim(Request.Form("takeman_id"))
takeman_id = replace(takeman_id,"'","''")
yuji_time = trim(Request.Form("yuji_time"))
outw_beizu = trim(Request("outw_beizu"))
outw_beizu = replace(outw_beizu,"'","''")
guest_id_cookies = Request.Cookies("outw_where")
if outw_where <> guest_id_cookies then
if outw_type = "" then
msg = msg + "出库方式必须选择!<br>"
end if
if isdate(yuji_time) = false then
msg = msg + "预计到达时间格式错误!<br>"
end if
end if
if cint(direct) = 0 then
if (clng(outw_no) > clng(inve_maysent)) then
msg = msg + "出库数量不得大与可分发数量!<br>"
end if
end if
if outw_where = 0 then
msg = msg + "请选择客户!<br>"
end if
if msg<>"" then
showerror(msg)
else
'将相应的日期格式转换成正确的日期格式
'并且将信息写入到cookies中以便用户在下次录入时不必输入
if outw_where <> guest_id_cookies then
if outw_yuji_time = "" then outw_yuji_time = now()
yuji_time = replace(yuji_time,":",":")
Response.Cookies("yuji_time") = yuji_time
Response.Cookies("outw_where") = outw_where
Response.Cookies("info_type") = outw_type
Response.Cookies("takeman_id") = takeman_id
end if
prod_flag = request("biglocation")
if not isnumeric(prod_flag) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""biglocation必须为整数!"");history.go(-1);"
Response.Write "</script>"
Response.End
end if
Response.Cookies("prod_flag") = prod_flag
Response.Cookies("prod_id") = prod_id
if takeman_id = "" then takeman_id = " "
if outw_beizu = "" then outw_beizu = " "
if outw_type = "" then outw_type = " "
if yuji_time = "" then yuji_time = now()
if trim(session("username")) = "" then
call closedatabase
Response.Redirect "../user/defaut.asp"
Response.End
end if
set cmd=server.CreateObject("ADODB.Command")
cmd.ActiveConnection = conn
cmd.CommandType = 4
cmd.CommandText = "Direct_Save_Outward_2"
dim adInteger
adInteger = 3
dim adParamInput
adParamInput = 1
dim adParamOutput
adParamOutput = 2
dim adVarchar
adVarChar = 200
adDBDAte = 135
addbtimestamp = 135
cmd.Parameters.Refresh
if direct = 1 then
cmd.Parameters("@direct") = 1
else
cmd.Parameters("@direct") = 0
end if
'如果出的是同一个客户的产品,则只更新OUTWARD_DETAIL表和INVENTORY表
'如果出给另一客户,则还需更新DETAIL_INFO表
if outw_where = guest_id_cookies then
cmd.Parameters("@flag") = 0
else
cmd.Parameters("@flag") = 1
end if
'Response.Write prod_no
'Response.End
cmd.Parameters("@prod_no") = prod_no
cmd.Parameters("@prod_type") = prod_type
cmd.Parameters("@prod_color") = prod_color
cmd.Parameters("@prod_flag") = prod_flag
cmd.Parameters("@detail_outw_id") = outwardid
cmd.Parameters("@dc_id") = dc_id
cmd.Parameters("@newcompanyid") = newcompanyid
cmd.Parameters("@detail_no") = outw_no
cmd.Parameters("@user") = User
cmd.Parameters("@info_type") = outw_type
cmd.Parameters("@info_takeman_id") = takeman_id
cmd.Parameters("@info_yuji_time") = yuji_time
cmd.Parameters("@info_order_beizu") = outw_beizu
cmd.Parameters("@detail_guest_id") = outw_where
cmd.Execute
set cmd = nothing
'结束事务处理
'update语句-----更新"已分配数量"数据
if err.number <> 0 then
call closedatabase
response.write "<p>无法保存,数据库操作出错:" + err.description + "</p>"
Response.Write "<p>请稍后再试!</p>"
Response.End
end if
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
if direct = 1 then
Response.Write "window.location ='direct_outward_2.asp?direct=1&id="&outwardid&"&companyid="&newcompanyid&"&inward_second=yes&tt='+timeNow;"
else
Response.Write "window.location ='outward_2.asp?id="&outwardid&"&companyid="&newcompanyid&"&inward_second=yes&tt='+timeNow;"
end if
else
if direct = 1 then
Response.Write "window.location ='direct_outward_2.asp?direct=1&id="&outwardid&"&companyid="&newcompanyid&"&inward_second=yes&database=yestt='+timeNow;"
else
Response.Write "window.location ='outward_2.asp?id="&outwardid&"&companyid="&newcompanyid&"&inward_second=yes&database=yestt='+timeNow;"
end if
end if
Response.Write "else "
Response.Write "{alert(""注意:接下来将打印出库通知书!!!"");"
Response.Write "window.location ='direct_ward.asp?companyid="&newcompanyid&"&tt='+timeNow;"
Response.Write "window.open('chukutongzhi.asp?id="&outwardid&"&companyid="&newcompanyid&"&tt='+timeNow,'defghhchu');"
Response.Write "}"
Response.Write "}"
Response.Write "</script>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -