yhklist.asp

来自「创建和运行动态、交互的Web服务器应用程序」· ASP 代码 · 共 153 行

ASP
153
字号
<!--#include file="conn.asp"-->
<html>
<head>
<title><%=webname%>--图书采购单</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
dim caigoudan,action,shijian,cgdate,xiaoshoufangshi,gy,gyindex,i,bookid,bookname,bkcount,shichangjia,gyzk,rs2,total1,total2,total3,total4,czy,kfname,totalcount 

shijian=now()
hkdan="hk"&request("cgyear")&request("cgmonth")&request("cgday")&hour(shijian)&minute(shijian)&second(shijian)

       '//数据处理

       hk     = Session("myhk") 
       hkindex= session("hkindex")

       for i=1 to hkindex-1

           if hk(i,4)<>0 then
              bookid      =hk(i,0)  
              cgid        =hk(i,1)

              bookname    =hk(i,2)
              shichangjia =hk(i,3)
              yhkcount    =hk(i,4)
              yhksy       =hk(i,5) 

set rs2=server.CreateObject("adodb.recordset")
    rs2.open "select * from shop_hkaction",conn,1,3

rs2.addnew
rs2("cgid")     = cgid
rs2("gyid")     = hk(0,0)
rs2("bookid")   = bookid
rs2("hkdan")    = hkdan
rs2("hkcount")  = yhkcount
rs2("hkmy")     = shichangjia*yhkcount
rs2("hkzk")     = hk(0,1)
rs2("hksy")     = yhksy
rs2("hkdate")   = date()
rs2("czy")      = request("yhk_admin")
rs2.update

              set rs_gy=server.CreateObject("adodb.recordset")
                  rs_gy.open "select * from shop_gongyi where gyid="&hk(0,0),conn,1,3
                  rs_gy("sumhk")=rs_gy("sumhk")+yhksy
                  rs_gy("sumsq")=rs_gy("sumqk")-rs_gy("sumhk")-rs_gy("sumtsk")
                  rs_gy.update

              set rs_cg=server.CreateObject("adodb.recordset")
                  rs_cg.open "select * from shop_cgaction where cgid="&cgid,conn,1,3
                  rs_cg("yhkcount")=rs_cg("yhkcount")-yhkcount      
                  rs_cg.update
            end if

        next

        for i=0 to hkindex           
           for j=0 to 5
               hk(i,j)=""
           next
        next

        Session("myhk")=hk 
        session("hkindex")=0

        set rs2=nothing
        set rs_bk=nothing

   '//显示采购单
set rs=server.CreateObject("adodb.recordset")
    rs.open "select shop_books.bookname,shop_books.shichangjia,shop_hkaction.hkcount,shop_hkaction.hkzk,shop_hkaction.hkmy,shop_hkaction.hksy,shop_hkaction.hkdate,shop_hkaction.hkdan,shop_hkaction.czy,shop_gongyi.gyname FROM (shop_hkaction INNER JOIN shop_books ON shop_hkaction.bookid = shop_books.bookid) INNER JOIN shop_gongyi ON shop_hkaction.gyid = shop_gongyi.gyid where shop_hkaction.hkdan='"&hkdan&"' ",conn,1,1
%>

<table width="90%" height="450" border="0"  cellpadding="0" cellspacing="0">
   <tr><td><br>
       <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2">
          <tr><td height=10></td></tr> 
          <tr>
             <td align="center" colspan="3"><font color=blue size=3><b><%=webname%>图书结款单</b></font></td>
          </tr>
          <tr><td colspan=3 align="center"><hr noshade color=#cccccc size=1></td></tr>
          <tr> 
             <td STYLE='PADDING-LEFT: 30px'>结款单号:<font color=#ff3300><%=rs("hkdan")%></font></td>
             <td STYLE='PADDING-LEFT: 30px'>供应商名:<font color=#ff3300><%=rs("gyname")%></font></td>
             <td STYLE='PADDING-LEFT: 30px'>结款日期:<font color=#ff3300><%=rs("hkdate")%></font></td>
             <%hkdan=rs("hkdan")%>
          </tr>          
          <tr><td height=10></td></tr> 
          </tr> 
       </table>

       <table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#cccccc">
          <tr>
             
             <td width="37%" bgcolor="#ece9d8" align="center">书名</td>
             <td width="8%"  bgcolor="#ece9d8" align="center">定价</td>
             <td width="10%" bgcolor="#ece9d8" align="center">数量</td>
             <td width="8%"  bgcolor="#ece9d8" align="center">折扣</td>
             <td width="12%" bgcolor="#ece9d8" align="center">实洋</td>
          </tr>
          <%do while not rs.eof%> 
          <tr>
             
             <td width="37%" bgcolor="#ffffff" align="center"><%=rs("bookname")%></td>
             <td width="8%"  bgcolor="#ffffff" align="center"><%=formatnumber(rs("shichangjia"))%></td>
             <td width="10%" bgcolor="#ffffff" align="center"><%=rs("hkcount")%></td>
             <td width="8%"  bgcolor="#ffffff" align="center"><%=formatnumber(rs("hkzk"))%></td>
            <%
              total1     = rs("shichangjia")*rs("hkcount")
              czy        = rs("czy")
            
     	      total2     = total1*rs("hkzk")
              totalcount = rs("hkcount")
             %> 
             <td width="12%" bgcolor="#ffffff" align="center"><%=formatnumber(rs("hksy"),2)%></td>
         </tr> 
            <%total0=total0+total1
              total3=total3+total2
              total4=total4+totalcount
          rs.movenext
             loop
          rs.close%>
          <tr> 
             <td bgcolor="#ffffff" STYLE='PADDING-LEFT: 100px' colspan="9" height=40>   总数量&nbsp;<font color="#FF0000"><%=total4%>                </font>&nbsp;册&nbsp;&nbsp;&nbsp;&nbsp; 
                                                                                      总计码洋&nbsp;<font color="#FF0000"><%=formatnumber(total0,2)%></font>&nbsp;元&nbsp;&nbsp;&nbsp;&nbsp;
                                                                                      总计实洋&nbsp;<font color="#FF0000"><%=formatnumber(total3,2)%></font>&nbsp;元</td>
          </tr>
      </table>

      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="2">
         <tr><td height=10></td></tr> 
         <tr>
            <td align="right">操作人员:&nbsp;</td>
            <td width="15%"><font color="#FF0000"><%=czy%></font></td>
            
         <tr>
            <td colspan=6 align="center"><hr noshade color=#cccccc size=1></td>
        </tr>
        <tr>
           <td colspan=6 align="right"><a href="showjshk.asp">继续支付</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" name="print_cg" class="bt3" value="打 印" onclick="javascript:window.print()">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
    </table>

   </tr>  
</table>
</body>
</html>

⌨️ 快捷键说明

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