📄 mview.asp
字号:
<td style = 'width:120px;'><input type = 'text' name = 'stockMin' style = 'width:100%;' value = '<%=MstockMin%>'/></td>
</tr>
</table></td>
</tr>
<tr>
<td style = 'text-align:right;'>单位</td>
<td style = 'text-align:left;width:auto;'>
<table style = 'width:100%;' cellspacing = '0' cellpadding = '0'>
<tr>
<td style = 'width:120px;'><input type = 'text' name = 'unit' style = 'width:100%;' value = '<%=c01.HtmlF(Munit)%>'/></td>
<td style = 'width:65px; text-align:right;'>保修期 </td>
<td style = 'width:120px;'><input type = 'text' name = 'guarantyTime' style = 'width:100%;' value = '<%=c01.HtmlF(MguarantyTime)%>'/></td>
</tr>
</table></td>
</tr>
<tr>
<td style = 'text-align:right;'>保修描述</td>
<td style = 'text-align:left;width:auto;'><input type = 'text' style = 'width:100%;' name = 'guarantyRemark' value = '<%=c01.HtmlF(MguarantyRemark)%>'/></td>
</tr>
<tr>
<td style = 'text-align:right;'>中文描述</td>
<td style = 'text-align:left;width:auto;'><textarea name="cRemark" style = 'width:100%;height:40px;overflow-x:hidden;overflow-y:auto;'><%=c01.HtmlF(McRemark)%></textarea></td>
</tr>
<tr>
<td style = 'text-align:right;'>是否可用</td>
<td style = 'text-align:left;width:auto;'>
<select style = 'width:50px;' name = 'disabled'>
<option value = '1' <%=v1v2(Mdisabled,1," style = 'color:red;' selected = 'selected' ","")%>>可用</option>
<option value = '0' <%=v1v2(Mdisabled,0," style = 'color:red;' selected = 'selected' ","")%>>禁用</option>
</select>
<input type="checkbox" name="repetition" value = 'YES' style = 'border-style:none;' />检查商品名是否重复</td>
</tr>
<tr>
<td style = 'text-align:center;' colspan = '2'><input type="submit" name="Login" value = ' 修改 ' onclick = "javascript:if(document.form.mTypeSelect.value=='') {alert('请选好商品种类的小类! ');form.mTypeSelect.focus();return false;}else{return true;}"/></td>
</tr>
</form>
</table></fieldset>
<%
SumoutHow_ = SelectZD("select Sum(outHow) from salelist where stockid = " & stockid & "",0)
SumAmount_ = SelectZD("select Sum(Amount) from salelist where stockid = " & stockid & "",0)
if SumoutHow_ = 0 then
SumoutHow__ = 1
outOne = 0
YKB = 0
else
SumoutHow__ = SumoutHow_
outOne = SumAmount_/SumoutHow__
YKB = outOne - Minprice
end if
nowKC = Minhow-SumoutHow_
YKB_ = "平"
if YKB < 0 then YKB_ = "亏"
if YKB > 0 then YKB_ = "盈"
%>
<fieldset style = 'width:380px;padding:8px;'><legend>商品相关信息</legend>
<div style = 'text-align:left;width:100%;padding:1px;'>·该商品总进货:<%=Minhow & " " & Munit%></div>
<div style = 'text-align:left;width:100%;padding:1px;'>·该商品已销售:<%=SumoutHow_%></div>
<div style = 'text-align:left;width:100%;padding:1px;'>·该商品现库存:<%=nowKC%></div>
<div style = 'text-align:left;width:100%;padding:2px;'>·销售得总金额:¥<%=formatNumber(SumAmount_,2)%></div>
<div style = 'text-align:left;width:100%;padding:1px;'>·该商品盈亏数:<%=v1v2(AdminSelFlag("SeeinPrice",","),true,YKB_ & ":¥" & formatNumber(YKB,2) & "/" & Munit & " 总:¥" & formatNumber(YKB*SumoutHow_,2),"^_^")%></div>
</fieldset>
<%
Options = trim(Request.Form("Options"))
if Options = "Update" then
thisDate__ = trim(Request.form("thisDate"))
if not isDate(thisDate__)then thisDate__ = SELVAR("YY","0000") & "-" & SELVAR("MM","0000") & "-" & SELVAR("DD","0000")
mtypeid_ = GetText("mTypeSelect","P","number",1,10,0)'
mtypeid_ = SelectZD("select mtypeid from mtype where mtypeid = " & mtypeid_ & "",0)
if mtypeid_ = 0 then
Response.Write viewinfo("alertBack","请选好商品子类别!","")
Response.end
end if
supplierid_ = GetText("supplierid","P","number",1,10,0)'
supplierid_ = SelectZD("select uid from supplier where uid = " & supplierid_ & "",0)
if supplierid_ = 0 then
Response.Write viewinfo("alertBack","请选好所属商家!","")
Response.end
end if
cName = htmlencode(GetText("cName","P","Str",1,250,""),"Y")
if trim(Request.Form("repetition")) = "YES" then
if not Conn.Execute("select cName from stock where cName = '" & cName & "' and not stockid = " & Mstockid & "").eof then
Response.Write viewinfo("alertBack","已经存在(" & cName & ")这个商品名了!请起另一个商品名","")
Response.end
end if
end if
SQL = "select * from stock where stockid = " & Mstockid & ""
Rs.Open(SQL),Conn,1,3
oldinprice_ = GetText("oldinprice","P","number",1,10,0)'原来参考进货价
oldinhow_ = GetText("oldinhow","P","number",1,10,0)'原来进货数量
oldPH = oldinprice_*oldinhow_
inprice_ = GetText("inprice","P","number",1,10,0)'参考进货价
inhow_ = GetText("inhow","P","number",1,10,0)'数量
nowPH = inprice_ * inhow_
upSQL = "update stockm set totalmoney = ((totalmoney-" & oldPH & ")+" & nowPH & ") , nopayment = ((totalmoney-" & oldPH & ")+" & nowPH & ")-inpayment where stockNum = '" & Rs("stockNum") & "' and stockmid = " & Misstockid & ""
Conn.Execute(upSQL)
Rs("mtypeid") = mtypeid_
Rs("supplierid") = supplierid_
if AboutCount = "1" then Conn.Execute("update stockm set supplierid = " & supplierid_ & " , thisDate = '" & thisDate__ & "' where stockmid = " & Misstockid & "")
Rs("Code") = htmlencode(GetText("Code","P","Str",1,110,"none"),"Y")'代码
Rs("cName") = cName'中文名
Rs("model") = htmlencode(GetText("model","P","Str",1,250,"none"),"Y")'英文名
Rs("eName") = htmlencode(GetText("eName","P","Str",1,250,"none"),"Y")'英文名
Rs("eRemark") = htmlencode(GetText("eRemark","P","Str",1,10000,"none"),"Y")'英文备注
Rs("cRemark") = htmlencode(GetText("cRemark","P","Str",1,250,"none"),"Y")'中文备注
Rs("typeCode") = htmlencode(GetText("typeCode","P","Str",1,250,"none"),"Y")'型号条码
Rs("Quality") = htmlencode(GetText("Quality","P","Str",1,250,"none"),"Y")'性质-
Rs("unit") = htmlencode(GetText("unit","P","Str",1,100,"none"),"Y")'单位-
Rs("inprice") = inprice_
outprice_ = GetText("outprice","P","number",1,10,0)'参考预出售价
Rs("outprice") = outprice_
Rs("inhow") = inhow_
Rs("total") = inprice * inhow_
Rs("inpayment") = GetText("inpayment","P","number",1,10,0)'已支付给供应商
Rs("updatetime") = now '最后修改时间
Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期
Rs("guarantyRemark") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期备注
Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期
Rs("guarantyTime") = htmlencode(GetText("guarantyTime","P","Str",1,250,"none"),"Y")'保修期
Rs("stockMax") = GetText("stockMax","P","number",1,10,0)'库存上限
Rs("stockMin") = GetText("stockMin","P","number",1,10,0)'库存下限
Rs("disabled") = GetText("disabled","P","number",1,10,0)'是否可用
Rs("thisDate") = thisDate__
Rs("auid") = Seuid_inc'最后更新者id
Rs("inModel") = "直接录入" '入库模式-是直接录入或销售时同步录入
Rs("outhowed") = SelectZD("select Sum(outHow) from salelist where stockid = " & Mstockid & "",0)
Response.Write viewinfo("alertClose","商品修改成功!","")
Rs.update
Rs.Close
end if
Set c01 = nothing
ConnClose()
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -