服务内容
Our service
客户案例
Case list
推荐文章
Recommended articles
热门内容
Hot tags
|
ASP控制每页打印行数发表日期:2016/7/19 16:37:50 浏览次数:
<% pagenum=55'指定打印行数 %>
销售利润明细报表打印
<% 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&"至"&kdname2 end if end if %> <% 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 %> 销售单号 | 商品名称(规格) | 客户 | 数量 | 单位 | 销售价 | 折% | 进货价 | 小计 | 利润 | 付款 | 销售日期 | <% moncount2=0 moncount5=0 Do while not rs1.eof %> <% 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 %> <%=rs1("sellautoid")%> | <%=Decode(rs1("productname"))%> <%=rs1("productsize")%> | <%=left(rs1("gongshang"),9)%> | <%=rs1("productnum")%> | <%=rs1("productdan")%> | <%=formatNumber(rs1("chaoshi"),varnum,-1)%> | <%=rs1("youhui")%> | <%=formatNumber(rs1("productjia"),varnum,-1)%> | <%=formatNumber(rs1("moncount1"),varnum,-1)%> | <%=formatNumber(rs1("lirun1"),varnum,-1)%> | <%if trim(rs1("fukuan"))="欠款" then%><%=rs1("fukuan")%><%else%><%=rs1("fukuan")%><%end if%> | <%=rs1("indate")%> | <% rs1.movenext end if next %>
<% if not rs1.eof and i=pagenum+1 then '添加分页标记 %> 销售单号 | 商品名称(规格) | 客户 | 数量 | 单位 | 销售价 | 折% | 进货价 | 小计 | 利润 | 付款 | 销售日期 | <% end if loop rs1.close set rs1=nothing %>
现金利润:<%=formatNumber(moncount2,varnum,-1)%> <%if moncount5<>"" then%>欠款利润:<%=formatNumber(moncount5,varnum,-1)%><%end if%> <%if moncount5<>"" then%>毛利合计:<%=formatNumber(moncount5+moncount2,varnum,-1)%><%end if%> | <% end if conn.close set conn=nothing %>
| |