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

📄 paymentin.asp

📁 一个比较完整的企业erp系统
💻 ASP
字号:
<%@language="vbscript" codepage="936"%>
<%response.buffer = true%>
<%Public HOME_PATH:HOME_PATH = "../"%>
<!--#include file="../db.asp"-->
<!--#include file="../inc/function.asp"-->
<%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.cachecontrol = "no-cache"
if isLogin = false then
   Response.Write viewinfo("LoginC","","")
   Response.end
end if
 set c01 = new CL01
 thisDate__ = SELVAR("thisDate","")
 uid = GetText("uid","G","number",1,10,0)
 paymenttoid = GetText("paymenttoid","G","number",1,10,0)
 SQL = "select * from sale where saleid = " & paymenttoid & ""
 Rs.open(SQL),Conn,1,1
 if not Rs.eof then
	saleid = Rs("saleid")
	supplierid  = isNumber(Rs("supplierid"),"int",0)
	plNum  = Rs("plNum")
	saleNum  = Rs("saleNum")

	sale_supplierName = Rs("supplierName")
	sale_Linkman = Rs("Linkman")

	thisDate  = Rs("thisDate")
	ZJ = isNumber(Rs("ZJ"),"dec",0)
	outtime  = Rs("outtime")
	Amount  = isNumber(Rs("Amount"),"dec",0)
	shuilvALL = isNumber(Rs("shuilvALL"),"dec",0)
	AmountshuilvALL = isNumber(Rs("AmountshuilvALL"),"dec",0)'含税价
	nowpayment  = isNumber(Rs("nowpayment"),"dec",0)
	nopayment  = isNumber(Rs("nopayment"),"dec",0)
	intoaid  = isNumber(Rs("intoaid"),"int",0)
	selectaid  = isNumber(Rs("selectaid"),"int",0)

	thissaleNumAmountshuilvALL = AmountshuilvALL '该单总金额
	paymenting = nowpayment '购买时支付
	paymentZJ = ZJ '购买时折减
	paymented_ = SelectZD("select Sum(paymoney) from payment where paymenttoid = " & saleid & " and supplierid = " & supplierid & "",0)'购买后支付
    paymentedALL = paymenting+paymentZJ+paymented_'总支付
	thissaleNumNoPayment = thissaleNumAmountshuilvALL - paymentedALL
 else
    Response.Write "none"
    Response.end
 end if
 Rs.Close



 if not uid = 0 then
    SQL = "select * from supplier where uid = " & uid & ""
    c01.Supplierinfo
	    SQL_ = "select Sum(Amount) , Sum(nopayment) , Sum(nowpayment+ZJ) , Sum(Amount+(Amount*shuilvALL/100)) from sale where supplierid = " & uid & " " & DateSQL & ""
	    Set outSelect = Server.CreateObject("Adodb.RecordSet")
	    outSelect.Open(SQL_),Conn,1,1
	    if not outSelect.eof then
		   outAmountCount = outSelect(0)
		   noPaymentCount = outSelect(1)
		   nowPaymenCount = outSelect(2)
		   outAmountshuilvCount = outSelect(3)
	    else
		   outAmountCount = 0
		   noPaymentCount = 0
		   nowPaymenCount = 0
		   outAmountshuilvCount = 0
	    end if
	    outSelect.Close
	    Set outSelect = Nothing



		elsePaymentCount = SelectZD("select Sum(paymoney) from payment where supplierid = " & uid & " ",0)

		incfinancePayment = isNumber(SelectZD("select Sum(fMoney) from incfinance where supplierid = " & uid & "  and inorout = 1 and not ftypeid = 0 ",0),"int",0)'财务表相关支付

		nowPaymentCount__ = nowPaymenCount+elsePaymentCount'全部已支付(包括后来支付)
		noPaymentCount__ = noPaymentCount-elsePaymentCount
		menoyCountinfo = "·全部订购总额(包含税率):¥" &  formatNumber(isNumber(outAmountshuilvCount,"dec",0),2) & "<br/>·财务相关收款(包含税率):¥" & formatNumber(isNumber(incfinancePayment,"dec",0),2) & "<br/>·全部收款总额(包含折减):¥" & formatNumber(isNumber(nowPaymentCount__+incfinancePayment,"dec",0),2) & "<br/>·全部欠款总额:¥" & formatNumber(isNumber(noPaymentCount__-incfinancePayment,"dec",0),2)
		inputtype = "text"
 else
	inputtype = "hidden"
    USLinkman = "其他客户"
	USFullName = sale_supplierName
	menoyCountinfo = ""
 end if



 SQLPay = "select * from payment where (paymentid is null)"
 Options = trim(Request.Form("Options"))
 if Options = "payment" then
    Rs.Open(SQLPay),Conn,1,3
	thisDate = GetText("thisDate","P","Str",4,10,0)
	if not isdate(thisDate) then thisDate = thisDate__
	Rs.Addnew
	Rs("supplierid") = uid
	Rs("paymenttoid") = saleid
	paymentM = GetText("payment","P","number",1,10,0)
	Rs("paymoney") = paymentM '支付
	Rs("thisDate") = thisDate
	Rs("intotime") = now()
	Rs("intoaid") = Seuid_inc'操作人id
	Rs("selectaid") = GetText("aid","P","number",1,10,0)'收款人id
	Rs("Remark") = htmlencode(GetText("Remark","P","Str",1,250,"none"),"Y")'其他说明
	Rs("inorout") = 1
    Rs.update

    paymentid_ = SelectZD("select paymentid from payment Order by paymentid Desc",0)
	Conn.Execute"insert into incfinance (ftypeid,fName,fMoney,fRemark,intotime,thisDate,aid,inorout,supplierid,paymentid) values (0,'编号为:" & saleNum & "的收款'," & paymentM & ",'编号为(" & saleNum & ")收款时同时记录','" & now & "','" & thisDate & "'," & Seuid_inc & ",1," & supplierid & "," & paymentid_ & ")"'同时间记录到财务表










	viewinfo_ =  viewinfo("divLoca","正在执行操作.请稍候…","")
    Response.Write viewinfo("CloseTime","2000","window.returnValue = 'returnValue';")
    Rs.Close
 end if
 
 Public title:title = "向(" & USLinkman & "-" & USFullName & ")" & identifyCodeName & "-收款"
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link href="<%=HOME_PATH%>css/style01.css" rel="stylesheet" type="text/css">
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/layer00.js'></script>
<script type = 'text/javascript' src = '<%=HOME_PATH%>js/dateselect.js'></script>
<script language="JavaScript" type = 'text/javascript'>
<!--
var admin_ = null ;
function adminList() {
    admin_ = window.showModalDialog('<%=HOME_PATH%>admin/selectadminlist.asp','','dialogWidth:750px;dialogHeight:400px;scroll:yes;help:no;status:no;center:yes;edge:raised;');
   if (admin_!=null) {
       document.form.aid.value = admin_[0];
       document.form.Loginid.value = admin_[1];
       document.form.TrueName_Phone.value = admin_[2];
	 }
 }

