<%
Pagenum=55 ' Specifies the number of lines to print
%>
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<TITLE> Sales Profit Detail report print </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\Internet 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 page &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"))
If keyword1<> "" Then
Today=keyword1
Else
If kdname1= "" Then
Today=year (Date ()) & "-" &month (date ())
Else
today=kdname1& "to" &kdname2
End If
End If
%>
<table border= "0" cellspacing= "0" cellpadding= "0" align= "center" width= "740" height= ">"
<tr>
<TD align= "Center" > Sales Profit Summary report </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 (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= "bgcolor=" #BDCBEE "width=" > Sales number </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Product name (SPEC) </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" 121 "> Customer </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Quantity </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Unit </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Sales price </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Fold%</td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" "> Purchase price </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Subtotal </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Profit </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Payment </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Sales Date </td>
</tr>
</table>
<%
Moncount2=0
Moncount5=0
Do as 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")) = "arrears" Then
Moncount6=csng (Rs1 ("lirun1"))
Moncount5=moncount5+moncount6
Else
Moncount3=csng (Rs1 ("lirun1"))
Moncount2=moncount2+moncount3
End If
%>
<tr>
<TD height= "Width=" > <%=rs1 ("sellautoid")%></td>
<TD height= "width=" ><%=decode (rs1 ("ProductName"))%> <%=rs1 ("Productsize")%></td>
<TD height= "A" width= "121" ><%=left (rs1 ("Gongshang"), 9)%></td>
<TD height= "width=" align= "Center" ><%=rs1 ("Productnum")%></td>
<TD height= "width=" align= "Center" ><%=rs1 ("Productdan")%></td>
<TD height= "width=" align= "right" ><%=formatnumber (Rs1 ("Chaoshi"), varnum,-1)%></td>
<TD height= "width=" align= "Center" ><%=rs1 ("Youhui")%></td>
<TD height= "width=" align= "right" ><%=formatnumber (Rs1 ("Productjia"), varnum,-1)%></td>
<TD height= "width=" align= "right" ><%=formatnumber (Rs1 ("Moncount1"), varnum,-1)%></td>
<TD height= "width=" align= "right" ><%=formatnumber (Rs1 ("lirun1"), varnum,-1)%></td>
<TD align= "center" height= "width=" ><%if Trim (rs1 ("Fukuan")) = "Arrears" Then%><font color=blue> <%=rs1 ("Fukuan")%></font><%else%><%=rs1 ("Fukuan")%><%end if%></td>
<TD height= "width=" ><%=rs1 ("Indate")%></td>
</tr>
<%
Rs1.movenext
End If
Next
%>
</table>
<%
If not rs1.eof and i=pagenum+1 then ' add page mark
%>
<div class= "Break" > </div>
<table border= "0" cellpadding= "0" cellspacing= "0" width= "740" height= "" align= "center" ><tr><td height= "></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= "bgcolor=" #BDCBEE "width=" > Sales number </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Product name (SPEC) </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" 121 "> Customer </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Quantity </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Unit </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Sales price </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Fold%</td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" "> Purchase price </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Subtotal </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Profit </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Payment </td>
<TD align= "center" height= "bgcolor=" #BDCBEE "width=" > Sales Date </td>
</tr>
<%
End If
Loop
Rs1.close
Set rs1=nothing
%>
</table>
<table border= "1" cellpadding= "0" cellspacing= "0" width= "740" "height=" align= "center" style= "Border-collapse: Collapse "bordercolor=" #000000 ">
<tr>
<td><font color= "#FF0000" ><b> Cash profit: </b></font><b><%=formatnumber ( moncount2,varnum,-1)%></b> <%if moncount5<> "Then%><b><font color=" #FF0000 "> Arrears profit </font>:<%=formatnumber (moncount5,varnum,-1)%></b><%end if%> <%if "" Then%><b><font color= "#FF0000" Total > Gross margin: </font><%=formatnumber (moncount5+moncount2,varnum,- 1)%></b><%end if%></td>
</tr>
</table>
<%
End If
Conn.close
Set conn=nothing
%>
</BODY>
</HTML>