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

📄 k_intj.asp

📁 一个很好的在线购物系统
💻 ASP
📖 第 1 页 / 共 3 页
字号:










<!--#include file="../include/Pubconn.asp"-->
<!--#include file="../include/PubFun.asp"--> 
<%
 '设计思想:先将所有符合条件的记录放入一个表中去,然后再数据列出来
 '*****************************
 '先将表中的数据删除
 set rst=Server.CreateObject("AdoDB.RecordSet")
 cxsql="select * from K_Tbljhtotal"
 rst.open cxsql,pubconn,1,3
 if rst.recordcount>0 then
    delsql="delete from K_Tbljhtotal"
    pubconn.execute delsql
 end if 
 rst.close
 set rst=nothing
 
 '*************************
 '得到入库仓库下拉单
 set AdoRs3=Server.CreateObject("AdoDB.RecordSet")            
 lcsql="select NumValue from A_ConfigInfo Where Subject='storehouse'"            
 AdoRS3.Open lcSql,PubConn,1,1            
 HYvalue=Adors3("NumValue")            
 if not isNull(HYvalue) then            
 	storemc=Split(HYValue,",") 					            
 end if            
 Set Adors3=Nothing

username=Getuser()

year1=request("year1")
month1=request("month1")
date1=request("date1")
'当年月日同时选择中了,才能进入查询条件,合并
if year1<>"" and month1<>"" and date1<>"" then
  total1=year1+"-"+month1+"-"+date1
end  if 
'当年月日同时选择中了,才能进入查询条件,合并
year2=request("year2")
month2=request("month2")
date2=request("date2")
if year2<>"" and month2<>"" and date2<>"" then
  total2=year2+"-"+month2+"-"+date2
end if 
ckxh=request("ckxh")

%>
<%

'***************************************
'以下统计自用库进货
set rst=server.createobject("adodb.recordset")
str="select sum(spsl) as total1,sum(sjrksl) as total2 ,prodcode,rkck from  k_tblstock where sfyrk='Y' "
if ckxh<>"" then
      str=str&" and rkck='"&ckxh&"'"
end if 
if total1<>"" and total2="" then
   str=str&" and jhrq<='"&total1&"'"
end if 
if total1="" and total2<>"" then
    str=str&" and jhrq<='"&total2&"'"
end if
if total1<>"" and total2<>"" then
   str=str&" and (jhrq  between '"&total1&"' and '"&total2&"')"
end if  
str=str&"group by prodcode,rkck "
rst.open str,pubconn,1
if not rst.eof then
   '将表打开,准备把数据添加进去
   set rs=Server.CreateObject("AdoDB.RecordSet")
   cxsql="select * from K_Tbljhtotal"
   rs.open cxsql,pubconn,1,3
   for i=1 to rst.recordcount
         rs.addnew
             rs("spxh")=rst("prodcode")
             rs("ckxh")=rst("rkck")
             rs("jhrksl")=rst("total2")
         rs.update
         rst.movenext
         if rst.eof then exit for
    next
    rs.close
    set rs=nothing
end if 
rst.close
set rst=nothing

'**********************************
'以下为销售退货入库数量
set rst=server.createobject("adodb.recordset")
str="select sum(Quantity) as total1,sum(sjrksl) as total2 ,prodcode,ckxh from  F_Tblretdetail where sfyrk='Y' "
if ckxh<>"" then
      str=str&" and ckxh='"&ckxh&"'"
end if 
if total1<>"" and total2="" then
   str=str&" and rkrq<='"&total1&"'"
end if 
if total1="" and total2<>"" then
    str=str&" and rkrq<='"&total2&"'"
end if
if total1<>"" and total2<>"" then
   str=str&" and (rkrq  between '"&total1&"' and '"&total2&"')"
end if  
str=str&"group by prodcode,ckxh "
rst.open str,pubconn,1
if not rst.eof then
     '将表打开,准备把数据添加进去
     set rs=Server.CreateObject("AdoDB.RecordSet")
     cxsql="select * from K_Tbljhtotal"
     rs.open cxsql,pubconn,1,3
     for i=1 to rst.recordcount
         rs.addnew
            rs("spxh")=rst("prodcode")
            rs("ckxh")=rst("ckxh")
            rs("xsthrksl")=rst("total2")
        rs.update
        rst.movenext
        if rst.eof then exit for
    next
    rs.close
    set rs=nothing
end if 
rst.close
set rst=nothing
'***********************************
'以下为盘点报盈数量
set rst=server.createobject("adodb.recordset")
str="select sum(sysl) as total1,sum(syje) as total2 ,prodcode,ckxh from  k_tblstopd where sysl>0 "
if ckxh<>"" then
      str=str&" and ckxh='"&ckxh&"'"
end if 
if total1<>"" and total2="" then
   str=str&" and zdrq<='"&total1&"'"
end if 
if total1="" and total2<>"" then
    str=str&" and zdrq<='"&total2&"'"
end if
if total1<>"" and total2<>"" then
   str=str&" and (zdrq  between '"&total1&"' and '"&total2&"')"
end if  
str=str&"group by prodcode,ckxh "
rst.open str,pubconn,1
if not rst.eof then
      '将表打开,准备把数据添加进去
      set rs=Server.CreateObject("AdoDB.RecordSet")
      cxsql="select * from K_Tbljhtotal"
      rs.open cxsql,pubconn,1,3
      for i=1 to rst.recordcount
          rs.addnew
             rs("spxh")=rst("prodcode")
             rs("ckxh")=rst("ckxh")
             rs("pdbysl")=rst("total1")
          rs.update
          rst.movenext
          if rst.eof then exit for
       next
      rs.close
      set rs=nothing
end if 
rst.close
set rst=nothing

'将表打开,将数据列出来
set rstj=Server.CreateObject("AdoDB.RecordSet")
cxsql="select sum(jhrksl)as total1, sum(xsthrksl) as total2,sum(pdbysl) as total3,spxh,ckxh from K_Tbljhtotal group by spxh,ckxh  order by ckxh desc"
rstj.open cxsql,pubconn,1

%>                                     
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>单据查询</title><link href="../cread.css" rel="stylesheet" type="text/css">
</head>

<script language="vbscript">
   sub GoPage()

        page1=document.myform.page1.value
        year1=document.myform.year1.value
        month1=document.myform.month1.value
        date1=document.myform.date1.value
        year2=document.myform.year2.value
        month2=document.myform.month2.value
        date2=document.myform.date2.value
        ckxh=document.myform.ckxh.value
    
      
        a="k_intj.asp?page="+page1+"&year1="+year1+"&month1="+month1+"&date1="+month1+"&year2="+year2+"&month2="+month2+"&date2="+date2+"&ckxh="+ckxh
        window.location=a

⌨️ 快捷键说明

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