//-->
</script>
<style>
html{min-width: 776px;}
fieldset {padding:3px;}
.tempF {border-top:solid 0px #fff;border-left:solid 0px #fff;border-right:solid 1px #d6d3ce;border-bottom:solid 1px #d6d3ce;}
form { padding:0px;}
</style>
<base target = '_self'>
</head>
<body style = 'border-style:none;margin:10px;background-color:buttonface;' onkeydown = "javascript:if(event.keyCode==116){window.location.reload();}">
<%if Options = "payment" then Response.Write viewinfo_%>
<div style = 'text-align:center;'>
<form method='post' action="<%=SELVAR("FN","?")%>" name = 'form'>


<fieldset style = 'width:100%;line-height:16px;text-align:left;'><legend>编号为:(<%=saleNum%>)的销售单</legend>
·该单总金额:¥<%=formatNumber(thissaleNumAmountshuilvALL,2) & " - 折减:" & formatNumber(ZJ,2) & "<br/>·购买时支付:¥" & formatNumber(paymenting,2) & "<br>·购买后支付:¥" & formatNumber(paymentedALL,2) & "<br/>·现该单欠款:¥" & formatNumber(thissaleNumNoPayment,2) %><input type = 'hidden' name = 'nownopayment' value = '<%=thissaleNumNoPayment%>'/>  该单尚欠:<input type = 'text' name = 'nopaymenttemp' style = 'border-style:none;color:red;width:80px;' value = '<%=thissaleNumNoPayment%>' readOnly = 'true'/></fieldset>

<input type= 'hidden' value = '<%=uid%>' name= 'uid'/>
<input type= 'hidden' value = 'payment' name= 'Options'/>
<input type = 'hidden' name = 'paymenttoid' value = '<%=saleid%>'/>
<table style = 'height:auto;width:100%;' cellspacing = '0' cellpadding = '1' borderColorLight='buttonshadow' borderColorDark='#eeeeee' border = '1'>
 <tr style = 'text-align:center;'>
   <td style = 'width:80px;height:25px;'>收款金额</td>
   <td style = 'width:75px;'>收款日期</td>
   <td>选择收款人</td>
   <td>当前操作员</td>
 </tr>

 <tr style = 'text-align:center;'>
   <td style = 'width:80px;'><input type = 'text' name = 'payment' style = 'width:100%;' onkeyup = "javascript:if(isNaN(this.value)){this.value=0;};var noPay__ = form.noPaymentCount__.value;form.noPaymentCount.value = noPay__-this.value;form.nopaymenttemp.value=(Number(form.nownopayment.value)-Number(this.value));"/></td>
   <td><input type = 'text' name = 'thisDate' onfocus="setday(this)" size="10" maxlength="10" readonly style = 'text-align:center;' value = '<%=thisDate__%>'/></td>
   <td style = 'width:88px;'><input type = 'text' style = 'width:80%;border-right-style:none;' name = 'TrueName' value = '<%=SeTrueName_inc%>' readonly/><input type = 'button' style = 'border-left-style:none;' value = '…' onclick = "javascript:adminList();"/><input type = 'hidden' name = 'aid' value = '<%=Seuid_inc%>'/><input type = 'hidden' name = 'TrueName_Phone'/></td>
   <td style = 'width:auto;'><%=SeTrueName_inc%><input type = 'hidden' name = 'Exeaid' value = '<%=Seuid_inc%>'/></td>
 </tr>
 <tr>
   <td style = 'text-align:center;'>其他说明</td>
   <td colspan = '3'><input type = 'text' name = 'Remark' style = 'width:100%;border:1px #848284 solid ;background-color:transparent;'/></td>
 </tr>

 <tr>
   <td colspan = '4' style = 'text-align:center;padding:3px;'><input type="button" value = '提交' onclick = "javascript:var pv = replace_(form.payment.value,' ','') ; if(pv==''){alert('请填写付款金额!  ');form.payment.focus();return false;}else if(Number(form.payment.value)>Number(form.nownopayment.value)) { alert('错误:您输入的支付金额大于该单的欠款金额!  ');return false ;}else{form.submit();}"><input type="reset" value = '重置'><input type = 'button' onclick = "javascript:window.close();" value = '关闭'/></td>
 </tr>

</table>
<fieldset style = 'width:100%;line-height:16px;text-align:left;'><legend><span style = 'color:blue;'><%=USLinkman & "-" & USFullName & TitleA%></span></legend>
<%=menoyCountinfo%> <input type = '<%=inputtype%>' style = 'border-style:none;' value = '<%=noPaymentCount__-incfinancePayment%>' name = 'noPaymentCount'/><input type = 'hidden' value = '<%=noPaymentCount__-incfinancePayment%>' name = 'noPaymentCount__'/>
</fieldset>

</form>
</div>
</body>
</html>

⌨️ 快捷键说明

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