<% <% if keyword1<>"" then <% </body>
pagenum=55'指定打印行数
%>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>销售利润明细报表打印</title>
<style type="text/css">
td {font-size:9pt; color:#000000}
a{text-decoration:none}
a:hover{color:#ff0000;text-decoration:derline}
.break{page-break-before:always}
</style>
</head>
<script language="javascript">
window.print()
</script>
<body style="border:none" topmargin="0" leftmargin="6" onload="javascrpt:pagesetup_default();">
<script language="vbscript">
dim hkey_root,hkey_path,hkey_key
hkey_root="hkey_current_user"
hkey_path="\software\microsoft\inte.net explorer\pagesetup"
function pagesetup_default()
on error resume next
set regwsh = createobject("wscript.shell")
hkey_key="\header"
regwsh.regwrite hkey_root+hkey_path+hkey_key,"&b页&p/&p"
hkey_key="\footer"
regwsh.regwrite hkey_root+hkey_path+hkey_key,""
end function
</script>
kdname1=trim(request("kdname1"))
kdname2=trim(request("kdname2"))
keyword1=trim(request("keyword1"))
keyword2=trim(request("keyword2"))
today=keyword1
else
if kdname1="" then
today=year(date())&"-"&month(date())
else
today=kdname1&"至"&kdname2
end if
end if
%>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="740" height="30">
<tr>
<td align="center">销售利润汇总报表</td>
</tr>
</table>
strsql="select autoid,sellautoid,productxili,productname,productsize,productnum,productdan,productjia,chaoshi,tiaoma,youhui,fukuan,moncount1,gongshang,lirun1,username,indate,fudate from sell where officename='"&trim(request.cookies("myoffice"))&"' and monthjie='0' and (year(indate)=year(getdate()) and month(indate)=month(getdate())) and zhuofei is null order by autoid desc"
set rs1=server.createobject("adodb.recordset")
rs1.open strsql,conn,1,1
%>
<table border="1" cellspacing="0" cellpadding="0" align="center" style="border-collapse: collapse" bordercolor="#000000" width="740">
<tr>
<td align="center" height="20" bgcolor="#bdcbee" width="70" >销售单号</td>
<td align="center" height="20" bgcolor="#bdcbee" width="168" >商品名称(规格)</td>
<td align="center" height="20" bgcolor="#bdcbee" width="121" >客户</td>
<td align="center" height="20" bgcolor="#bdcbee" width="30" >数量</td>
<td align="center" height="20" bgcolor="#bdcbee" width="24" >单位</td>
<td align="center" height="20" bgcolor="#bdcbee" width="50" >销售价</td>
<td align="center" height="20" bgcolor="#bdcbee" width="23" >折%</td>
<td align="center" height="20" bgcolor="#bdcbee" width="52" >进货价</td>
<td align="center" height="20" bgcolor="#bdcbee" width="55" >小计</td>
<td align="center" height="20" bgcolor="#bdcbee" width="45" >利润</td>
<td align="center" height="20" bgcolor="#bdcbee" width="25" >付款</td>
<td align="center" height="20" bgcolor="#bdcbee" width="61" >销售日期</td>
</tr>
</table>
<%
moncount2=0
moncount5=0
do while not rs1.eof
%>
<table border="1" cellpadding="0" cellspacing="0" width="740" align="center" style="border-collapse:collapse; font-size:10pt;color:#000000" bordercolor="#000000">
<%
for i=1 to pagenum
if not rs1.eof then
if trim(rs1("fukuan"))="欠款" then
moncount6=csng(rs1("lirun1"))
moncount5=moncount5+moncount6
else
moncount3=csng(rs1("lirun1"))
moncount2=moncount2+moncount3
end if
%>
<tr>
<td height="18" width="70"> <%=rs1("sellautoid")%></td>
<td height="18" width="168"><%=decode(rs1("productname"))%> <%=rs1("productsize")%></td>
<td height="18" width="121"><%=left(rs1("gongshang"),9)%></td>
<td height="18" width="30" align="center"><%=rs1("productnum")%></td>
<td height="18" width="24" align="center"><%=rs1("productdan")%></td>
<td height="18" width="50" align="right"><%=formatnumber(rs1("chaoshi"),varnum,-1)%></td>
<td height="18" width="23" align="center"><%=rs1("youhui")%></td>
<td height="18" width="52" align="right"><%=formatnumber(rs1("productjia"),varnum,-1)%></td>
<td height="18" width="55" align="right"><%=formatnumber(rs1("moncount1"),varnum,-1)%></td>
<td height="18" width="45" align="right"><%=formatnumber(rs1("lirun1"),varnum,-1)%></td>
<td align="center" height="18" width="25"><%if trim(rs1("fukuan"))="欠款" then%><font color=blue><%=rs1("fukuan")%></font><%else%><%=rs1("fukuan")%><%end if%></td>
<td height="18" width="61"><%=rs1("indate")%></td>
</tr>
<%
rs1.movenext
end if
next
%>
</table>
<%
if not rs1.eof and i=pagenum+1 then '添加分页标记
%>
<div class="break"> </div>
<table border="0" cellpadding="0" cellspacing="0" width="740" height="12" align="center"><tr><td height="12"></td></tr></table>
<table border="1" cellspacing="0" cellpadding="0" align="center" width="740" style="border-collapse: collapse" bordercolor="#000000">
<tr>
<td align="center" height="20" bgcolor="#bdcbee" width="70" >销售单号</td>
<td align="center" height="20" bgcolor="#bdcbee" width="168" >商品名称(规格)</td>
<td align="center" height="20" bgcolor="#bdcbee" width="121" >客户</td>
<td align="center" height="20" bgcolor="#bdcbee" width="30" >数量</td>
<td align="center" height="20" bgcolor="#bdcbee" width="24" >单位</td>
<td align="center" height="20" bgcolor="#bdcbee" width="50" >销售价</td>
<td align="center" height="20" bgcolor="#bdcbee" width="23" >折%</td>
<td align="center" height="20" bgcolor="#bdcbee" width="52" >进货价</td>
<td align="center" height="20" bgcolor="#bdcbee" width="55" >小计</td>
<td align="center" height="20" bgcolor="#bdcbee" width="45" >利润</td>
<td align="center" height="20" bgcolor="#bdcbee" width="25" >付款</td>
<td align="center" height="20" bgcolor="#bdcbee" width="61" >销售日期</td>
</tr>
<%
end if
loop
rs1.close
set rs1=nothing
%>
</table>
<table border="1" cellpadding="0" cellspacing="0" width="740" height="20" align="center" style="border-collapse: collapse" bordercolor="#000000">
<tr>
<td><font color="#ff0000"><b>现金利润:</b></font><b><%=formatnumber(moncount2,varnum,-1)%></b> <%if moncount5<>"" then%><b><font color="#ff0000">欠款利润</font>:<%=formatnumber(moncount5,varnum,-1)%></b><%end if%> <%if moncount5<>"" then%><b><font color="#ff0000">毛利合计:</font><%=formatnumber(moncount5+moncount2,varnum,-1)%></b><%end if%></td>
</tr>
</table>
<%
end if
conn.close
set conn=nothing
%>
</html>
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器