📄 collection.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
sysid=1
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
objcheck.CheckUserFunction "payment","read"
dim conn
dim rs
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
conn.Open connstring
conn.execute("update collection set collectiontype='预收款' where paymentid is null or paymentid=-1")
conn.execute("update collection set collectiontype='应收款' where paymentid>0")
if Request("strfield")<>"" then
if Request("strfield")="receiveddate" then
strwhere=" and "&request("strfield")&"='"&request("strvalue")&"'"
elseif Request("strfield")="paymentid" then
strwhere=" and (paymentid is null or paymentid=-1)"
else
strwhere=" and "&request("strfield")&" like '%"&request("strvalue")&"%'"
end if
end if
if Request.Form("strfield")<>"" then
if Request("strfield")="receiveddate" then
strwhere=" and "&request("strfield")&"='"&request.form("strvalue")&"'"
elseif Request.form("strfield")="paymentid" then
strwhere=" and (paymentid is null or paymentid=-1)"
else
strwhere=" and "&request("strfield")&" like '%"&request.form("strvalue")&"%'"
end if
end if
if Request.Form("FdateSearch")<>"" then
strFdate=Request.Form("FdateSearch")
strwhere=strwhere&" and receiveddate>='"&cdate(strFdate)&"'"
end if
if Request.Form("EdateSearch")<>"" then
strEdate=Request.Form("EdateSearch")
strwhere=strwhere&" and receiveddate<='"&cdate(strEdate)&"'"
end if
if Request.QueryString("orderbyfield")<>"" then
'排序字段改变返回第一页
if session("orderbyfield")<>Request.QueryString("orderbyfield") then
tofirstpage=true
else
tofirstpage=false
end if
'翻页时保持排序方式,不翻页循环改变升序/降序
if request("turnpage")="" then
if request("orderby")="" or request("orderby")="desc" then
session("orderby")="asc"
else
session("orderby")="desc"
end if
strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
else
if request("orderbyfield")<>"" then
strwhere=strwhere & " order by "&Request.QueryString("orderbyfield")&" "&session("orderby")
end if
end if
'保存当然排序字段
session("orderbyfield")=Request.QueryString("orderbyfield")
else
strwhere=strwhere & " order by createdate desc"
end if
'response.write strwhere
if objcheck.CheckUserFunction2("payment","edit") then
rs.Open "select top 300 * from v_collection where sysaccountid="&sysid&" "&strwhere,conn,1,1
'搜索时用
selecttablename="v_collection "
else
rs.Open "select top 300 * from v_collection where (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid&" "&strwhere,conn,1,1
'搜索时用
selecttablename="v_collection where (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"')) and sysaccountid="&sysid
end if
if Request.QueryString("CurPage") = "" or Request("CurPage") = 0 then
CurPage = 1
else
CurPage = cint(Request.QueryString("CurPage"))
end If
if not Rs.eof then
Rs.PageSize=session("PageSize")
Rs.AbsolutePage=CurPage
else
CurPage=0
end if
%>
<html>
<head>
<LINK href="../global.css" rel=STYLESHEET type=text/css>
<LINK href="../tools/menu.css" rel=STYLESHEET type=text/css>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Script LANGUAGE="javascript" src="../tools/menuView.js"></script>
<script language=javascript src="../tools/newcalendar.js"></script>
<title>收款</title>
</head>
<script language=javascript>
var g_UrlParams ;
function JustShowMenu(src)
{
document.all(src).style.visibility = "visible";
}
function HideMenu(src)
{
document.all(src).style.visibility = "hidden";
}
function MenuItem_onclick(url,attrstr)
{
var tempwin=window.open(url,null,attrstr);
tempwin.location.href=url + g_UrlParams;
//window.location.href = url + g_UrlParams;
}
function LocateMenu(src,MenuName)
{
var left;
var top ;
var parent ;
parent = document.all(src).offsetParent;
left = parent.offsetLeft + document.all(src).offsetLeft + document.all(src).offsetWidth/2;
top = parent.offsetTop + document.all(src).offsetTop +document.all(src).offsetHeight/2;
while(true)
{
parent = parent.offsetParent ;
if ( "BODY"==parent.tagName) break;
left += parent.offsetLeft ;
top += parent.offsetTop;
}
document.all(MenuName).style.left =left ;
document.all(MenuName).style.top = top ;
}
function ShowMenu(src,MenuName,iUrlParams)
{
var i ;
var parent = new Array(20) ;
var left ;
var top ;
g_UrlParams = iUrlParams ;
LocateMenu(src,MenuName);
document.all(MenuName).style.visibility = "visible";
}
</script>
<SCRIPT language=JavaScript>
function relativeinput_onchange()
{
if (form1.strfield.value=='receiveddate'){
dateformat.style.display='block';
}
if (form1.strfield.value!='receiveddate'){
dateformat.style.display='none';
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -