📄 outview.asp
字号:
var Flen = '';
Flen = form.len.length ;
for(i = 0 ; i<Flen ; i++) {
form.len[i].value = 'OP'+i ;
v = i ;
}
}
function op(v) {
var Flen = form.len.length ;
v_ = window.showModalDialog('<%=HOME_PATH%>merchandise/selectmlist.asp?Line='+v,'','dialogWidth:750px;dialogHeight:400px;scroll:yes;help:no;status:no;center:yes;edge:raised;');
if(v_==undefined) {
return false;
}else{
if(Flen==undefined) {
document.form.Code.value = replace_(v_[0],",",",");//商品代码
document.form.cName.value = v_[1];//中文名称
document.form.supplier.value = replace_(v_[2],",",",");//商品经销商相关信息
document.form.cRemark.value = replace_(v_[3],",",",");//商品中文描述
document.form.outPrice.value = replace_(v_[4],",",",");//商品出售价格
document.form.inHow.value = replace_(v_[5],",",",");//商品进货总数
document.form.supplieridout.value = replace_(v_[6],",",",");//商品经销商id
document.form.stockid.value = replace_(v_[7],",",",");//商品id
document.form.guarantyTime.value = replace_(v_[8],",",",");//保修期
ChangePrice();
}else{
for(ii = 0 ; ii < Flen ;ii++) {
if(v==ii) {
if(v_!=null) {
document.form.Code[v].value = replace_(v_[0],",",",");//商品代码
document.form.cName[v].value = v_[1];//中文名称
document.form.supplier[v].value = replace_(v_[2],",",",");//商品经销商相关信息
document.form.cRemark[v].value = replace_(v_[3],",",",");//商品中文描述
document.form.outPrice[v].value = replace_(v_[4],",",",");//商品出售价格
document.form.inHow[v].value = replace_(v_[5],",",",");//商品进货总数
document.form.supplieridout[v].value = replace_(v_[6],",",",");//商品经销商id
document.form.stockid[v].value = replace_(v_[7],",",",");//商品id
document.form.guarantyTime[v].value = replace_(v_[8],",",",");//保修期
ChangePrice();
}
}
}
}
}
}
//-->
</script>
</head>
<body style = 'margin:0px;background-color:menu;border-style:none;' scroll = 'no'>
<div style = 'text-align:center;'>
<%
Set c01 = new CL01
Options = trim(Request.Form("Options"))
if Options = "update" then
thisDate = trim(Request.form("thisDate"))'日期(搜索用)
if not isDate(thisDate) then thisDate = SELVAR("YY",Year(now)) & "-" & SELVAR("MM",month(now)) & "-" & SELVAR("DD",day(now))
stockid = trim(Request.form("stockid"))'商品id
supplierid = trim(Request.form("supplieridout"))'经销商id
outHow = trim(Request.form("outHow"))'出售数量
outPrice = trim(Request.form("outPrice"))'出售价
shuilv = trim(Request.form("shuilv"))'税率
saleLens = trim(Request.form("lena"))'行数 - 子记录id
saleid__ = isNumber(trim(Request.Form("saleid")),"int",0)
saleList = c01.splitList(saleLens,",",0)
UboundCount_ = Ubound(Split(saleList,","))
dim intoAdd
intoAdd = 0
for i_m = 0 to UboundCount_
if isNumber(tempSplit(supplierid,",",i_m,0),"int",0) = 0 or isNumber(tempSplit(stockid,",",i_m,0),"int",0) = 0 then
intoAdd = intoAdd
else
intoAdd = intoAdd+1
end if
next
if intoAdd > 0 and not saleid__ = 0 then
supplierid___ = GetText("supplierid","P","number",1,10,0)
if SelectZD("select uid from supplier where uid = " & supplierid___ & "",0) = 0 then
'Response.Write viewinfo("alertBack","不存在的客户!",SELVAR("FN",""))
supplierid___ = 0
'Response.end
end if
Call SaleAdd(saleLens,AmountALL,tinfo_)
Public Sub SaleAdd(saleLens,AmountALL,tinfo_)
saleList = c01.splitList(saleLens,",",0)
UboundCount_ = Ubound(Split(saleList,","))
for i_add = 0 to UboundCount_
saleLens_ = isNumber(tempSplit(saleLens,",",i_add,0),"int",0)
stockid_ = isNumber(tempSplit(stockid,",",i_add,0),"int",0)
supplierid_ = isNumber(tempSplit(supplierid,",",i_add,0),"int",0)
outHow_ = isNumber(tempSplit(outHow,",",i_add,0),"int",0)
outPrice_ = isNumber(tempSplit(outPrice,",",i_add,0),"dec",0)
shuilv_ = isNumber(tempSplit(shuilv,",",i_add,0),"dec",0)
if supplierid_ = 0 or stockid_ = 0 then
tinfo = "行[" & i_add & "]更新失败.因为该行的商品或经销商不存在!<br/>"
else
Rs.Open("select * from salelist where salelistid = " & saleLens_ & " and saleid = " & saleid__ & ""),Conn,1,3
if not Rs.eof then
oldStockid = Rs("stockid")
oldoutHow = Rs("outHow")
if stockid_ = oldStockid then '如果更新的是原来商品
oldoutHow = Rs("outHow")
Conn.Execute("update stock Set outhowed = " & (SelectZD("select Sum(outHow) from salelist where stockid = " & stockid_ & "",0)-oldoutHow)+outHow_ & " where stockid = " & oldStockid & "")
else
Conn.Execute("update stock Set outhowed = " & (SelectZD("select Sum(outHow) from salelist where stockid = " & stockid_ & "",0)+outHow_) & " where stockid = " & stockid_ & "")'更新新商品库存
Conn.Execute("update stock Set outhowed = " & (SelectZD("select Sum(outHow) from salelist where stockid = " & oldStockid & "",0)-oldoutHow) & " where stockid = " & oldStockid & "") '更新原来商品库存
end if
Rs("stockid") = stockid_
Rs("supplierid") = supplierid_
Rs("outHow") = outHow_
Rs("outPrice") = outPrice_
Rs("shuilv") = shuilv_
Rs("Amount") = outHow_ * (outPrice_+(outPrice_ * shuilv_/100))
Rs("thisDate") = thisDate
Rs.update
else
tinfo = "行[" & i_add & "]更新失败.因为该行的记录不存在!<br/>"
end if
Rs.Close
end if
tinfo_ = tinfo_ & tinfo
AmountALL = AmountALL + (outHow_ * (outPrice_+(outPrice_ * shuilv_/100)))
next
End Sub
SQL = "select * from sale where saleid = " & saleid__ & ""
Rs.Open(SQL),Conn,1,3
Rs("plNum") = htmlencode(GetText("plNum","P","Str",1,110,""),"Y")'发票号
Rs("supplierid") = supplierid___'客户id (如果是0.则为(不在客商列表中的临时temp用户))
Rs("supplierName") = htmlencode(GetText("supplierName","P","Str",1,250,"none"),"Y") '
Rs("Linkman") = htmlencode(GetText("Linkman","P","Str",1,250,"none"),"Y")
Rs("thisDate") = thisDate
ZJ_ = GetText("ZJ","P","number",1,10,0)'折减
Rs("ZJ") = ZJ_
Rs("updatetime") = now '更新时间
'AmountALL_ = GetText("AmountALL","P","number",1,10,0) '该单总价格
Rs("Amount") = AmountALL '该单总价格
shuilvALL = GetText("shuilvALL","P","number",1,10,0)'整单税率
Rs("shuilvALL") = shuilvALL
'AmountshuilvALL_ = GetText("AmountshuilvALL","P","number",1,10,0) '含税总金额
AmountshuilvALL_ = AmountALL + (AmountALL*shuilvALL/100)
Rs("AmountshuilvALL") = AmountshuilvALL_ '含税总金额
nowpayment_ = GetText("nowpayment","P","number",1,10,0) '已经支付
Rs("nowpayment") = nowpayment_
nopayment_ = GetText("nopayment","P","number",1,10,0) '未支付
Rs("nopayment") = AmountshuilvALL_ - (nowpayment_ + ZJ_)
Rs("intoaid") = Seuid_inc '录入者id
Rs("selectaid") = GetText("aid","P","number",1,10,0) '选择的操作员id
tinfo_ = tinfo_ & "正在执行更新操作.请稍候…"
Rs.update
Rs.Close
Public Function tempSplit(vin,sgin,isStep,LasttempSplit)
if vin = "" or isnull(vin) then
exit function
end if
vinSplit = Split(Replace(vin," ",""),sgin)
SplitCount = UBound(Split(vin,sgin))
if isStep > SplitCount then
tempSplit = LasttempSplit
exit function
end if
tempSplit = vinSplit(isStep)
End Function
else
tinfo_ = "保存不成功.因为没有选择任何商品销售!"
end if
Response.Write viewinfo("divLoca",tinfo_,"")
Response.Write viewinfo("LocaTimeself","",SELVAR("FN","outview.asp") & "?saleid=" & saleid)
Response.Write"<script type = 'text/javascript'>if(window.opener){window.opener.location.reload();}</script>"
end if
%>
<table border = '0' cellspacing = '0' cellpadding = '1' borderColorLight='#848284' borderColorDark='#eeeeee' style = 'width:100%;height:auto; background-color:buttonface; border-left: 0px solid buttonhighlight; border-right: 0px solid buttonshadow;color: #FF9900;border-top: 0px solid buttonhighlight; border-bottom: 1px solid buttonshadow;padding: 1px ;'/>
<tr>
<form method='post' action="<%=SELVAR("FN","outview.asp")%>" name = 'form' id = 'form' >
<input type = 'hidden' name = 'Options' value = 'update' />
<input type = 'hidden' name = 'saleid' value = '<%=saleid%>'/>
<td style = 'width:auto;'> </td>
<td style = 'width:10px;'></td>
<td style = 'width:35px; height:33px;'><div class = 'bar' style = 'width:35px; height:33px;'> <a href = "javascript:form.submit();" onclick ="onclick_();return newSupplier();"><img src="../images/save00.gif" width="35" height="33" border="0" alt="保存"></a></div></td>
<td style = 'width:10px;'></td>
<td style = 'width:35px; height:33px;'><div class = 'bar' style = 'width:35px; height:33px;'> <a href = "javascript:form.reset();" ><img src="../images/reset00.gif" width="35" height="33" border="0" alt="取消"></a></div></td>
<td style = 'width:10px;'></td>
<td style = 'width:35px; height:33px;'><div class = 'bar' style = 'width:35px; height:33px;'><a href = "javascript:location.reload();" /><img src="../images/reload00.gif" width="35" height="33" border="0" alt="刷新"></div></td>
<td style = 'width:10px;'></td>
</tr>
</table>
<div style = 'width:100%;text-align:left;background-color:buttonface; border-left: 0px solid buttonhighlight; border-right: 0px solid buttonshadow;color: #FF9900;border-top: 1px solid buttonhighlight; border-bottom: 1px solid buttonshadow;padding: 1px ;'>
<table style = 'width:auto;' cellspacing = '0' cellpadding = '1' border ='0' class = 'tempA'>
<tr>
<td> </td>
<td> 销售日期 </td>
<td style = 'width:80px;'><input type = 'text' name="thisDate" onfocus="setday(this)" size="9" maxlength="10" readonly value = '<%=thisDate%>'/></td>
<td> 发票号码 </td>
<td style = 'width:80px;'><input type = 'text' name = 'plNum' style = 'width:100%' value = '<%=plNum%>'/></td>
<td> 销售号码 </td>
<td style = 'width:90px;'><input type = 'text' name = 'saleNum' style = 'width:100%' value = '<%=saleNum%>' readonly/></td>
<td style = 'text-align:right;width:60px;'> 客户代码 </td>
<td style = 'width:80px;'><input type = 'text' name = 'supplierCode' style = 'width:70%;border-right-style:none;' value = '<%=USCode%>'/><input type = 'button' value = '…' style = 'border-left-style:none;' onclick = "javascript:Opensupplier();"/></td>
<td style = 'text-align:right;width:60px;'> 名称 </td>
<td style = 'width:110px;'><input type = 'text' name = 'supplierName' style = 'width:100%' class='tempB' value = '<%=USFullName%>'/></td><input type = 'hidden' name = 'supplierid' readonly value = '<%=USuid%>'/>
<td style = 'text-align:right;width:60px;'> 联系 </td>
<td style = 'width:120px;'><input type = 'text' name = 'Linkman' style = 'width:100%' class='tempB' value = '<%=Replace(USLinkman & " " & USLinkPhone," "," ")%>'/></td>
</tr>
</table>
</div>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -