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

📄 dx_dispose.asp

📁 功能介绍: 1、产品入库
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="Inc/Config.asp"-->
<!--#include file="inc/Dx_admin_check.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=WebName%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Css/style.css" rel="stylesheet" type="text/css">
<script language="javascript" src="Js/Fun.js"></script>
<script language="javascript" src="Ajax/Ajax_func.js"></script>
<style>
body {
	background-color:#FFFFFF;
}
</style>
<%
maxproduit=15
if request.Form.count>0 then
newCustom=trim(request.Form("newCustom"))
account=trim(request.Form("account"))
priceAll=trim(request.Form("priceAll"))'销售总价,
buy_priceAll=0'所有商品的成本价
if newCustom<>"" then'添加新客户
sql="select * from [dx_consumer] where dx_consumer_name='"&newCustom&"'"
rs.open sql,conn,1,3
 if rs.eof or rs.bof then
 rs.addnew
 rs("dx_consumer_name")=newCustom
 rs.update
 else
 Call ShowErr("用户名已经存在","1")
 end if
rs.close
sql="select * from [dx_consumer] where dx_consumer_name='"&newCustom&"'"
rs.open sql,conn,1,3
Custom_id=rs("dx_consumer_id")
rs.close
else
Custom_id=request.Form("custom")
end if

'出货单添加
dx_OutList_user=request.Form("opUser")
sql="select * from [dx_OutList]"
rs.open sql,conn,1,3
rs.addnew
rs("dx_OutList_consumer")=Custom_id
rs("dx_OutList_user")=dx_OutList_user
rs.update
dx_OutList_id=rs("dx_OutList_id")
rs.close
'从入库表中,减去商品并将记录添加到出库表中
for i=1 to maxproduit
dx_OutDepot_product=request.Form("product"&i)
if dx_OutDepot_product<>"-1" then
dx_OutDepot_price=0'因为装机以总价计算利润,因此在每条出库记录中每个商品单价为0,包括总收入dx_OutDepot_all,总利润dx_OutDepot_in都为0,只添加一条总记录
dx_OutDepot_count=cint(trim(request.Form("count"&i)))
sqlt="select * from [dx_ToDepot] where dx_ToDepot_product="&dx_OutDepot_product&" and dx_ToDepot_now_count>0 order by dx_ToDepot_time"
rst.open sqlt,conn,1,3
temp=dx_OutDepot_count'temp为需求量
while (not rst.eof) and (temp>0)
if temp>=rst("dx_ToDepot_now_count") then'需求量大于单条记录库存量则要循环下去
temp=temp-rst("dx_ToDepot_now_count")
'--------------------------------------
'------------------------出库
sql="select * from [dx_OutDepot]"
rs.open sql,conn,1,3
rs.addnew
rs("dx_OutDepot_list")=dx_OutList_id
rs("dx_OutDepot_product")=dx_OutDepot_product
rs("dx_OutDepot_price")=dx_OutDepot_price
rs("dx_OutDepot_count")=rst("dx_ToDepot_now_count")
rs("dx_OutDepot_all")=0
rs("dx_OutDepot_in")=0
buy_priceAll=buy_priceAll+rst("dx_ToDepot_buy_price")*rst("dx_ToDepot_now_count")'成本价累计1
rs("dx_OutDepot_accounts")=account'是否欠账:0:否,1:是,2:已清
rs("dx_OutDepot_dispose")=1'0不失配置单出库,1是
rs("dx_OutDepot_user")=dx_OutList_user
rs.update
rs.close
'--------------------------------------
rst("dx_ToDepot_now_count")=0'更新入库表里的显存量
rst.update
else'------------------------------------即temp<rst("dx_ToDepot_now_count")的情况
'--------------------------------------
'------------------------出库
sql="select * from [dx_OutDepot]"
rs.open sql,conn,1,3
rs.addnew
rs("dx_OutDepot_list")=dx_OutList_id
rs("dx_OutDepot_product")=dx_OutDepot_product
rs("dx_OutDepot_price")=dx_OutDepot_price
rs("dx_OutDepot_count")=temp
rs("dx_OutDepot_all")=0
rs("dx_OutDepot_in")=0
buy_priceAll=buy_priceAll+rst("dx_ToDepot_buy_price")*temp'成本价累计2
rs("dx_OutDepot_accounts")=account'是否欠账:0:否,1:是,2:已清
rs("dx_OutDepot_dispose")=1'0不是配置单出库,1是
rs("dx_OutDepot_user")=dx_OutList_user
rs.update
rs.close
'--------------------------------------
rst("dx_ToDepot_now_count")=rst("dx_ToDepot_now_count")-temp'更新入库表里的现存量
rst.update
temp=0
end if
rst.movenext
wend
rst.close
else
end if
next
'--------------------------------------添加一条配机总收入,总利润的记录到出表中,解决配机单的资金流动问题
sql="select * from [dx_OutDepot]"
rs.open sql,conn,1,3
rs.addnew
rs("dx_OutDepot_list")=dx_OutList_id
rs("dx_OutDepot_product")=0
rs("dx_OutDepot_price")=0'商品单价为0
rs("dx_OutDepot_count")=0
rs("dx_OutDepot_all")=priceAll
rs("dx_OutDepot_in")=priceAll-buy_priceAll
rs("dx_OutDepot_accounts")=0'是否欠账:0:否,1:是,2:已清
rs("dx_OutDepot_dispose")=1'0不失配置单出库,1是
rs("dx_OutDepot_user")=dx_OutList_user
rs.update
rs.close
'--------------------------------------
'--------------------------------------添加资金变动
if account=1 then'欠账状态
sql="select * from [dx_accounts]"
rs.open sql,conn,1,3
rs.addnew
rs("dx_accounts_type")=0
rs("dx_accounts_TypeId")=dx_OutList_id
rs("dx_accounts_money")=priceAll
rs("dx_accounts_about")=trim(request.Form("accounts_about_text"))
rs("dx_accounts_user")=dx_OutList_user
rs("dx_accounts_now")=0
rs.update
rs.close
else'-------------付清状态
sql="select * from [dx_site]"
rs.open sql,conn,1,3
  if rs.eof then
    rs.close
    Call ShowErr("系统未初始化","index.asp")
  else
    rs("dx_site_money")=rs("dx_site_money")+priceAll'添加资金
    rs.update
    rs.close
  end if
end if
'--------------------------------------
Call ShowErr("出库成功","dx_OutDepot.asp")
end if
%>
</HEAD>
<BODY>
<script language="javascript">
var customFlag=false;
function check1(maxproduit){
//alert(customFlag);
var custom=document.getElementById("custom").options[document.getElementById("custom").selectedIndex].value;
var newCustom=document.form1.newCustom.value;

var product=document.getElementById("product1").options[document.getElementById("product1").selectedIndex].value;
if (product==-1){
  alert("至少选择一件商品!");
  return false;
}
for (i=1;i<=maxproduit;i++){
     var product=document.getElementById("product"+i).options[document.getElementById("product"+i).selectedIndex].value;
	 var count=document.getElementById("count"+i).options[document.getElementById("count"+i).selectedIndex].value;
	 eval("var price=document.form1.price"+i+".value;")
	 if (product!=-1&&price==""){
	   alert("请输入商品价格!");
	   return false;
	 }
     if (product!=-1&&count==-1){
	   alert("请选择商品的数量!");
	   return false;
	 }
 }
if  (document.form1.priceAll.value==""){
    alert("请输入配置装机总价!");
    return false;
  }else if(custom==-1&&newCustom==""){
    alert("请选择购买会员或是新增会员!");
    return false;
  }else if (custom==-1&&customFlag==false){
    alert("请选择购买会员或是新增会员!");
    return false;
  }else
    return true;
}


function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++)  {
	TempChar= InString.substring (Count, Count+1);
	if (RefString.indexOf (TempChar, 0)==-1)  
	return (false);
}
return (true);
}
opNum=-1;
function getNext(num,type){
opNum=num;
if (type=='1'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex; //序号,取当前选中选项的序号
var val = obj.options[index].value;//获取前一个select选中的值
send_request("GET","chosenProduct.asp?depot="+val+"&type="+type+"",null,"text",Feedback_1);
 }
else if(type=='2'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex; 
var val = obj.options[index].value;
var obj2=document.getElementById("class"+num);
var index2=obj2.selectedIndex; 
var val2=obj2.options[index2].value;
send_request("GET","chosenProduct.asp?depot="+val+"&class="+val2+"&type="+type+"",null,"text",Feedback_2);
 }
else if(type=='3'){
var obj=document.getElementById("depot"+num);
var index=obj.selectedIndex; 
var val = obj.options[index].value;
var obj2=document.getElementById("class"+num);
var index2=obj2.selectedIndex; 
var val2=obj2.options[index2].value;
var obj3=document.getElementById("brand"+num);
var index3=obj3.selectedIndex; 
var val3=obj3.options[index3].value;
send_request("GET","chosenProduct.asp?depot="+val+"&class="+val2+"&brand="+val3+"&type="+type+"",null,"text",Feedback_3);
 }
else if(type=='4'){
var obj4=document.getElementById("product"+num);
var index4=obj4.selectedIndex; 
var val4=obj4.options[index4].value;
send_request("GET","chosenProduct.asp?product="+val4+"&type="+type+"",null,"text",Feedback_4);

⌨️ 快捷键说明

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