📄 acurrentaccountreport.jsp
字号:
<%@page import="java.sql.*"%>
<jsp:useBean id="aCurrentAccoutReport" class="src.report.ACurrentAccoutReport" scope="page"/>
<jsp:useBean id="department" class="src.wuyang.Department" scope="page"/>
<jsp:useBean id="employee" class="src.wuyang.Employee" scope="page"/>
<jsp:useBean id="global" class="src.com.MyGlobal" scope="session"/>
<% if (global.isLogined == false) {
%>
<jsp:forward page="../pub/DBErr.jsp" >
<jsp:param name="rtcode" value="-4" />
</jsp:forward>
<% }
%>
<html>
<head>
<title>往来帐汇总表</title>
<link rel="stylesheet" href="report.css">
</head>
<%
aCurrentAccoutReport.setGlobal(global);
java.sql.Timestamp beginDate;
java.sql.Timestamp endDate;
String aBeginDate;
String beginDaten;
String beginDatey;
String beginDater;
int yue;
String aEndDate;
if((request.getParameter("beginDate")!=null)&&(!request.getParameter("beginDate").equals(""))){
aBeginDate = request.getParameter("beginDate");
beginDate=Timestamp.valueOf(aBeginDate);
} else {
beginDaten = aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),1);
yue = new Integer(aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),2)).intValue() -1;
beginDatey = "" + yue;
beginDater = aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),3);
beginDate=Timestamp.valueOf(beginDaten+"-"+beginDatey+"-"+beginDater+" 0:0:0.0");
}
if((request.getParameter("endDate")!=null)&&(!request.getParameter("endDate").equals(""))){
aEndDate = request.getParameter("endDate");
endDate=Timestamp.valueOf(aEndDate);
} else {
endDate = aCurrentAccoutReport.getCurDate();
}
%>
<body>
<center><br><FONT class=f16>往来帐明细表</FONT><center>
制表日期 <%= aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),0) %>
<br>
从 <%=aCurrentAccoutReport.getStringDate(beginDate,0) %> 到 <%= aCurrentAccoutReport.getStringDate(endDate,0) %>
<br>
<%
String[] employeeId; /* 选中的销售员/采购员*/
employeeId=request.getParameterValues("employeeId");%>
<%if (employeeId == null) {%>
<jsp:forward page="../pub/DBErr.jsp?rtcode=-109"/>
<%}%>
<%
if (employeeId != null) { /* 必须输入销售员名 */
String[] empName = new String[employeeId.length];
String[] deptName = new String[employeeId.length];
double[] lastAR = new double[employeeId.length];
double[] lastAP = new double[employeeId.length];
double[] thisAR = new double[employeeId.length];
double[] thisAP = new double[employeeId.length];
double[] balance = new double[employeeId.length];
for (int i = 0; i < employeeId.length; i++) {
employee.load(employeeId[i]);
department.load(employee.getDeptId());
empName[i] = employee.getEmpName();
deptName[i] = department.getDeptName();
double sumLastAR = 0,sumLastAP = 0,sumThisAR = 0,sumThisAP = 0,sumBalance = 0;
System.out.println("employeeId="+employeeId[i]);
aCurrentAccoutReport.report(employeeId[i],1,beginDate,endDate);
if (aCurrentAccoutReport.next() > 0 ) {
aCurrentAccoutReport.next();
sumLastAR = sumLastAR + aCurrentAccoutReport.getLastAR();
sumLastAP = sumLastAP + aCurrentAccoutReport.getLastAP();
sumThisAR = sumThisAR + aCurrentAccoutReport.getThisAR();
sumThisAP = sumThisAP + aCurrentAccoutReport.getThisAP();
sumBalance = sumBalance + aCurrentAccoutReport.getBalance();
%>
<br>
部门: <%=department.getDeptName()%> ----- <%=employee.getEmpName()%>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="#000000">
<tr>
<td align="center">单位名称</td>
<td align="center">上月应收款</td>
<td align="center">上月应付款</td>
<td align="center">本月应收款</td>
<td align="center">本月应付款</td>
<td align="center">本月增减</td>
<td align="center">最后发生日期</td>
</tr>
<%
do {
%>
<tr>
<td><%= aCurrentAccoutReport.getCustomerName() %></td>
<td align="right"><%= aCurrentAccoutReport.getLastAR() %></td>
<td align="right"><%= aCurrentAccoutReport.getLastAP() %></td>
<td align="right"><%= aCurrentAccoutReport.getThisAR() %></td>
<td align="right"><%= aCurrentAccoutReport.getThisAP() %></td>
<td align="right"><%= aCurrentAccoutReport.getBalance() %></td>
<td align="right"><%= aCurrentAccoutReport.getLmDate() %></td>
</tr>
<%
sumLastAR = sumLastAR + aCurrentAccoutReport.getLastAR();
sumLastAP = sumLastAP + aCurrentAccoutReport.getLastAP();
sumThisAR = sumThisAR + aCurrentAccoutReport.getThisAR();
sumThisAP = sumThisAP + aCurrentAccoutReport.getThisAP();
sumBalance = sumBalance + aCurrentAccoutReport.getBalance();
} while (aCurrentAccoutReport.next() > 0);
%>
<tr>
<td>合 计</td>
<td align="right"><%= sumLastAR %></td>
<td align="right"><%= sumLastAP %></td>
<td align="right"><%= sumThisAR %></td>
<td align="right"><%= sumThisAP %></td>
<td align="right"><%= sumBalance %></td>
<td align="right"> </td>
</tr>
</table>
<%
}
lastAR[i] = sumLastAR;
lastAP[i] = sumLastAP;
thisAR[i] = sumThisAR;
thisAP[i] = sumThisAP;
balance[i] = sumBalance;
}
%>
<%
String[] deptId; /* 选中的部门*/
deptId=request.getParameterValues("deptId");
if (deptId != null) { /* 必须输入部门 */
%>
<center><br><FONT class=f16a>往来帐明细表</FONT><center>
制表日期 <%= aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),0) %>
<br>
从 <%=aCurrentAccoutReport.getStringDate(beginDate,0) %> 到 <%= aCurrentAccoutReport.getStringDate(endDate,0) %>
<br>
<%
for (int i = 0; i < deptId.length; i++) {
department.load(deptId[i]);
double sumLastAR1 = 0,sumLastAP1 = 0,sumThisAR1 = 0,sumThisAP1 = 0,sumBalance1 = 0;
aCurrentAccoutReport.report(employeeId[i],0,beginDate,endDate);
if (aCurrentAccoutReport.next() > 0 ) {
aCurrentAccoutReport.next();
sumLastAR1 = sumLastAR1 + aCurrentAccoutReport.getLastAR();
sumLastAP1 = sumLastAP1 + aCurrentAccoutReport.getLastAP();
sumThisAR1 = sumThisAR1 + aCurrentAccoutReport.getThisAR();
sumThisAP1 = sumThisAP1 + aCurrentAccoutReport.getThisAP();
sumBalance1 = sumBalance1 + aCurrentAccoutReport.getBalance();
%>
<br>
部门: <%=department.getDeptName()%>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="#000000">
<tr>
<td align="center">单位名称</td>
<td align="center">上月应收款</td>
<td align="center">上月应付款</td>
<td align="center">本月应收款</td>
<td align="center">本月应付款</td>
<td align="center">本月增减</td>
<td align="center">最后发生日期</td>
</tr>
<%
do {
%>
<tr>
<td><%= aCurrentAccoutReport.getCustomerName() %></td>
<td align="right"><%= aCurrentAccoutReport.getLastAR() %></td>
<td align="right"><%= aCurrentAccoutReport.getLastAP() %></td>
<td align="right"><%= aCurrentAccoutReport.getThisAR() %></td>
<td align="right"><%= aCurrentAccoutReport.getThisAP() %></td>
<td align="right"><%= aCurrentAccoutReport.getBalance() %></td>
<td align="right"><%= aCurrentAccoutReport.getLmDate() %></td>
</tr>
<%
sumLastAR1 = sumLastAR1 + aCurrentAccoutReport.getLastAR();
sumLastAP1 = sumLastAP1 + aCurrentAccoutReport.getLastAP();
sumThisAR1 = sumThisAR1 + aCurrentAccoutReport.getThisAR();
sumThisAP1 = sumThisAP1 + aCurrentAccoutReport.getThisAP();
sumBalance1 = sumBalance1 + aCurrentAccoutReport.getBalance();
} while (aCurrentAccoutReport.next() > 0);
%>
<tr>
<td>合 计</td>
<td align="right"><%= sumLastAR1 %></td>
<td align="right"><%= sumLastAP1 %></td>
<td align="right"><%= sumThisAR1 %></td>
<td align="right"><%= sumThisAP1 %></td>
<td align="right"><%= sumBalance1 %></td>
<td> </td>
</tr>
</table>
<%
}
}
}
%>
<center><br><FONT class=f16a>往来帐汇总表</FONT><center>
制表日期 <%= aCurrentAccoutReport.getStringDate(aCurrentAccoutReport.getCurDate(),0) %>
<br>
从 <%=aCurrentAccoutReport.getStringDate(beginDate,0) %> 到 <%= aCurrentAccoutReport.getStringDate(endDate,0) %>
<br>
<table border="1" cellspacing="0" cellpadding="2" bordercolor="#000000">
<tr>
<td align="center">单位名称</td>
<td align="center">上月应收款</td>
<td align="center">上月应付款</td>
<td align="center">本月应收款</td>
<td align="center">本月应付款</td>
<td align="center">本月增减</td>
</tr>
<%
for (int j = 0; j < employeeId.length; j++) {
%>
<tr>
<td><%= deptName[j]%>--- <%= empName[j]%></td>
<td align="right"><%= lastAR[j] %></td>
<td align="right"><%= lastAP[j] %></td>
<td align="right"><%= thisAR[j] %></td>
<td align="right"><%= thisAP[j] %></td>
<td align="right"><%= balance[j] %></td>
</tr>
<%
}
%>
</table>
<%
}
%>
<div id = "pannel" class="text">
<input type="button" value=" 打印 " onclick=" window.pannel.style.visibility='hidden';window.print(); window.pannel.style.display='block';">
</div>
<p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -