📄 xiaoshou_add.asp
字号:
<!--#include file="../conn.asp"-->
<%
if request("action")="add" then
rowcount=int(trim(request.form("rowcount")))
thedate=request.form("thedate")
dianji=request.form("dianji")
company=request.form("company")
jingsren=request.form("jingsren")
cangku=request.form("cangku")
jintype=request.form("jintype")
delivenumber=request.form("delivenumber")
memo=request.form("memo")
if rowcount<=0 then
response.write"<script>alert('没有明细单');history.go(-1);</script>"
response.End()
end if
for i=0 to rowcount-1
textname="r"&i
minxi=trim(request.form(textname&"c1")) '明细单据
totnum=totnum+int(trim(request.form(textname&"c7"))) '总数量
totmoney=totmoney+int(trim(request.form(textname&"c8"))) '总钱
conn.execute("update ht_Stockdetail set stockhousename='"&cangku&"',type='"&jintype&"',companyname='"&company&"' where stockdetail_number='"&minxi&"'")
next
'***数字转成大写的
function moneytochinese(para)
je="零壹贰叁肆伍陆柒捌玖"
cdw="万仟佰拾亿仟佰拾万仟佰拾元角分"
newstring=trim(para*100) '去除小数点
newstringlong=len(newstring) '取得字符串长度
newdw=right(cdw,newstringlong) '取出字符串所用到的单位
num0=0
wan=0
dxje=""
for m=1 to newstringlong
xzf=mid(newstring,m,1) '取出数字字符
dzf=mid(je,xzf+1,1) '取出大写字符
dw=mid(newdw,m,1) '取出单位
if dzf="零" then
dzf=""
select case dw
case "亿"
case "万"
dzf=""
wan=1
case "元"
case else
dw=""
end select
num0=num0+1
else
if num0-wan>0 then
dzf="零"+dzf
end if
num0=0
end if
dxje=dxje+dzf+dw
next
if len(NewString)<>1 Then
If right(newstring,2)="00" then
dxje=dxje+"整"
Else
dxje=dxje
End if
End If
dxje=replace(dxje,"亿万","亿")
moneytochinese=dxje
end function
set rs=server.CreateObject("adodb.recordset")
sql="select * from ht_stockmaster"
rs.open sql,conn,1,3
rs.addnew
rs("stock_id")=dianji
rs("stock_date")=thedate
rs("stock_type")=jintype
rs("companyname")=company
rs("storehouse")=cangku
rs("totalnumber")=totnum
rs("totalmoney")=totmoney
rs("Totalitems")=rowcount '明细表总其几条
rs("delivenumber")=delivenumber
rs("TotalmoneyCN")=moneytochinese(totmoney)
rs("remark")=memo
rs.update
rs.close
end if
%>
<html>
<head>
<title>销售单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/body.css" rel="stylesheet" type="text/css">
<link href="../css/calendar-blue.css" rel="stylesheet" type="text/css">
<link href="jdingdan.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="../kuchun/ckNum.js"></script>
<script src="../Js/Calendar.js"></script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
function delRow()
{
var subid=document.ck.subid.value
if(subid=="")
{
alert("请选择一条记录!")
return false;
}
else if (subid.substr(0,3)=="new")
{
table1.deleteRow(subid.substr(3,4));
window.location.reload();
}
else
{
window.delrow.location='?id='+subid;
}
}
//-->
</script>
</head>
<body topmargin="3">
<form action="?action=add" name="ck" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr style="line-height:5px;">
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><fieldset style="height:120px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><fieldset style="height:120px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><font color="#800000" size="4" face="楷体CS"><strong> 销售单</strong></font></td>
<td>销 售 日 期:</td>
<td valign="bottom"><input name="thedate" class="inputfield" type="text" id="thedate" size="15" readonly="true" value="<%
if request("thedate")="" then
response.Write date()
else
response.Write request("thedate")
end if
%>">
<A onClick="return showCalendar('thedate', 'y-mm-dd');" href="#"><img src="../Images/Button.gif" id="IMG2" align="absMiddle" border="0" /></A></td>
<td>销 售 单 据 号:</td>
<%
dianji=year(date())&right("0"&month(date()),2)&right("0"&day(date()),2)
set rs1=conn.execute("select max(stockout_num) from ht_Stockoutmaster where Stockout_id like '"&dianji&"%'")
if rs1(0)>0 then
dianji=dianji&"XS"&right("00"&rs1(0)+1,3)
stockout_num=rs1(0)+1
'response.write rs1(0)&"sdfsdf"
else
dianji=dianji&"XS001"
stockout_num=1
end if
rs1.close
set rs1=nothing
%>
<td><input name="dianji" type="text" class="inputfield" id="dianji" value="<%=dianji%>" size="20" readonly="">
<input name="stockout_num" type="hidden" id="stockout_num" value="<%=stockout_num%>"></td>
</tr>
<tr>
<td height="90" colspan="5">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><fieldset>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td height="25">客户名称
<input name="kehu" type="text" id="kehu" size="20">
经
手 人
<input name="jingsren" type="text" id="jingsren" value="<%=session("user_name")%>" size="15" ></td>
</tr>
<tr>
<td height="26" align="left"> 仓 库
<select name="cangku" id="cangku">
<%
set rs=conn.execute("select * from ht_Storehouse")
if not rs.eof then
do while not rs.eof
response.Write("<option value="&rs("Storehouse_name")&">"&rs("Storehouse_name")&"</option>")
rs.movenext
loop
end if
rs.close()
set rs=nothing
%>
</select>
销售类型
<select name="jintype" id="jintype">
<%
set rs=conn.execute("select * from ht_Saletype")
if not rs.eof then
do while not rs.eof
response.Write("<option value="&rs("Saletype_name")&">"&rs("saletype_name")&"</option>")
rs.movenext
loop
end if
rs.close()
set rs=nothing
%>
</select> </td>
</tr>
<tr>
<td height="25">送货单号
<input name="delivenumber" type="text" class="inputfield" id="delivenumber" size="20">
<input name="subid" type="hidden" id="subid"></td>
</tr>
<tr>
<td height="25">备 注
<input name="memo" type="text" class="inputfield" id="memo" size="40"></td>
</tr>
</table>
</fieldset></td>
</tr>
</table></td>
</tr>
</table>
</fieldset></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr style="line-height:5px;">
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> <fieldset>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="170" valign="top" bgcolor="#E6F0F0"> <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#E6F0F0" frame="void" style="border-bottom:1px solid #CCCCCC">
<tr align="center">
<td width="1%" height="22" class="borderon2"> </td>
<td width="12%" class="borderon2">
<div>明细编号</div></td>
<td width="12%" class="borderon2">
<div>品种</div></td>
<td width="12%" class="borderon2">
<div>品牌</div></td>
<td width="12%" class="borderon2">
<div>型号</div></td>
<td width="12%" class="borderon2">
<div>颜色</div></td>
<td width="12%" class="borderon2">
<div>销售货价</div></td>
<td width="12%" class="borderon2">
<div>数量</div></td>
<td width="12%" class="borderon2">
<div>小计</div></td>
</tr>
<tr align="center">
<td colspan="10" bgcolor="#E6F0F0"><div style="OVERFLOW: auto; HEIGHT: 170px">
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#E6F0F0" frame="void" id="table1" style="border-bottom:1px solid #CCCCCC">
<tr align="center">
<td width="1%" bgcolor="#E6F0F0" class="borderon2">
<div align="center" id="1" width="1%" ></div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c1" type="text" id="r0c1" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c2" type="text" id="r0c2" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c3" type="text" id="r0c3" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c4" type="text" id="r0c4" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c5" type="text" id="r0c5" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c6" type="text" id="r0c6" size="10">
</div></td>
<td width="12%" class="inputfieldtd">
<div align="left">
<input name="r0c7" type="text" id="r0c7" size="10">
</div></td>
<td width="12%">
<div align="left">
<input name="r0c8" type="text" id="r0c8" size="10" >
</div></td>
</tr>
</table></div></td>
</tr>
</table></td>
</tr>
<tr>
<td> <table width="100%" height="25" border="0" cellpadding="0" cellspacing="0" style="border-top:1px solid #CCCCCC;">
<tr bgcolor="#BAD2D3">
<td width="2%"> </td>
<td width="10%"> </td>
<td width="11%"> </td>
<td width="11%"> <div align="center">
<input name="abc" type="text" id="abc2" style="background-color:#BAD2D3;" value=" 合 计 " size="10" readonly="true">
</div></td>
<td width="11%" align="center"> </td>
<td width="11%" align="center"> </td>
<td width="11%" align="center"> <input name="sum_amount" type="text" id="sum_amount2" style="background-color:#BAD2D3;" size="11" readonly="true">
</td>
<td width="11%" align="center"> </td>
<td width="11%" align="center"> <input name="sum_money" type="text" id="sum_money2" style="background-color:#BAD2D3;" size="11" readonly="true">
</td>
<td width="11%" align="center"> <input name="sum_shamount" type="text" id="sum_shamount2" style="background-color:#BAD2D3;" size="11" readonly="true"></td>
</tr>
</table></td>
</tr>
</table>
</fieldset></td>
</tr>
<tr>
<td width="95%" align="right"><br>
<input name="rowcount" type="hidden" id="rowcount" value="0">
<input type="button" name="Submit" value="增加明细表" onClick="MM_openBrWindow('xiaoshoudetail_add.asp?jindan=<%=dianji%>&cangku=','','width=530,height=360')">
<input type="button" name="Submit2" value="删除明细" onClick="delRow">
<input type="submit" name="wanchen" id="wanchen" value="增 加" disabled="disabled" > </td><td width="5%" align="right"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -