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

📄 update_chuku_sav.asp

📁 oracle9i程序事例集
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<%
  dim conn
  dim connstr
  Set conn=Server.CreateObject("ADODB.Recordset")
  connstr="Driver={Microsoft ODBC for Oracle};server=mylink;uid=system;pwd=system;"
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改出库清单</title>
<link href="../../MYDZSW/Css/bd_font_size.css" rel="stylesheet" type="text/css">
</head>

<body>
<%
  dim rs,sql,outpid,salenum,place,outdate,num,price,handle,remark

  set rs=server.createobject("adodb.recordset")

  pid=trim(request("outPID"))
  
  if trim(request("salenum"))="" then
    errmsg=errmsg+"<br>"+"<li>销售项号不能为空"
    founderr=true
  else
    salenum=trim(request("salenum"))
  end if
  
  if trim(request("Place"))="" then
    errmsg=errmsg+"<br>"+"<li>出库地点不能为空"
    founderr=true
  else
    place=trim(request("Place"))
  end if
  
  if trim(request("Date"))="" then
    errmsg=errmsg+"<br>"+"<li>出库日期不能为空"
    founderr=true
  else
    outdate=trim(request("Date"))
  end if
  
  if trim(request("Num"))="" then
    errmsg=errmsg+"<br>"+"<li>入库数量不能为空"
    founderr=true
  else
    num=trim(request("Num"))
  if Num=0 then
    errmsg=errmsg+"<br>"+"<li>入库数量不能为零"
    founderr=true
  end if
  end if
  
  if trim(request("Price"))="" then
    errmsg=errmsg+"<br>"+"<li>出库单价不能为空"
    founderr=true
  else
    price=trim(request("Price"))
  end if
  
  if trim(request("Handle"))="" then
    errmsg=errmsg+"<br>"+"<li>经手人不能为空"
    founderr=true
  else
    handle=trim(request("Handle"))
  end if
 
  remark=trim(request("Remark"))
  
  owenum=trim(request("owenum"))
  
  ctime=trim(request("ctime"))
  
  if founderr=false then
    sql="select sm_outpid, sm_outnum from GSCOTT.stock_management_table where sm_id="&request("id")
    rs.open sql,connstr
	oldnum=cint(rs("sm_outnum"))
	oldpid=rs("sm_outpid")
	rs.close
    sql="select product_stocknum,product_salenum from GSCOTT.Product_info_table where product_kindnum='"&pid&"'"
    rs.open sql,connstr,3,3
  if stocknum>=0 then
    if pid=oldpid then
	  rs("product_stocknum")=cint(rs("product_stocknum"))+cint(oldnum)-cint(num)
	  rs("product_salenum")=cint(rs("product_salenum"))-cint(oldnum)+cint(num)
	  rs.update
	else
	  rs("product_stocknum")=cint(rs("product_stocknum"))-cint(oldnum)
	  rs("product_salenum")=cint(rs("product_salenum"))+cint(oldnum)
	  rs.update
	  sql="select product_stocknum, product_salenum from GSCOTT.Product_info_table where product_kindnum='"&oldpid&"'"
	  rs.close
	  rs.open sql,connstr,3,3
	  rs("product_stocknum")=cint(rs("product_stocknum"))+cint(num)
	  rs("product_salenum")=cint(rs("product_salenum"))-cint(num)
	  rs.update
	end if
  else
	errmsg=errmsg+"<br>"+"<li>出库数量大于库存数量"
    founderr=true
  end if
  rs.close
  end if

%>

<div align="center">
<center>
<table border="0" width="528" height="500" cellspacing="0" cellpadding="0">
  <!--DWLayoutTable-->
<%  
  if founderr=false then
    sql="select * from GSCOTT.stock_management_table where sm_id="&request("id")
    rs.open sql,connstr,3,3
    rs("sm_outpid")=pid
    rs("sm_salenum")=salenum
    rs("sm_outplace")=place
    rs("sm_outdate")=outdate
    rs("sm_outnum")=num
    rs("sm_outprice")=price
    rs("sm_handle")=handle
    rs("sm_remark")=remark
	if rs("sm_arrearage")="是" then
	  rs("sm_num")=owenum
	  rs("sm_credittime")=ctime
	end if
    rs.update
	arrearage=rs("sm_arrearage")
	rs.close
    set rs=nothing
%>

<tr> 
  <td height="77" colspan="3" align="center" valign="middle"><strong><font size="5" face="黑体">出库清单修改成功</font></strong></td>
  <tr>
  <td height="27" colspan="2" align="right" valign="middle" class="bd_font_size">出库产品编号:</td>
    <td width="310" align="center" valign="middle"><%=pid%></td>
    
<tr>
  <td height="27" colspan="2" align="right" valign="middle" class="bd_font_size">销售项号:</td>
    <td align="center" valign="middle"><%=salenum%></td>
  
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right"> 出库地点:</div></td>
    <td align="center" valign="middle"><%=place%></td>
    
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right">出库日期:</div></td>
    <td align="center" valign="middle"><%=outdate%></td>
  
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right"> 出库数量:</div></td>
    <td align="center" valign="middle"><%=num%></td>
    
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right"> 出库单价:</div></td>
    <td align="center" valign="middle"><%=price%></td>
  
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right"> 经手人:</div></td>
    <td align="center" valign="middle"><%=handle%></td>
    
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right">是否欠款: </div></td>
    <td align="center" valign="middle"><%=arrearage%></td>
  
<tr>
  <td height="27" colspan="2" align="right" valign="middle" class="bd_font_size">欠款数量:</td>
    <td align="center" valign="middle"><%=owenum%></td>
    
<tr>
  <td height="27" colspan="2" align="right" valign="middle" class="bd_font_size">信用时间:</td>
    <td align="center" valign="middle"><%=ctime%></td>
  
<tr>
  <td height="27" colspan="2" valign="middle" class="bd_font_size"><div align="right">备注:</div></td>
    <td align="center" valign="middle"><%=remark%></td>
  
<tr align="center" valign="middle" class="bd_font_size">
  <td height="27" colspan="3"><a href="update_chuku.asp">修改出库清单</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../outlook_model/all_customer.asp">浏览全部出库清单</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../index.asp">返回主页</a></td>
  
<tr>
  <td width="180" height="27" align="center" valign="middle">输入的出库清单有问题</td> 
  <td colspan="2" align="center" valign="middle"><%=errmsg%></td>
  
<tr valign="middle" class="bd_font_size">
  <td height="57" colspan="3" align="center"><a href="javascript:history.go(-1)"><font size="-1">三秒钟后自动返回到上一页,如果您的浏览器没有返回,请单击此处</font></a></td>

<tr>
  <td height="15">&nbsp;</td>
  <td width="38"></td>
  <td></td>
  
  <% if arrearage="是" then %>
  <% end if %>

<%else%>
<meta http-equiv="refresh" content="3;url=javascript:history.go(-1)">
<%end if%>
</table>
</center>
</div>
</body>
</html>

⌨️ 快捷键说明

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