DepartmentTotalBudget.jsp
13.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<%@ page import="weaver.general.Util,java.util.*,java.math.*" %>
<%@ page import="java.sql.Timestamp" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="BudgetfeeTypeComInfo" class="weaver.fna.maintenance.BudgetfeeTypeComInfo" scope="page"/>
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<SCRIPT language="javascript" src="../../js/weaver_wev8.js"></script>
</head>
<%
String imagefilename = "/images/hdReport_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(386,user.getLanguage());
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<table width=100% height=100% border="0" cellspacing="0" cellpadding="0">
<colgroup>
<col width="10">
<col width="">
<col width="10">
<tr>
<td height="10" colspan="3"></td>
</TR>
<tr>
<td ></td>
<td valign="top">
<TABLE class=Shadow>
<tr>
<td valign="top">
<%
Date newdate = new Date() ;
long datetime = newdate.getTime() ;
Timestamp timestamp = new Timestamp(datetime) ;
String CurrentDate = (timestamp.toString()).substring(0,4) + "-" + (timestamp.toString()).substring(5,7) + "-" +(timestamp.toString()).substring(8,10);
String CurrentTime = (timestamp.toString()).substring(11,13) + ":" + (timestamp.toString()).substring(14,16) + ":" +(timestamp.toString()).substring(17,19);
String year = CurrentDate.substring(0,4);
String departmentid=Util.null2String(request.getParameter("departmentid"));
String feeid=Util.null2String(request.getParameter("feeid"));
String style=Util.null2String(request.getParameter("style"));
if(style.equals("")) style="1";
char flag=2;
String sql="select * from bill_budgetdetail ";
if(!departmentid.equals("")) sql+=" where departmentid="+departmentid;
ArrayList feeids=new ArrayList();
ArrayList deptids=new ArrayList();
ArrayList ids=new ArrayList();
ArrayList budgets=new ArrayList();
if(departmentid.equals("")){
RecordSet.executeSql("select * from hrmdepartment");
while(RecordSet.next()){
deptids.add(RecordSet.getString("id"));
}
}else{
deptids.add(departmentid);
}
if(feeid.equals("")){
RecordSet.executeProc("FnaBudgetfeeType_Select","");
while(RecordSet.next()){
feeids.add(RecordSet.getString("id"));
}
}else{
feeids.add(feeid);
}
RecordSet.executeSql(sql);
while(RecordSet.next()){
String tmpid=RecordSet.getString("departmentid")+"_"+RecordSet.getString("feeid")+"_"+RecordSet.getString("month");
ids.add(tmpid);
budgets.add(RecordSet.getFloat("budget")+"");
}
%>
<form name=frmmain action="DepartmentTotalBudget.jsp" method=post>
<div style="display:none">
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(354,user.getLanguage())+",javascript:frmmain.submit(),self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<BUTTON class=BtnReset accessKey=R name=button1 onclick="frmmain.submit()"><U>R</U>-<%=SystemEnv.getHtmlLabelName(354,user.getLanguage())%></BUTTON>
</div>
<table class=ViewForm>
<col width="10%"><col width="30%">
<col width="10%"><col width="20%">
<col width="10%"><col width="20%">
<tr class=Title><th colspan=6><%=SystemEnv.getHtmlLabelName(324,user.getLanguage())%></th></TR>
<tr class=Spacing> <td class=Line1 colspan=15></td></TR>
<tr>
<td><%=SystemEnv.getHtmlLabelName(124,user.getLanguage())%></td>
<td class=field><button class=browser onclick="onShowDepartment()"></button>
<span id=departmentspan><a href="/hrm/company/HrmDepartmentDsp.jsp?id=<%=departmentid%>">
<%=Util.toScreen(DepartmentComInfo.getDepartmentname(departmentid),user.getLanguage())%></a></span>
<input type=hidden name="departmentid" value="<%=departmentid%>">
</td>
<td><%=SystemEnv.getHtmlLabelName(1491,user.getLanguage())%></td>
<td class=field><button class=browser onclick="onShowBudgetFee()"></button>
<span id=feespan><a href="/fna/maintenance/FnaBudgetfeeTypeEdit.jsp?id=<%=feeid%>">
<%=Util.toScreen(BudgetfeeTypeComInfo.getBudgetfeeTypename(feeid),user.getLanguage())%></a></span>
<input type=hidden name="feeid" value="<%=feeid%>">
</td>
<td><%=SystemEnv.getHtmlLabelName(1014,user.getLanguage())%></td>
<td class=field>
<select name=style class=InputStyle size=1>
<option value="1" <%if(style.equals("1")){%> selected <%}%>><%=SystemEnv.getHtmlLabelName(1015,user.getLanguage())%></option>
<option value="2" <%if(style.equals("2")){%> selected <%}%>><%=SystemEnv.getHtmlLabelName(1016,user.getLanguage())%></option>
</select>
</td>
</TR><tr><td class=Line colspan=6></td></tr>
</table>
</form>
<script language=vbs>
sub onShowDepartment()
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp?selectedids="&frmmain.departmentid.value)
if (Not IsEmpty(id)) then
if id(0)<> 0 then
departmentspan.innerHtml = "<a href='/hrm/company/HrmDepartmentDsp.jsp?id='"+id(0)+"'>"+id(1)+"</a>"
frmmain.departmentid.value=id(0)
else
departmentspan.innerHtml = ""
frmmain.departmentid.value=""
end if
end if
end sub
sub onShowBudgetFee()
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/fna/maintenance/BudgetfeeTypeBrowser.jsp")
if (Not IsEmpty(id)) then
if id(0)<> "" then
feespan.innerHtml = "<a href='/fna/maintenance/FnaBudgetfeeTypeEdit.jsp?id='"+id(0)+"'>"+id(1)+"</a>"
frmmain.feeid.value=id(0)
else
feespan.innerHtml = ""
frmmain.feeid.value=""
end if
end if
end sub
</script>
<%if(style.equals("1")){%>
<table class=ListStyle cellspacing=1>
<col width="10%">
<col width="10%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="8%">
<tr class=header><th colspan=15><%=SystemEnv.getHtmlLabelName(1490,user.getLanguage())%></th></TR>
<tr class=header>
<td><%=SystemEnv.getHtmlLabelName(124,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1491,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1492,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1493,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1494,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1495,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1496,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1497,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1498,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1499,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1800,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1801,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1802,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1803,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1013,user.getLanguage())%></td>
</TR><TR class=Line><TD colSpan=15></TD></TR>
<%
boolean islight=true;
boolean iswrite=true;
boolean hasdata=true;
String feeyeartotal="";
String monthtotal="";
String alltotal="";
for(int i=0;i<deptids.size();i++){
iswrite=true;
String tmpdeptid=(String)deptids.get(i);
String deptname=DepartmentComInfo.getDepartmentname(tmpdeptid);
for(int j=0;j<feeids.size();j++){
feeyeartotal="";
String tmpfeeid=(String)feeids.get(j);
%> <tr <%if(islight){%> class=datalight <%}else{%> class=datadark<%}%>>
<td><%if(iswrite){%><%=Util.toScreen(deptname,user.getLanguage())%>
<%iswrite=!iswrite;
}%>
</td>
<td>
<%=BudgetfeeTypeComInfo.getBudgetfeeTypename(tmpfeeid)%>
</td>
<%
for(int k=1;k<13;k++){
String tmpid=tmpdeptid+"_"+tmpfeeid+"_"+k;
String tmpbudget="";
int tmpindex=ids.indexOf(tmpid);
if(tmpindex==-1) tmpbudget="0";
else tmpbudget=(String)budgets.get(tmpindex);
feeyeartotal=Util.getFloatValue(feeyeartotal,0)+Util.getFloatValue(tmpbudget,0)+"";
%> <td><%=tmpbudget%></td>
<%
}
islight=!islight;
%>
<td><%=feeyeartotal%></td>
</TR>
<% }%>
<tr class=header style="FONT-WEIGHT: bold">
<td><%=SystemEnv.getHtmlLabelName(358,user.getLanguage())%></td>
<td> </td>
<%
monthtotal="";
alltotal="";
for(int m=1;m<13;m++){
RecordSet.executeProc("bill_BudgetDetail_SMonthTotal",tmpdeptid+flag+""+m+flag+year);
RecordSet.next();
monthtotal=RecordSet.getString(1);
if(monthtotal.equals("")) monthtotal="0";
alltotal=Util.getFloatValue(monthtotal,0)+Util.getFloatValue(alltotal,0)+"";
%>
<td><%=Util.getFloatValue(monthtotal,0)%></td>
<% }
%>
<td><%=Util.getFloatValue(alltotal,0)%></td>
</TR>
<% }%>
<tr <%if(islight){%>class=datalight <%} else {%>class=datadark<%}%>><td colspan=15> </td></tr>
<tr class=header style="FONT-WEIGHT: bold; COLOR: red">
<td><%=SystemEnv.getHtmlLabelName(523,user.getLanguage())%></td>
<td> </td>
<%
monthtotal="";
alltotal="";
for(int n=1;n<13;n++){
RecordSet.executeProc("bill_BudgetDetail_SAllMonth",""+n+flag+year);
RecordSet.next();
monthtotal=RecordSet.getString(1);
if(monthtotal.equals("")) monthtotal="0";
alltotal=Util.getFloatValue(monthtotal,0)+Util.getFloatValue(alltotal,0)+"";
%>
<td><%=Util.getFloatValue(monthtotal,0)%></td>
<% }
%>
<td><%=Util.getFloatValue(alltotal,0)%></td>
</TR>
</table>
<%} else {%>
<table class=ListStyle cellspacing=1>
<col width="10%">
<col width="10%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="6%">
<col width="8%">
<tr class=header><th colspan=15><%=SystemEnv.getHtmlLabelName(1490,user.getLanguage())%></th></TR>
<tr class=header>
<td><%=SystemEnv.getHtmlLabelName(1491,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(124,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1492,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1493,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1494,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1495,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1496,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1497,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1498,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1499,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1800,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1801,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1802,user.getLanguage())%></td><td><%=SystemEnv.getHtmlLabelName(1803,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(1013,user.getLanguage())%></td>
</TR><tr><td class=Line colspan=15></td></tr>
<%
boolean islight=true;
boolean iswrite=true;
boolean hasdata=true;
String feeyeartotal="";
String monthtotal="";
String alltotal="";
for(int i=0;i<feeids.size();i++){
iswrite=true;
String tmpfeeid=(String)feeids.get(i);
String feename=BudgetfeeTypeComInfo.getBudgetfeeTypename(tmpfeeid);
for(int j=0;j<deptids.size();j++){
feeyeartotal="";
String tmpdeptid=(String)deptids.get(j);
%> <tr <%if(islight){%> class=datalight <%}else{%> class=datadark<%}%>>
<td><%if(iswrite){%><%=Util.toScreen(feename,user.getLanguage())%>
<%iswrite=!iswrite;
}%>
</td>
<td>
<%=DepartmentComInfo.getDepartmentname(tmpdeptid)%>
</td>
<%
for(int k=1;k<13;k++){
String tmpid=tmpdeptid+"_"+tmpfeeid+"_"+k;
String tmpbudget="";
int tmpindex=ids.indexOf(tmpid);
if(tmpindex==-1) tmpbudget="0";
else tmpbudget=(String)budgets.get(tmpindex);
feeyeartotal=Util.getFloatValue(feeyeartotal,0)+Util.getFloatValue(tmpbudget,0)+"";
%> <td><%=tmpbudget%></td>
<%
}
islight=!islight;
%>
<td><%=feeyeartotal%></td>
</TR>
<% }%>
<tr class=header style="FONT-WEIGHT: bold">
<td><%=SystemEnv.getHtmlLabelName(358,user.getLanguage())%></td>
<td> </td>
<%
monthtotal="";
alltotal="";
for(int m=1;m<13;m++){
RecordSet.executeProc("bill_BudgetDetail_SMonthTotal",tmpfeeid+flag+""+m+flag+year);
RecordSet.next();
monthtotal=RecordSet.getString(1);
if(monthtotal.equals("")) monthtotal="0";
alltotal=Util.getFloatValue(monthtotal,0)+Util.getFloatValue(alltotal,0)+"";
%>
<td><%=Util.getFloatValue(monthtotal,0)%></td>
<% }
%>
<td><%=Util.getFloatValue(alltotal,0)%></td>
</TR>
<% }%>
<tr <%if(islight){%>class=datalight <%} else {%>class=datadark<%}%>><td colspan=15> </td></tr>
<tr class=header style="FONT-WEIGHT: bold; COLOR: red">
<td><%=SystemEnv.getHtmlLabelName(523,user.getLanguage())%></td>
<td> </td>
<%
monthtotal="";
alltotal="";
for(int n=1;n<13;n++){
RecordSet.executeProc("bill_BudgetDetail_SAllMonth",""+n+flag+year);
RecordSet.next();
monthtotal=RecordSet.getString(1);
if(monthtotal.equals("")) monthtotal="0";
alltotal=Util.getFloatValue(monthtotal,0)+Util.getFloatValue(alltotal,0)+"";
%>
<td><%=Util.getFloatValue(monthtotal,0)%></td>
<% }
%>
<td><%=Util.getFloatValue(alltotal,0)%></td>
</TR>
</table>
<%}%>
</td>
</TR>
</TABLE>
</td>
<td></td>
</TR>
<tr>
<td height="10" colspan="3"></td>
</TR>
</table>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
</body>
</html>