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

📄 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 "payment","edit"
else
	objcheck.CheckUserFunction "payment","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_invoice where invoiceid="&request("id"),connq,2,3,1
	stramount=rsq("amount")
	straccountid=rsq("accountid")
	straccountname=getfieldvalue("account","accountid",rsq("accountid"),"account")
	strinvoicetype=rsq("invoicetype")
	strinvoicedate=rsq("invoicedate")
	strinvoiceno=rsq("invoiceno")
	if rsq("orderid")<>"" then strorderid=rsq("orderid") else strorderid=-1
	strordernum=rsq("ordernum")
	strdescription=rsq("description")
	strpaymentno=rsq("paymentno")
	if rsq("paymentid")=null then strpaymentid=-1 else strpaymentid=rsq("paymentid")
	rsq.Close
	set rsq=nothing
	connq.Close
	set connq=nothing
else

	straccountid=-1
	strpaymentid=-1
	strorderid=-1
	stramount=request("paymentamount")
	if request("straccount")<>"" then straccountname=request("straccount")
	if request("straccountid")<>"" then straccountid=request("straccountid")
	if request("paymentno")<>"" then strpaymentno=request("paymentno")
	if request("paymentid")<>"" then strpaymentid=request("paymentid")
	if request("stramount")<>"" then stramount=request("stramount")
	if request("strorderid")<>"" then strorderid=cint(request("strorderid"))
	if request("strordernum")<>"" then strordernum=request("strordernum")
	strinvoicedate=date()
end if

if request("amount")<>"" then
	Dim objinvoice
	Set objinvoice=Server.CreateObject("SmartSales.Invoice")
	objinvoice.SaveInvoice
	set objinvoice=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.payment.value==-1&&form1.account.value==-1){
		alert('请选择客户或者应收帐');
		form1.payment.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="paymentname" type="text" value="<%=strpaymentno%>" size="16" readonly> 
        <input type="button" name="bnpayment" onClick="JavaScript:opensubwin2('form1','payment',form1.order.value)"    value=...  class=black> 
        <input name="payment" type="hidden" size="8" value="<%=strpaymentid%>"> 
      </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="ordername" type="text" value="<%=strordernum%>" size="16" readonly> 
        <input type="button" name="bnorder" onClick="JavaScript:opensubwin2('form1','corder')"    value=...  class=black> 
        <input type="hidden" name="order" id=order value="<%=strorderid%>"> </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="<%=straccountid%>"> 
        <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="invoicetype">
          <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="invoicedate2" 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 + -