📄 odd_edit.asp
字号:
<%@ LANGUAGE="VBSCRIPT" %>
<%
response.buffer=true
Response.Expires = 0
Response.CacheControl = "Private"
%>
<%const title="出库详细信息修改"%>
<!-- #include file=../data/username.inc-->
<!-- #include file=../data/connect.asp-->
<!--#include file=../data/myPrg.asp-->
<%
if isempty(session("username")) then
call closedatabase
Response.Write "请重新登入!"
Response.End
end if
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
%>
<html>
<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">
<script language="javascript">
function confirmDel(id){
if ( confirm("你确定要删除系统编号为"+id+"的入库记录吗?")) {
window.location.href = "odd_edit.asp?action=delete&companyid=<%=newcompanyid%>&id=" + id;
}
}
</script>
</head>
<body topmargin="0" onload="javascript:self.moveTo(0,0)">
<%
arra = split(session("username"),";")
UserCompanyid = arra(0)
flag = arra(1)
User = arra(2)
userno = arra(4)
elink_id = request("id")
if not isnumeric(elink_id) then
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "alert(""ID必须为数字!"");"
Response.write "history.go(-1);"
Response.Write "</script>"
Response.End
end if
if flag > 4 then
call closedatabase
Response.End
end if
'删除记录
'先删除易联单号所在的记录,然后检测OUTWARD表相关的记录,若无该委托单号的其他记录,
'则将OUTWARD表中的相关记录也删除;否则保留
curaction = request("action")
if cstr(curaction) = "delete" then
sql = "select * from outward_elink where elink_id = "&elink_id&""
set rs_delete = server.CreateObject("adodb.recordset")
rs_delete.Open sql,conn,3,2
if not rs_delete.eof then
elink_flag = rs_delete("elink_flag")
elink_dir_flag = rs_delete("elink_dir_flag")
elink_outw_id = rs_delete("elink_outw_id")
dc_id = rs_delete("elink_dc_id")
guest_id = rs_delete("elink_guest_id")
sql = "select * from outward_detail where detail_outw_id = "&elink_outw_id&" and detail_guest_id = "&guest_id&" order by detail_id asc "
set rs_detail = conn.execute(sql)
dim detail_flag
detail_flag = 0
if not rs_detail.eof then
do while not rs_detail.eof
if detail_flag = 0 then
detail_id = rs_detail("detail_id")
sql = "delete from detail_info where info_outw_id = "&elink_outw_id&" and info_detail_id = "&detail_id&" "
conn.execute(sql)
detail_flag = 1
end if
prod_id = rs_detail("detail_prod_id")
detail_no = rs_detail("detail_no")
if elink_dir_flag = 0 then
if elink_flag <> 1 then
sql = "update inventory set inve_fenpei = inve_fenpei - "&detail_no&",inve_maysent = inve_maysent + "&detail_no&",inve_total = inve_total + "&detail_no&" where inve_dc_id = "&dc_id&" and inve_prod_id = "&prod_id&" "
elseif elink_flag = 1 then
sql = "update inventory set inve_chuku = inve_chuku - "&detail_no&",inve_maysent = inve_maysent + "&detail_no&",inve_total = inve_total + "&detail_no&" where inve_dc_id = "&dc_id&" and inve_prod_id = "&prod_id&" "
end if
conn.execute(sql)
end if
rs_detail.movenext
loop
sql = "delete from outward_detail where detail_outw_id = "&elink_outw_id&" and detail_guest_id = "&guest_id&" "
conn.execute(sql)
rs_delete.Delete
'2002年11月6号修改
'不应一outward_elink表为参照,假设该SRA尚有未分拣的记录
'sql = "select * from outward_elink where elink_outw_id = "&elink_outw_id&" "
sql = "select * from outward_detail where detail_outw_id = "&elink_outw_id&" "
set rs_ot = conn.execute(sql)
if rs_ot.eof then
sql = "delete from outward where outw_id = "&elink_outw_id&" "
conn.execute(sql)
end if
rs_ot.close
set rs_ot = nothing
end if
rs_detail.close
set rs_detail = nothing
end if
rs_delete.close
set rs_delete = nothing
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "{opener.location.reload();window.close();}"
Response.Write "</script>"
Response.End
end if
if Request.ServerVariables("REQUEST_METHOD")="POST" then
outw_dir_flag = request("outw_dir_flag")
if outw_dir_flag = "True" then
outw_take_address = trim(request("outw_take_address"))
outw_line_no = trim(request("outw_line_no"))
if outw_line_no = "" then
outw_line_no = " "
else
outw_line_no = replace(outw_line_no,"'","’")
end if
outw_take_no = trim(request("outw_take_no"))
if outw_take_no = "" then
outw_take_no = " "
else
outw_take_no = replace(outw_take_no,"'","’")
end if
end if
outw_date = trim(request("outw_date"))
outw_date = replace(outw_date,":",":")
outw_consign_date = trim(request("outw_consign_date"))
outw_consign_date = replace(outw_consign_date,":",":")
guest_id = clng(request("guest_id"))
guest_id_before = clng(request("guest_id_before"))
outw_type = request("outw_type")
info_takeman_id = trim(request("info_takeman_id"))
if info_takeman_id = "" then
info_takeman_id = " "
else
info_takeman_id = replace(info_takeman_id,"'","’")
end if
info_yuji_time = trim(request("info_yuji_time"))
info_yuji_time = replace(info_yuji_time,":",":")
info_order_beizu = trim(request("info_order_beizu"))
if info_order_beizu = "" then
info_order_beizu = " "
else
info_order_beizu = replace(info_order_beizu,"'","’")
end if
stock_flag = request("stock_flag")
if stock_flag = "True" then
outw_outstock_date = trim(request("outw_outstock_date"))
outw_outstock_date = replace(outw_outstock_date,":",":")
outw_stock_operate = trim(request("outw_stock_operate"))
outw_stock_beizu = trim(request("outw_stock_beizu"))
if outw_stock_beizu = "" then
outw_stock_beizu = " "
else
outw_stock_beizu = replace(outw_stock_beizu,"'","’")
end if
end if
cull_date = trim(request("cull_date"))
cull_date = replace(cull_date,":",":")
fact_weight = trim(request("fact_weight"))
if fact_weight = "" then fact_weight = 0
tally_weight = trim(request("tally_weight"))
if tally_weight = "" then tally_weight = 0
cull_operate = trim(request("cull_operate"))
if cull_operate = "" then
cull_operate = " "
else
cull_operate = replace(cull_operate,"'","’")
end if
cull_beizu = trim(request("cull_beizu"))
if cull_beizu = "" then
cull_beizu = " "
else
cull_beizu = replace(cull_beizu,"'","’")
end if
attemper = request("attemper")
if attemper <> "" then
send_date = trim(request("send_date"))
send_date = replace(send_date,":",":")
end if
elink_flag = request("elink_flag")
if elink_flag = 1 then
rec_date = trim(request("rec_date"))
rec_date = replace(rec_date,":",":")
rec_man = trim(request("rec_man"))
rec_idcard = trim(request("rec_idcard"))
if rec_idcard = "" then rec_idcard = " "
rec_beizu = trim(request("rec_beizu"))
if rec_beizu = "" then
rec_beizu = " "
else
rec_beizu = replace(rec_beizu,"'","’")
end if
end if
detail_outw_id = request("detail_outw_id")
stock_flag = request("stock_flag")
sql = "select * from outward where outw_id = "&detail_outw_id&" "
set rs_dir = server.CreateObject("adodb.recordset")
rs_dir.Open sql,conn,3,2
if not rs_dir.EOF then
if outw_dir_flag = "True" then
rs_dir("outw_take_address") = outw_take_address
rs_dir("outw_line_no") = outw_line_no
rs_dir("outw_take_no") = outw_take_no
end if
if stock_flag = "True" then
rs_dir("outw_outstock_date") = outw_outstock_date
rs_dir("outw_stock_operate") = outw_stock_operate
rs_dir("outw_stock_beizu") = outw_stock_beizu
end if
rs_dir("outw_date") = outw_date
rs_dir("outw_consign_date") = outw_consign_date
rs_dir.Update
end if
rs_dir.Close
set rs_dir = nothing
if guest_id <> guest_id_before then
'查看是否是合并用户。在此不允许合并
'2003-1-21修改
sql = "select * from outward_detail where detail_guest_id = "&guest_id&" and detail_outw_id = "&detail_outw_id&" "
set rset2 = server.createobject("adodb.recordset")
rset2.open sql,conn,1,1
if rset2.eof then
sql = "update outward_detail set detail_guest_id = "&guest_id&" where detail_outw_id = "&detail_outw_id&" and detail_elink_id = "&elink_id&" "
conn.execute(sql)
rset2.close
set rset2 = nothing
else
rset2.close
set rset2 = nothing
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "{alert(""由于该委托单号已有该客户存在,所以不能修改该客户的地址!!!"");history.back(-1);}"
Response.Write "</script>"
response.end
end if
end if
detail_id = request("detail_id")
sql = "select * from detail_info where info_outw_id = "&detail_outw_id&" and info_detail_id = "&detail_id&" "
'response.write sql
'response.end
set rs_info = server.CreateObject("adodb.recordset")
rs_info.Open sql,conn,3,2
if not rs_info.EOF then
rs_info("info_type") = outw_type
rs_info("info_takeman_id") = info_takeman_id
rs_info("info_yuji_time") = info_yuji_time
rs_info("info_order_beizu") = info_order_beizu
rs_info.Update
end if
rs_info.Close
set rs_info = nothing
sql = "select * from outward_elink where elink_id = "&elink_id&" "
set rs_elink = server.CreateObject("adodb.recordset")
rs_elink.Open sql,conn,3,2
if not rs_elink.EOF then
if attemper <> "" then
rs_elink("send_date") = send_date
end if
rs_elink("cull_date") = cull_date
rs_elink("fact_weight") = fact_weight
rs_elink("tally_weight") = tally_weight
rs_elink("cull_operate") = cull_operate
rs_elink("cull_beizu") = cull_beizu
rs_elink("elink_guest_id") = guest_id
if elink_flag = 1 then
rs_elink("rec_date") = rec_date
rs_elink("rec_man") = rec_man
rs_elink("rec_idcard") = rec_idcard
rs_elink("rec_beizu") = rec_beizu
end if
rs_elink.Update
end if
rs_elink.Close
set rs_elink = nothing
call closedatabase
Response.Write "<script language=javascript>"
Response.Write "{opener.location.reload();window.close();}"
Response.Write "</script>"
else
sql="select min(detail_id) as detail_id,min(detail_outw_id) as detail_outw_id,min(detail_guest_id) as detail_guest_id from outward_detail where detail_elink_id = "&elink_id&""
set rs_er = conn.execute(sql)
if not rs_er.eof then
detail_id = rs_er("detail_id")
detail_outw_id = rs_er("detail_outw_id")
guest_id = rs_er("detail_guest_id")
else
rs_er.close
set rs_er = nothing
call closedatabase
Response.Write "该记录已被删除!"
Response.End
end if
rs_er.close
set rs_er = nothing
sql = "select * from outward where outw_id = "&detail_outw_id&""
'Response.Write sql
'Response.End
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,3,2
if not rs.eof then
outw_date = rs("outw_date")
outw_fact_date = rs("outw_fact_date")
outw_consign_date = rs("outw_consign_date")
outw_sra = rs("outw_sra")
outw_dc_id = rs("outw_dc_id")
outw_outstock_date = rs("outw_outstock_date")
outw_stock_beizu = rs("outw_stock_beizu")
outw_stock_man = rs("outw_stock_man")
outw_stock_operate = rs("outw_stock_operate")
outw_flag = rs("outw_flag")
outw_dir_flag = rs("outw_dir_flag")
outw_take_address = trim(rs("outw_take_address"))
outw_line_no = trim(rs("outw_line_no"))
outw_take_no = trim(rs("outw_take_no"))
outw_service_beizu = rs("outw_service_beizu")
outw_service_man = rs("outw_service_man")
stock_flag = rs("stock_flag")
cull_flag = rs("cull_flag")
attemper_flag = rs("attemper_flag")
%>
<form action="odd_edit.asp" method="POST" name="output1">
<table align=center width=100% cellspacing='0' cellpadding='0' bordercolorlight='#000000'bordercolordark='#FFFFFF'bgcolor='#DADBFC' border="1">
<tr>
<td colspan=4 align=center bgcolor=red><b><font color=yellow>出库记录详细信息一览</font></b></td>
</tr>
<%
dim ziti_flag
if outw_dir_flag = true then
ziti_flag = 1
%>
<tr>
<td colspan=4 align=left bgcolor=green height=20><b><font color=white> 自 提 信 息</font></b></td>
</tr>
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -