?? 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 + -