?? spxsth.asp
字號:
<!--#include file="../conn/conn.asp"-->
<%
yf=0
wf=0
set conn=server.createobject("adodb.connection")
conn.open application("dsn")
%>
<%'顯示商品信息
set rs_id=server.createobject("adodb.recordset")
sql="select * from tab_sell_main"
rs_id.open sql,conn,1,3
if request.QueryString("selectid")<>"" then
selid=request.QueryString("selectid")
else
selid=rs_id("sellid")
End if
set rs=server.createobject("adodb.recordset")
sql="select * from tab_sell_detail sell inner join tab_spinfo sp on sell.spid=sp.id where sell.id='"&selid&"'"
rs.open sql,conn,1,3
set rs_1=server.createobject("adodb.recordset")
sql="select * from tab_sell_main where sellid='"&selid&"'"
rs_1.open sql,conn,1,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>商品入庫</title>
<link href="../style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form action="spxsth_deal.asp" method="post" name="myform">
<table width="97%" border="0" align="center" class="tableBorder" cellpadding="0" cellspacing="0">
<tr>
<td height="25" nowrap bgcolor="#FF9933" class="word_white"> 當前位置:商品銷售> 商品銷售退貨> 商品銷售退貨登記單 >>></td>
</tr>
<tr>
<td height="10" nowrap bgcolor="#CCE3FF" class="word_white"></td>
</tr>
<tr align="center">
<td height="44" valign="top" nowrap bgcolor="#CCE3FF">
<table width="99%" height="34" border="0" cellpadding="-2" cellspacing="-2" bordercolor="#CCE3FF" bordercolorlight="#FFFFFF" bordercolordark="#CCE3FF" class="tableBorder">
<tr>
<td width="13%" height="32" align="center" nowrap>請選擇銷售單號:</td>
<script language="javascript">
function selxsID(para){
url="spxsth.asp?selectid="+para;
window.location.href=url;
}
</script>
<td width="37%" bgcolor="#CCE3FF" >
<select name="xsID" id="xsID" onChange="selxsID(this.value)">
<%for j=1 to rs_id.recordcount%>
<option value="<%=rs_id("sellid")%>" <%if rs_id("sellid")=selid then response.Write(" selected")%>><%=rs_id("sellid")%></option>
<%rs_id.movenext
next%>
</select></td>
<td width="9%" align="right" bgcolor="#CCE3FF" >操作員:</td>
<td width="13%" bgcolor="#CCE3FF" ><input type="text" name="czy" value="<%=session("name")%>" size="12" onKeyUp="k3()" readonly="yes"></td>
<td width="9%" align="right">退貨時間:</td>
<td width="19%" ><input type="text" name="xsdate" readonly="yes"value="<%=now()%>" size="18"></td>
</tr>
</table></td>
</tr>
<tr align="center" valign="top"bgcolor="#CCE3FF">
<td height="100" nowrap><table width="99%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#9CA6C6" bordercolordark="#CCE3FF">
<tr align="center" bgcolor="#CCE3FF">
<td width="30%" height="24">商品名稱</td>
<td width="21%">規格</td>
<td width="17%">單價</td>
<td width="14%">數量</td>
<td width="18%">退貨數量</td>
</tr>
<%
pzs=rs.recordcount
for i=1 to rs.recordcount%>
<tr>
<td height="26" class="word_yellow" style="padding-left:5px;"><%=rs("spname")%><font color="#0099ff">
<input name="spid<%=i%>" type="hidden" id="spid<%=i%>" value="<%=rs("spid")%>">
</font></td>
<td class="word_yellow" style="padding-left:5px;"><%=rs("gg")%></td>
<td align="center" class="word_yellow"><%=rs("dj")%>(元)<font color="#0099ff">
<input name="dj<%=i%>" type="hidden" id="dj<%=i%>" value="<%=rs("dj")%>">
</font></td>
<td align="center" class="word_yellow"><%=rs("sl")%><font color="#0099ff"> [ <%=rs("dw")%>]
<input name="ysl<%=i%>" type="hidden" id="ysl<%=i%>" value="<%=rs("sl")%>">
</font></td>
<script language="javascript">
function deal(thsl,ysl,dj,pzs){
if(isNaN(thsl.value)){
alert("您輸入的退貨數量有誤!");
thsl.focus();
return;
}
if(thsl.value-ysl.value>0){
alert("退貨數量不能大于銷售數量!");
thsl.focus();
return;
}
var yf=0; //獲取應付金額
for(i=1;i<=pzs;i++){
sl=myform.elements["thsl"+i].value;
dj=myform.elements["dj"+i].value;
yf=yf+(dj*sl);
}
myform.yf.value=yf;
myform.wf.value=yf-myform.sf.value;
}
</script>
<td align="center" class="word_yellow"><input name="thsl<%=i%>" type="text" id="thsl" onBlur="deal(this.form.<%="thsl"&i%>,this.form.<%="ysl"&i%>,this.form.<%="dj"&i%>,<%=pzs%>)" onKeyUp="if(event.keyCode==13) myform.jsr.focus()" value="0" size="10">
<font color="#0099ff"> [ <%=rs("dw")%>]</font></td>
</tr>
<%rs.movenext
next%>
<tr>
<td height="26" colspan="5"><table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width="38%"class="word_yellow" style="padding-left:5px;">客戶全稱:<%=rs_1("khname")%><font color="#0099ff">
<input name="khname" type="hidden" value="<%=rs_1("khname")%>">
</font> </td>
<td width="15%"class="word_yellow">經手人:<%=rs_1("jsr")%></td>
<td width="16%"class="word_yellow"> 操作員:<%=rs_1("czy")%></td>
<td width="29%" align="right"class="word_yellow">銷售日期:<%=rs_1("xsdate")%></td>
<td width="2%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCE3FF">
<td height="29" align="center" nowrap>
<table width="99%" border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
<tr>
<td width="12%" height="30" align="center" nowrap>結算方式:</td>
<td width="28%"><select name="jsfs">
<option value="現金" selected>現金 </option>
<option value="支票">支票 </option>
<option value="掛賬">掛賬 </option>
<option value="預付">預付 </option>
</select></td>
<script language="javascript">
function send(){
ifth=0;
for(i=1;i<=<%=pzs%>;i++){
sl=myform.elements["thsl"+i].value;
if (sl!=0){
ifth=1;
break;
}
}
if(ifth==0){
alert("請輸入退貨數量!");return;
}
if(myform.jsr.value==""){
alert("請輸入經手人!");myform.jsr.focus();return;
}
if(myform.yf.value==0){
alert("請選擇想要入庫的商品!");return;
}
myform.submit();
}
</script>
<td width="7%">應付:</td>
<td width="26%"><input name="yf" type="text" readonly="yes" id="yf2" value="<%=yf%>" size="12">
(元) </td>
<td width="9%" align="center">未 付:</td>
<td width="18%" ><input name="wf" type="text" id="wf2" value="<%=wf%>" size="12" readonly="yes">
(元)</td>
</tr>
<tr>
<td height="30" align="center" nowrap> 實 付:</td>
<script language="javascript">
function calc_wf(){
if(isNaN(myform.wf.value)){
alert("您輸入的實付金額有誤!");
myform.sf.focus();
return;
}
myform.wf.value=myform.yf.value-myform.sf.value;
}
</script>
<td colspan="3"><input type="text" name="sf" size="12" value="0" onBlur="calc_wf()" onKeyUp="if(event.keyCode==13) myform.jsr.focus()">
(元)<font color="#FF0000">*</font> </td>
<td align="center">經手人:</td>
<td>
<input name="jsr" type="text" value="" size="12" onKeyUp="if(event.keyCode==13) myform.save.focus()">
<font color="#FF0000">*</font> </td>
</tr>
</table></td>
</tr>
<tr bgcolor="#CCE3FF">
<td nowrap align="center" height="37"> <input name="save" type="button" class="btn_grey" id="save" onClick="send()" value="確定退貨">
<input name="cancel" type="reset" class="btn_grey" id="cancel" value="取消操作">
<input name="pzs" type="hidden" id="pzs" value="<%=rs_1("pzs")%>">
</td>
</tr>
</table>
</form>
<!--#include file="../Bottom.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -