📄 salesquery.asp
字号:
<!--#include file="../config.ini" -->
<!--#include file="../commfunction.inc" -->
<%
Dim objcheck
Set objcheck=Server.CreateObject("SmartSales.CheckFunction")
sysid=1
set connsalequery=server.createobject("adodb.connection")
connsalequery.open connstring
if request("strfield")<>"" then
strwhere =strwhere&" and "&request("strfield")&" like '%"&Request.Form("strvalue")&"%'"
end if
if request("strfield2")<>"" then
strwhere =strwhere&" and "&request("strfield2")&" like '%"&Request.Form("strvalue2")&"%'"
end if
if Request.Form("namesearch")<>"" then
strwhere =strwhere&" and owner='"&Request.Form("namesearch")&"'"
else
if objcheck.CheckUserFunction2("payment","edit") then
else
strwhere =strwhere &"and (owner='"&session("loginid")&"' or owner in(select userid from v_userreportto_all where reportto='"&session("loginid")&"'))"
end if
end if
if Request.Form("FdateSearch")<>"" then
strFdate=Request.Form("FdateSearch")
strwhere=strwhere&" and TransactDate>='"&cdate(strFdate)&"'"
else
strFdate=date()
strwhere=strwhere&" and TransactDate>='"&cdate(strFdate)&"'"
end if
if Request.Form("EdateSearch")<>"" then
strEdate=Request.Form("EdateSearch")
strwhere=strwhere&" and TransactDate<='"&cdate(strEdate)&"'"
else
strEdate=date()
strwhere=strwhere&" and TransactDate<='"&cdate(strEdate)&"'"
end if
if Request.Form("TransNameSearch")="send" then
strwhere=strwhere&" and Transactcode='发货单发货'"
elseif Request.Form("TransNameSearch")="return" then
strwhere=strwhere&" and Transactcode='发货单退货'"
end if
if Request.Form("CollectionStat")="Collected" then
strwhere=strwhere&" and collectionstatus='已收'"
elseif Request.Form("CollectionStat")="Collecting" then
strwhere=strwhere&" and collectionstatus='未收'"
end if
if Request.Form("InvoiceStat")="Invoiced" then
strwhere=strwhere&" and invoicestatus='已开'"
elseif Request.Form("InvoiceStat")="Invoicing" then
strwhere=strwhere&" and invoicestatus='未开'"
elseif Request.Form("InvoiceStat")="NoInvoice" then
strwhere=strwhere&" and invoice=0"
end if
if request("Orderby")<>"" then
strOrderby=request("Orderby")
else
strOrderby="TransactDate"
end if
Set rssalequery=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM v_SalesStatandQuery where 1=1 "&strwhere&" and sysaccountid="&sysid
sql=sql &" ORDER BY "&strOrderby
'response.write sql
rssalequery.open sql,connsalequery,1,1
alls=rssalequery.Recordcount
Set fs = server.CreateObject("scripting.filesystemobject")
filename = Request.ServerVariables("APPL_PHYSICAL_PATH") & "report\excel\"&session("loginid")&".xls"
strLine="发货日期"&chr(9)&"型号"&chr(9)&"数量"&chr(9)&"单价"&chr(9)&"金额"&chr(9)&"客户"&chr(9)&"销售员"
set myfile = fs.CreateTextFile(filename,true)
myfile.writeline strLine
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../global.css" rel=stylesheet type=text/css>
<style type="text/css"></style>
<title>销售查询</title>
<script language=javascript>
window.top.frames (1).document.location='../left.asp?type=stat';
</script>
</head>
<SCRIPT language=JavaScript>
function showit(tr1length){
for (var i=1;i<=tr1length;i++){
var objname = 'tr1'+i;
var objname2 = 'tr2'+i;
if (eval(objname+'.style.display=="block"') == true)
{
eval(objname+'.style.display="none";');
eval(objname2+'.style.display="none";');
eval('a.style.display="block";');
eval('b.style.display="none";');
eval('c.style.display="none";');
}
else
{
eval(objname+'.style.display="block";');
eval(objname2+'.style.display="block";');
eval('a.style.display="none";');
eval('b.style.display="block";');
eval('c.style.display="block";');
}
}
}
function opensubwin(attrstr,targ1)
{
var tempwin=window.open(targ1,null,attrstr);
tempwin.location.href=targ1;
tempwin.opener=this;
}
function submit1(){
window.form1.submit();
return true;
}
function submit3(){
if (form1.StatMethod.value=="aboutdelivery"){
link="salesquery.asp";
document.location.href=link;
}
if (form1.StatMethod.value=="aboutrecieve"){
link="receivequery.asp";
document.location.href=link;
}
if (form1.StatMethod.value=="aboutinvoice"){
link="invoicequery.asp";
document.location.href=link;
}
}
</SCRIPT>
<script language=javascript src="../tools/newcalendar.js"></script>
<body leftmargin="10" rightmargin="10" topmargin="10">
<table align="center" border="0" cellPadding="0" width="100%" style="font-size:10pt">
<form id=form1 name=form1 action="" method=post>
<tr>
<td> <select name="strfield">
<option value="" <%if request("strfield")="" then Response.Write "selected"%>>条件1</option>
<option value=Model <%if request("strfield")="Model" then Response.Write "selected"%>>型号</option>
<option value=OrderAccount <%if request("strfield")="OrderAccount" then Response.Write "selected"%>>客户</option>
<option value=deliveryNo <%if request("strfield")="deliveryno" then Response.Write "selected"%>>发货单号</option>
<option value=OrderNum <%if request("strfield")="OrderNum" then Response.Write "selected"%>>合同号</option>
</select> <input type="text" name="strvalue" value="<%=request("strvalue")%>" size=10>
<select name="strfield2">
<option value="" <%if request("strfield2")="" then Response.Write "selected"%>>条件2</option>
<option value=Model <%if request("strfield2")="Model" then Response.Write "selected"%>>型号</option>
<option value=OrderAccount <%if request("strfield2")="OrderAccount" then Response.Write "selected"%>>客户</option>
<option value=deliveryNo <%if request("strfield2")="deliveryno" then Response.Write "selected"%>>发货单号</option>
<option value=OrderNum <%if request("strfield2")="OrderNum" then Response.Write "selected"%>>合同号</option>
</select> <input type="text" name="strvalue2" value="<%=request("strvalue2")%>" size=10>
从
<input name=FdateSearch size=9 language=javascript id=dupdatetime value='<%=strFdate%>' readonly><% call AddImg("date")%>
<input type = hidden name=clicksource>
<input type = hidden name=clickresult >
到<input name=EdateSearch size=9 language=javascript id=dupdatetime2 value='<%=strEdate%>' readonly><% call AddImg("date2")%>
<select name=TransNameSearch size=1 LANGUAGE=javascript onchange="submit1()">
<option value="" <%if request("TransNameSearch")="" then Response.Write " selected"%>>含退货</option>
<option value="send" <%if request("TransNameSearch")="send" then Response.Write " selected"%>>所有发货</option>
<option value="return" <%if request("TransNameSearch")="return" then Response.Write " selected"%>>所有退货</option>
</select>
<select name=nameSearch size=1 ID=Select1 LANGUAGE=javascript onchange="submit1()">
<option value="">-销售员-</option>
<%getsubordinate Request.Form("namesearch")%>
</select>
<input type=submit name="Search" value="提交"></td></tr>
</form1>
</table>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -