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

📄 newinvoice.asp

📁 1 除掉了 时间 限制 2 除掉了 人数 限制 改为 500人 原为5人 3 发现一点小缺陷 增加人员的时候没有判断 登陆名是否重复! 自己写吧~~~:) 4 又 是一点缺陷
💻 ASP
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")

if request("id")<>"" then
	objcheck.CheckUserFunction "popayment","edit"
else
	objcheck.CheckUserFunction "popayment","add"
end if
set objcheck=nothing

if request("id")<>"" then
	dim connq
	dim rsq
	dim strpaymentno
	set connq=server.CreateObject("adodb.connection")
	set rsq=server.CreateObject("adodb.recordset")
	connq.Open connstring
	rsq.Open "select * from v_poinvoice where poinvoiceid="&request("id"),connq,2,3,1
	stramount=rsq("amount")
	straccount=rsq("accountid")
	straccountname=getfieldvalue("account","accountid",rsq("accountid"),"account")
	strinvoicetype=rsq("invoicetype")
	strinvoicedate=rsq("invoicedate")
	strinvoiceno=rsq("invoiceno")
	strdescription=rsq("description")
	strpopaymentno=rsq("popaymentno")
	if rsq("popaymentid")<>"" then strpopaymentid=rsq("popaymentid") else strpaymentid=-1
	if rsq("poid")<>"" then strpoid=rsq("poid") else strpoid=-1
	strpono=rsq("pono")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else
	straccount=-1
	stramount=request("paymentamount")
	if request("straccount")<>"" then straccountname=request("straccount")
	if request("straccountid")<>"" then straccount=request("straccountid")
	if request("paymentno")<>"" then strpopaymentno=request("paymentno")
	if request("popaymentid")<>"" then strpopaymentid=request("popaymentid")
	if request("stramount")<>"" then stramount=request("stramount")
	if request("strpoid")<>"" then strpoid=cint(request("strpoid"))
	if request("strpono")<>"" then strpono=request("strpono")
	strinvoicedate=date()
end if

if request("amount")<>"" then
	dim conn
	dim rs
	set conn=server.CreateObject("adodb.connection")
	set rs=server.CreateObject("adodb.recordset")
	conn.Open connstring
	if request("id")="" then
		rs.Open "select * from poinvoice",conn,2,3,1
		rs.AddNew 
		rs("invoicestatus")="未销"
		rs("creator")=session("loginid")
		rs("createdate")=date()
		rs("sysaccountid")=getsysaccount("sysaccountid")
	else
		rs.Open "select * from poinvoice where poinvoiceid="&request("id"),conn,2,3,1
		rs("lastmoduser")=session("loginid")
		rs("lastmoddate")=now()
	end if
	rs("invoiceno")=request("invoiceno")
	rs("accountid")=request("account")
	rs("invoicetype")=request("invoicetype")
	rs("amount")=request("amount")
	rs("invoicedate")=request("invoicedate")
	rs("description")=request("description")
	if request.form("po")<>"" then rs("poid")=request.form("po")
	rs("pono")=request("poname")
	if request("popayment")<>"" then rs("popaymentid")=request("popayment")

	rs.Update 
	rs.Close 
	set rs=nothing
	conn.Close 
	set conn=nothing
%>
<script language=javascript>
	window.opener.location.reload();
	window.close();
</script>
<%
end if
%>

<HTML><HEAD><TITLE>发票</TITLE>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function save(){
	if (form1.invoiceno.value==''){
		alert('请输入发票号');
		form1.invoiceno.focus();
		return;
	}
	if (form1.account.value==-1){
		alert('请选择客户');
		form1.account.focus();
		return;
	}
	if (form1.amount.value==''){
		alert('请输入金额');
		form1.amount.focus();
		return;
	}
	if (isNaN(form1.amount.value)){
		alert('请输入数字');
		form1.amount.focus();
		return;
	}
form1.submit();
}
</script>
<script language=javascript src="../tools/calendar.js"></script>
<script language=javascript src="../tools/newcalendar.js"></script>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
 <form name=form1  method="post"  id=form1>
       <table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
   <tr> 
    <td height="25"><strong><font size="2" class=title><b><%if request("id")="" then%>新建发票<%else%>编辑发票<%end if%></b></font></strong></td>
      <td>&nbsp;</td>
    </tr>
    <tr > 
      <td height="16" colspan="2" background="../images/title.gif">&nbsp;</td>
    </tr>
    <tr>
      <td height=4></td>
    </tr>
 </table>
  <table width="100%" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF">
    <tr bgcolor="white"> 
      <td bgcolor="DEDFDE"><div align="center">应付帐</div></td>
      <td bgcolor="efefef" ><input name="popaymentname" type="text" value="<%=strpopaymentno%>" size="16" readonly> 
        <input type="button" name="bnpayment" onClick="JavaScript:opensubwin2('form1','popayment',form1.po.value)"    value=...  class=black> 
        <input name="popayment" type="hidden" size="8" value="<%=strpopaymentid%>"> 
      </td>
      <td bgcolor="DEDFDE"><div align="center">发票号</div></td>
      <td bgcolor="efefef"><input name=invoiceno type=text value="<%=strinvoiceno%>" size=16></td>
    </tr>
    <tr bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE"> <div align="center">采购单号</div></td>
      <td width="40%" bgcolor="efefef" ><input name="poname" type="text" value="<%=strpono%>" size="16" readonly> 
        <input type="button" name="bnpo" onClick="JavaScript:opensubwin2('form1','CPO')"    value=...  class=black> 
        <input type="hidden" name="po" id=po value="<%=strpoid%>"> </td>
      <td width="10%" bgcolor="DEDFDE"> <div align="center">金额</div></td>
      <td width="40%" bgcolor="efefef"><input name=amount type=text value="<%=stramount%>" size=16></td>
    </tr>
    <tr  bgcolor="white">
      <td bgcolor="DEDFDE" nowrap><div align="center">客户</div></td>
      <td bgcolor="efefef"><input name="account" type="hidden" size="8" value="<%=straccount%>"> 
        <input name="accountname" type="text" size="16" value="<%=straccountname%>" readonly> 
        <input type="button" name="bnaccount" onClick="JavaScript:opensubwin2('form1','account')"    value=...  class=black></td>
      <td bgcolor="DEDFDE"><div align="center">发票类型</div></td>
      <td bgcolor="efefef"><select name="invoicetype" id="select">
          <option value="增值税发票" <%if strinvoicetype="增值税发票" then response.Write("selected")%>>增值税发票</option>
          <option value="普通发票" <%if strinvoicetype="普通发票" then response.Write("selected")%>>普通发票</option>
        </select></td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE" nowrap> <div align="center">开票日期</div></td>
      <td bgcolor="efefef"> <input type="text" name="invoicedate" size="12" language=javascript id="dupdatetime" value="<%=strinvoicedate%>" readonly> 
        <% call AddImg("date")%>
        <input type = hidden name=clicksource> <input type = hidden name=clickresult> 
      </td>
      <td width="10%" bgcolor="DEDFDE"> <div align="center" nowrap></div></td>
      <td bgcolor="efefef">&nbsp; </td>
    </tr>
    <tr  bgcolor="white"> 
      <td width="10%" bgcolor="DEDFDE" > <div align="center">描述</div></td>
      <td colspan="3" bgcolor="efefef"> <textarea name="description" cols="45" rows="4"><%=strdescription%></textarea> 
      </td>
    </tr>
  </table>
	<table>
    <tr> 
      <td height=10 colspan="4"></a></td>
    </tr>
    <tr> 
      <td></td>
      <td style="cursor:hand">&nbsp;&nbsp;<a onclick="save();"><img src="../images/button_save.gif"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="window.close();"><img src="../images/button_cancel.gif"></a> 
      </td>
      <td style="cursor:hand">&nbsp;</td>
      <td style="cursor:hand">&nbsp;</td>
    </tr>
  </table>
</form>

⌨️ 快捷键说明

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