HrmSalaryPay.jsp
28.7 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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="weaver.general.Util,
weaver.general.MathUtil,
weaver.file.*" %>
<%@ page import="java.util.*" %>
<%
if(!HrmUserVarify.checkUserRight("HrmResourceComponentEdit:Edit", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
%>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="SalaryComInfo" class="weaver.hrm.finance.SalaryComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="JobTitlesComInfo" class="weaver.hrm.job.JobTitlesComInfo" scope="page"/>
<jsp:useBean id="SalaryManager" class="weaver.hrm.finance.SalaryManager" scope="page" />
<jsp:useBean id="JobActivitiesComInfo" class="weaver.hrm.job.JobActivitiesComInfo" scope="page" />
<jsp:useBean id="HrmKqSystemComInfo" class="weaver.hrm.schedule.HrmKqSystemComInfo" scope="page" />
<jsp:useBean id="ExcelFile" class="weaver.file.ExcelFile" scope="session"/>
<%
//generate excel report,xiaofeng
ExcelFile.init ();
String filename = SystemEnv.getHtmlLabelName(503,user.getLanguage());
ExcelFile.setFilename(""+filename) ;
// 下面建立一个头部的样式, 我们系统中的表头都采用这个样式!
ExcelStyle es = ExcelFile.newExcelStyle("Header") ;
es.setGroundcolor(ExcelStyle.WeaverHeaderGroundcolor) ;
es.setFontcolor(ExcelStyle.WeaverHeaderFontcolor) ;
es.setFontbold(ExcelStyle.WeaverHeaderFontbold) ;
es.setAlign(ExcelStyle.WeaverHeaderAlign) ;
ExcelStyle es1 = ExcelFile.newExcelStyle("Bold") ;
es1.setFontcolor(ExcelStyle.WeaverHeaderFontcolor) ;
es1.setFontbold(ExcelStyle.WeaverHeaderFontbold) ;
es1.setAlign(ExcelStyle.ALIGN_LEFT) ;
ExcelStyle es2 = ExcelFile.newExcelStyle("Total") ;
es2.setGroundcolor(ExcelStyle.WeaverHeaderGroundcolor) ;
es2.setFontcolor(ExcelStyle.WeaverHeaderFontcolor) ;
es2.setFontbold(ExcelStyle.WeaverHeaderFontbold) ;
es2.setAlign(ExcelStyle.ALIGN_RIGHT) ;
ExcelSheet et = ExcelFile.newExcelSheet(""+filename) ;
// 下面设置每一列的宽度, 如果不设置, 将按照excel默认的宽度
et.addColumnwidth(6000) ;
et.addColumnwidth(6000) ;
et.addColumnwidth(6000) ;
et.addColumnwidth(6000) ;
ExcelRow er = null ;
er = et.newExcelRow() ;
//end
String currentdate = Util.null2String(request.getParameter("currentdate"));
String isself = Util.null2String(request.getParameter("isself"));
Calendar thedate = Calendar.getInstance ();
Calendar thedate1 = Calendar.getInstance ();
if(currentdate.equals("")){
currentdate = Util.add0(thedate.get(thedate.YEAR), 4) +"-"+
Util.add0(thedate.get(thedate.MONTH) + 1, 2) ;
}
int salaryyear = Util.getIntValue(currentdate.substring(0 , 4)) ;
int salarymonth = Util.getIntValue(currentdate.substring(5 , 7)) ;
int salaryendday = Util.getIntValue(HrmKqSystemComInfo.getSalaryenddate(),31) ;
thedate.set( salaryyear , salarymonth-1, salaryendday) ;
thedate1.set( salaryyear , salarymonth-1, 1) ;
if(thedate.get(Calendar.MONTH)!= thedate1.get(Calendar.MONTH)) {
thedate.set( salaryyear , salarymonth, 1) ;
thedate.add(Calendar.DATE , -1) ;
}
String salaryenddate = Util.add0(thedate.get(Calendar.YEAR) , 4) + "-" +
Util.add0(thedate.get(Calendar.MONTH) + 1 , 2) + "-" +
Util.add0(thedate.get(Calendar.DAY_OF_MONTH) , 2) ;
thedate.set( salaryyear , salarymonth-2, salaryendday) ;
thedate1.set( salaryyear , salarymonth-2, 1) ;
if(thedate.get(Calendar.MONTH)!= thedate1.get(Calendar.MONTH)) {
thedate.set( salaryyear , salarymonth-1, 1) ;
}
else {
thedate.add(Calendar.DATE , 1) ;
}
String salarybegindate = Util.add0(thedate.get(Calendar.YEAR) , 4) + "-" +
Util.add0(thedate.get(Calendar.MONTH) + 1 , 2) + "-" +
Util.add0(thedate.get(Calendar.DAY_OF_MONTH) , 2) ;
int payid = 0 ;
int isvalidate = 0 ;
RecordSet.executeSql( "select id , isvalidate from HrmSalaryPay where paydate = '" + currentdate + "'" );
if( RecordSet.next() ) {
payid = Util.getIntValue( RecordSet.getString("id") ,0 ) ;
isvalidate = Util.getIntValue( RecordSet.getString("isvalidate") ,0 ) ;
}
String departmentid = Util.null2String(request.getParameter("departmentid")); // 部门
String jobactivityid = Util.null2String(request.getParameter("jobactivityid")); // 职务
String jobtitle = Util.null2String(request.getParameter("jobtitle")); // 岗位
String resourceid = Util.null2String(request.getParameter("resourceid")); // 人力资源
String status = Util.null2String(request.getParameter("status")); // 人力资源状态
String sqlwhere="";
if( status.equals("") ) status = "8" ;
if(isself.equals("1")) {
if( !departmentid.equals("") ){
sqlwhere+=" and departmentid = " + departmentid;
}
if( !jobactivityid.equals("") ){
sqlwhere+=" and jobtitle in ( select id from HrmJobTitles where jobactivityid = " + jobactivityid + " ) " ;
}
if( !jobtitle.equals("") ){
sqlwhere+=" and jobtitle = " + jobtitle;
}
if( !resourceid.equals("") ){
sqlwhere+=" and id = " + resourceid;
}
if( !status.equals("9") ) {
if( status.equals("8") )
sqlwhere+=" and (status = 0 or status = 1 or status = 2 or status = 3) " ;
else
sqlwhere+=" and status = " + status ;
}
}
%>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
</HEAD>
<%
String imagefilename = "/images/hdHRMCard_wev8.gif";
String titlename =SystemEnv.getHtmlLabelName(503,user.getLanguage());
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(197,user.getLanguage())+",javascript:submitData(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
if( payid == 0 ){
RCMenu += "{"+SystemEnv.getHtmlLabelName(15845,user.getLanguage())+",javascript:onCreate(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}else {
RCMenu += "{"+SystemEnv.getHtmlLabelName(15846,user.getLanguage())+",javascript:onReCreate(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(15847,user.getLanguage())+",javascript:onChange(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
/* 取消打印部分的菜单
RCMenu += "{"+SystemEnv.getHtmlLabelName(257,user.getLanguage())+SystemEnv.getHtmlLabelName(524,user.getLanguage())+",javascript:onPrintCurrent(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(257,user.getLanguage())+SystemEnv.getHtmlLabelName(332,user.getLanguage())+",javascript:onPrintAll(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(257,user.getLanguage())+SystemEnv.getHtmlLabelName(524,user.getLanguage())+"2,javascript:onPrintCurrent2(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(257,user.getLanguage())+SystemEnv.getHtmlLabelName(332,user.getLanguage())+"2,javascript:onPrintAll2(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
*/
if( isvalidate == 0 ) {
RCMenu += "{"+SystemEnv.getHtmlLabelName(15848,user.getLanguage())+",javascript:onSend(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
}
}
//added by xiaofeng
RCMenu += "{Excel,/weaver/weaver.file.ExcelOut,ExcelOut} " ;
RCMenu += "{"+SystemEnv.getHtmlLabelName(1290,user.getLanguage())+",HrmSalaryManage.jsp?departmentid="+departmentid+"&jobactivityid="+jobactivityid+"&jobtitle="+jobtitle+"&resourceid="+resourceid+"&status="+status+",_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<iframe id="ExcelOut" name="ExcelOut" border=0 frameborder=no noresize=NORESIZE height="0%" width="0%"></iframe>
<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">
<form name=frmmain method=post action="HrmSalaryPay.jsp">
<input class=inputstyle type="hidden" name="method" value="">
<input class=inputstyle type="hidden" name="payid" value="<%=payid%>">
<input class=inputstyle type="hidden" name="salarybegindate" value="<%=salarybegindate%>">
<input class=inputstyle type="hidden" name="salaryenddate" value="<%=salaryenddate%>">
<input type="hidden" name="isself" value="1">
<table class=Viewform>
<COLGROUP><COL width="10%"><COL width="39%"><COL width="2%"><COL width="10%"><COL width="39%">
<TBODY>
<TR class=Title colspan=5>
<TH><%=SystemEnv.getHtmlLabelName(324,user.getLanguage())%></TH>
<% er.addStringValue(SystemEnv.getHtmlLabelName(324,user.getLanguage()),"Bold"); %>
</TR>
<TR class=Spacing>
<TD class=Line1 colspan=5></TD>
</TR>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(15849,user.getLanguage())%></TD>
<TD class=Field>
<BUTTON class=calendar type="button" id=SelectDate onclick=getSdDate(currentdatespan,currentdate)></BUTTON>
<SPAN id=currentdatespan style="FONT-SIZE: x-small"><%=currentdate%></SPAN>
<input class=inputstyle type="hidden" name="currentdate" value=<%=currentdate%>>
</TD>
<TD> </TD>
<TD><%=SystemEnv.getHtmlLabelName(124,user.getLanguage())%></TD>
<TD class=field>
<button class=Browser id=SelectDeparment onClick="onShowDepartment(departmentspan,departmentid)"></button>
<span class=inputstyle id=departmentspan><%=Util.toScreen(DepartmentComInfo.getDepartmentname(departmentid),user.getLanguage())%></span>
<input class=inputstyle id=departmentid type=hidden name=departmentid value="<%=departmentid%>">
</TD>
<% //xiaofeng
ExcelRow er1=et.newExcelRow();
er1.addStringValue(SystemEnv.getHtmlLabelName(15849,user.getLanguage())+":","Bold");
er1.addStringValue(currentdate);
er1.addStringValue(SystemEnv.getHtmlLabelName(124,user.getLanguage())+":","Bold");
er1.addStringValue(Util.toScreen(DepartmentComInfo.getDepartmentname(departmentid),user.getLanguage()));
%>
</TR>
<TR><TD class=Line colSpan=6></TD></TR>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(1915,user.getLanguage())%></TD>
<TD class=field>
<BUTTON class=Browser onClick="onShowJobActivity(jobactivityspan,jobactivityid)"></BUTTON> <span class=inputstyle id=jobactivityspan>
<%=Util.toScreen(JobActivitiesComInfo.getJobActivitiesname(jobactivityid), user.getLanguage())%>
</span>
<input class=inputstyle id=jobactivityid type=hidden name=jobactivityid value="<%=jobactivityid%>">
</TD>
<TD> </TD>
<TD><%=SystemEnv.getHtmlLabelName(6086,user.getLanguage())%></TD>
<TD class=field>
<BUTTON class=Browser id=SelectJobTitle onclick="onShowJobtitle(jobtitlespan,jobtitle)"></BUTTON>
<SPAN id=jobtitlespan><%=Util.toScreen(JobTitlesComInfo.getJobTitlesname(jobtitle),user.getLanguage())%></SPAN>
<input class=inputstyle id=jobtitle type=hidden name=jobtitle value="<%=jobtitle%>">
</TD>
<% //xiaofeng
ExcelRow er2=et.newExcelRow();
er2.addStringValue(SystemEnv.getHtmlLabelName(1915,user.getLanguage())+":","Bold");
er2.addStringValue(Util.toScreen(JobActivitiesComInfo.getJobActivitiesname(jobactivityid), user.getLanguage()));
er2.addStringValue(SystemEnv.getHtmlLabelName(6086,user.getLanguage())+":","Bold");
er2.addStringValue(Util.toScreen(JobTitlesComInfo.getJobTitlesname(jobtitle),user.getLanguage()));
%>
</TR>
<TR><TD class=Line colSpan=6></TD></TR>
<TR>
<TD><%=SystemEnv.getHtmlLabelName(179,user.getLanguage())%></TD>
<TD class=field>
<button class=browser onClick="onShowResource(resourceidspan,resourceid)"></button>
<span id=resourceidspan>
<%=Util.toScreen(ResourceComInfo.getResourcename(""+resourceid),user.getLanguage())%>
</span>
<input class=inputstyle type=hidden name=resourceid value="<%=resourceid%>">
</TD>
<TD> </TD>
<TD><%=SystemEnv.getHtmlLabelName(15842,user.getLanguage())%></TD>
<TD class=Field>
<SELECT class=inputstyle id=status name=status>
<OPTION value="9" <% if(status.equals("9")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(332,user.getLanguage())%></OPTION>
<OPTION value="0" <% if(status.equals("0")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15710,user.getLanguage())%></OPTION>
<OPTION value="1" <% if(status.equals("1")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15711,user.getLanguage())%></OPTION>
<OPTION value="2" <% if(status.equals("2")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(480,user.getLanguage())%></OPTION>
<OPTION value="3" <% if(status.equals("3")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(15844,user.getLanguage())%></OPTION>
<OPTION value="4" <% if(status.equals("4")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(6094,user.getLanguage())%></OPTION>
<OPTION value="5" <% if(status.equals("5")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(6091,user.getLanguage())%></OPTION>
<OPTION value="6" <% if(status.equals("6")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(6092,user.getLanguage())%></OPTION>
<OPTION value="7" <% if(status.equals("7")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(2245,user.getLanguage())%></OPTION>
<OPTION value="8" <% if(status.equals("8")) {%>selected<%}%>><%=SystemEnv.getHtmlLabelName(1831,user.getLanguage())%></OPTION>
</SELECT>
</TD>
<% //xiaofeng
ExcelRow er3=et.newExcelRow();
er3.addStringValue(SystemEnv.getHtmlLabelName(179,user.getLanguage())+":","Bold");
er3.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(""+resourceid),user.getLanguage()));
er3.addStringValue(SystemEnv.getHtmlLabelName(15842,user.getLanguage())+":","Bold");
if(status.equals("9"))
er3.addStringValue(SystemEnv.getHtmlLabelName(332,user.getLanguage()));
if(status.equals("0"))
er3.addStringValue(SystemEnv.getHtmlLabelName(15710,user.getLanguage()));
if(status.equals("1"))
er3.addStringValue(SystemEnv.getHtmlLabelName(15711,user.getLanguage()));
if(status.equals("2"))
er3.addStringValue(SystemEnv.getHtmlLabelName(480,user.getLanguage()));
if(status.equals("3"))
er3.addStringValue(SystemEnv.getHtmlLabelName(15844,user.getLanguage()));
if(status.equals("4"))
er3.addStringValue(SystemEnv.getHtmlLabelName(6094,user.getLanguage()));
if(status.equals("5"))
er3.addStringValue(SystemEnv.getHtmlLabelName(6091,user.getLanguage()));
if(status.equals("6"))
er3.addStringValue(SystemEnv.getHtmlLabelName(6092,user.getLanguage()));
if(status.equals("7"))
er3.addStringValue(SystemEnv.getHtmlLabelName(2245,user.getLanguage()));
if(status.equals("8"))
er3.addStringValue(SystemEnv.getHtmlLabelName(1831,user.getLanguage()));
%>
</TR>
<TR><TD class=Line colSpan=6></TD></TR>
</TBODY>
</table>
</form>
<br>
<TABLE class=ListStyle cellspacing=1 >
<COLGROUP><COL width="100%">
<TBODY>
<TR class=Header>
<TH><%=SystemEnv.getHtmlLabelName(503,user.getLanguage())%> (<%=salarybegindate%> ~ <%=salaryenddate%>) <%if( payid == 0 ){%><font color=red><%=SystemEnv.getHtmlLabelName(15850,user.getLanguage())%></font><%}%></TH>
<% //xiaofeng
ExcelRow er4=et.newExcelRow();
er4.addStringValue(SystemEnv.getHtmlLabelName(503,user.getLanguage()),"Bold");
%>
</TR>
</TABLE>
<TABLE class=ListStyle cellspacing=1 >
<TBODY>
<tr class=Header>
<TH width="10%" rowspan=2 style="TEXT-ALIGN:center;TEXT-VALIGN:middle"><nobr><%=SystemEnv.getHtmlLabelName(195,user.getLanguage())%></TH>
<TH width="10%" rowspan=2 style="TEXT-ALIGN:center;TEXT-VALIGN:middle"><nobr><%=SystemEnv.getHtmlLabelName(6086,user.getLanguage())%></TH>
<% //xiaofeng
ExcelRow er5=et.newExcelRow();
er5.addStringValue(SystemEnv.getHtmlLabelName(195,user.getLanguage()),"Header");
er5.addStringValue(SystemEnv.getHtmlLabelName(6086,user.getLanguage()),"Header");
%>
<%
while(SalaryComInfo.next()) {
et.addColumnwidth(6000) ;
String itemname = Util.toScreen(SalaryComInfo.getSalaryname(),user.getLanguage()) ;
String itemtype = Util.null2String(SalaryComInfo.getSalaryItemtype()) ;
if( !itemtype.equals("2") ) {
%>
<TH width="10%" rowspan=2 style="TEXT-ALIGN:center;TEXT-VALIGN:middle"><nobr><%=itemname%></TH>
<% er5.addStringValue(itemname,"Header");
} else { %>
<TH colspan=2 style="TEXT-ALIGN:center"><nobr><%=itemname%></TH>
<% er5.addStringValue(itemname,"Header");
}
}
%>
</tr>
<tr class=Header>
<%
//xiaofeng
ExcelRow er6=et.newExcelRow();
SalaryComInfo.setTofirstRow() ;
while(SalaryComInfo.next()) {
String itemtype = Util.null2String(SalaryComInfo.getSalaryItemtype()) ;
if( !itemtype.equals("2") ) continue ;
%>
<TH width="5%" style="TEXT-ALIGN:center"><nobr><%=SystemEnv.getHtmlLabelName(6087,user.getLanguage())%></TH>
<TH width="5%" style="TEXT-ALIGN:center"><nobr><%=SystemEnv.getHtmlLabelName(1851,user.getLanguage())%></TH>
<%
er6.addStringValue(SystemEnv.getHtmlLabelName(6087,user.getLanguage()));
er6.addStringValue(SystemEnv.getHtmlLabelName(1851,user.getLanguage()));
}
%>
</tr>
<%
ArrayList colSumList = new ArrayList();
boolean isBegin = true;
int curColIndex = 0;
double temD1 = 0.0;
if(isself.equals("1")) {
if( payid != 0 ) {
ArrayList resourceitems = new ArrayList() ;
ArrayList salarys = new ArrayList() ;
RecordSet.executeSql( "select itemid , hrmid, salary from HrmSalaryPaydetail where payid = " + payid );
while( RecordSet.next() ) {
String itemid = Util.null2String( RecordSet.getString("itemid") ) ;
String hrmid = Util.null2String( RecordSet.getString("hrmid") ) ;
String salary = "" + Util.getDoubleValue( RecordSet.getString("salary") , 0 ) ;
resourceitems.add( hrmid + "_" + itemid ) ;
salarys.add( salary ) ;
}
RecordSet.executeSql( " select id , jobtitle from HrmResource where id >0 " + sqlwhere + " order by departmentid , id " );
// 为了打印, 将工资设置到session 中
session.setAttribute("weaversalarykey" , resourceitems) ;
session.setAttribute("weaversalaryvalue" , salarys) ;
session.setAttribute("weaversalarywhere" , sqlwhere) ;
session.setAttribute("weaversalaryyear" , ""+salaryyear) ;
session.setAttribute("weaversalarymonth" , ""+salarymonth) ;
boolean isLight = false;
while(RecordSet.next()) {
String resourceidrs = Util.null2String(RecordSet.getString("id")) ;
String jobtitlers = Util.null2String(RecordSet.getString("jobtitle")) ;
isLight = !isLight ;
%>
<tr class='<%=( isLight ? "datalight" : "datadark" )%>'>
<td><nobr><%=Util.toScreen(ResourceComInfo.getResourcename(""+resourceidrs),user.getLanguage())%></td>
<td><nobr><%=Util.toScreen(JobTitlesComInfo.getJobTitlesname(jobtitlers),user.getLanguage())%></td>
<%
//xiaofeng
ExcelRow ers=et.newExcelRow();
ers.addStringValue(Util.toScreen(ResourceComInfo.getResourcename(""+resourceidrs),user.getLanguage()));
ers.addStringValue(Util.toScreen(JobTitlesComInfo.getJobTitlesname(jobtitlers),user.getLanguage()));
SalaryComInfo.setTofirstRow() ;
curColIndex = 0;
while(SalaryComInfo.next()) {
String itemid = Util.null2String(SalaryComInfo.getSalaryItemid()) ;
String itemtype = Util.null2String(SalaryComInfo.getSalaryItemtype()) ;
String salary = "" ;
String personsalary = "" ;
String companysalary = "" ;
if( !itemtype.equals("2") ) {
int salaryindex = resourceitems.indexOf( resourceidrs + "_" + itemid ) ;
if( salaryindex != -1) {
salary = (String) salarys.get(salaryindex) ;
if( Util.getDoubleValue(salary,0) ==0 ) salary = "" ;
}
if(isBegin){
colSumList.add(new Double(salary+"0"));
}else{
//colSumList.set(curColIndex,new Double(((Double)(colSumList.get(curColIndex))).doubleValue() + Double.parseDouble(salary+"0")));
colSumList.set(curColIndex,new Double(MathUtil.add(((Double)(colSumList.get(curColIndex))).doubleValue() ,Double.parseDouble(salary+"0"))));
curColIndex ++;
}
%>
<td><nobr>
<% if(itemtype.equals("5") || itemtype.equals("6") ) { %>
<a href='HrmSalaryDiffPay.jsp?payid=<%=payid%>&resourceid=<%=resourceidrs%>&itemid=<%=itemid%>¤tdate=<%=currentdate%>'>
<% } %>
<%=salary%>
<%
//xiaofeng
ers.addValue(salary);
if(itemtype.equals("5") || itemtype.equals("6") ) { %>
</a>
<%
} %>
</td>
<% } else {
int salaryindex = resourceitems.indexOf( resourceidrs + "_" + itemid+"_1" ) ;
if( salaryindex != -1) {
personsalary = (String) salarys.get(salaryindex) ;
if( Util.getDoubleValue(personsalary,0) == 0 ) personsalary = "" ;
}
salaryindex = resourceitems.indexOf( resourceidrs + "_" + itemid+"_2" ) ;
if( salaryindex != -1) {
companysalary = (String) salarys.get(salaryindex) ;
if( Util.getDoubleValue(companysalary,0) == 0 ) companysalary = "" ;
}
if(isBegin){
colSumList.add(new Double(personsalary+"0"));
colSumList.add(new Double(companysalary+"0"));
}else{
//colSumList.set(curColIndex, new Double(((Double)(colSumList.get(curColIndex))).doubleValue() + Double.parseDouble(personsalary+"0")));
colSumList.set(curColIndex,new Double(MathUtil.add(((Double)(colSumList.get(curColIndex))).doubleValue() ,Double.parseDouble(personsalary+"0"))));
curColIndex ++;
//colSumList.set(curColIndex, new Double(((Double)(colSumList.get(curColIndex))).doubleValue() + Double.parseDouble(companysalary+"0")));
colSumList.set(curColIndex,new Double(MathUtil.add(((Double)(colSumList.get(curColIndex))).doubleValue() ,Double.parseDouble(companysalary+"0"))));
curColIndex ++;
}
%>
<td><nobr><%=personsalary%></td>
<td><nobr><%=companysalary%></td>
<%
ers.addValue(personsalary);
ers.addValue(companysalary);
}
}
%>
<!--added by xiaofeng -->
<td><nobr></td>
</tr>
<%
if(isBegin){
isBegin = false;
}
}
}
}
%>
<tr class=Header>
<TH width="10%" style="TEXT-ALIGN:center;TEXT-VALIGN:middle"><nobr><%=SystemEnv.getHtmlLabelName(358,user.getLanguage())%></TH>
<TH width="10%" style="TEXT-ALIGN:center;TEXT-VALIGN:middle"><nobr></TH>
<%
//xiaofeng
ExcelRow er_last=et.newExcelRow();
er_last.addStringValue(SystemEnv.getHtmlLabelName(358,user.getLanguage()),"Header");
er_last.addStringValue("","Header");
curColIndex = 0;
String viewName = "";
while(SalaryComInfo.next()) {
String itemtype = Util.null2String(SalaryComInfo.getSalaryItemtype()) ;
if(colSumList != null && colSumList.size()>0){
temD1 = ((Double)colSumList.get(curColIndex++)).doubleValue();
}else{
temD1 = 0;
}
if(temD1 != 0){
viewName = String.valueOf(temD1);
}else{
viewName = "";
}
if(!viewName.equals(""))
viewName=String.valueOf(MathUtil.round(Double.parseDouble(viewName),2));
if( !itemtype.equals("2") ) {
%>
<TH width="10%" ><nobr><%=viewName%></TH>
<%
er_last.addValue(viewName,"Total");
} else { %>
<TH width="5%" ><nobr><%=viewName%></TH>
<% er_last.addValue(viewName,"Total");
if(colSumList != null && colSumList.size()>0){
temD1 = ((Double)colSumList.get(curColIndex++)).doubleValue();
}else{
temD1 = 0;
}
if(temD1 != 0){
viewName = String.valueOf(temD1);
}else{
viewName = "";
}
%>
<TH width="5%" ><nobr><%=viewName%></TH>
<%
er_last.addValue(viewName,"Total");
}
}
%>
</tr>
</TBODY>
</TABLE>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
<script language=javascript>
function onCreate(){
frmmain.action="HrmSalaryCreate.jsp";
frmmain.method.value="createpay";
frmmain.submit();
}
function onReCreate(){
if( confirm("<%=SystemEnv.getHtmlLabelName(15851,user.getLanguage())%>") ) {
frmmain.action="HrmSalaryCreate.jsp";
frmmain.method.value="createpay";
frmmain.submit();
}
}
function onChange(){
frmmain.action="HrmSalaryPayEdit.jsp";
frmmain.submit();
}
function onSend(){
if( confirm("<%=SystemEnv.getHtmlLabelName(15852,user.getLanguage())%>") ) {
frmmain.action="HrmSalaryOperation.jsp";
frmmain.method.value="send";
frmmain.submit();
}
}
function submitData() {
frmmain.submit();
}
function onPrintCurrent() {
window.open("HrmSalaryPrint.jsp?printtype=1&printscrope=1&printdet=1","","width=300,height=250,scrollbars=no,resizable=yes") ;
}
function onPrintAll() {
window.open("HrmSalaryPrint.jsp?printtype=1&printscrope=2&printdet=1","","width=300,height=250,scrollbars=no,resizable=yes") ;
}
function onPrintCurrent2() {
window.open("HrmSalaryPrint.jsp?printtype=1&printscrope=1&printdet=2","","width=300,height=250,scrollbars=no,resizable=yes") ;
}
function onPrintAll2() {
window.open("HrmSalaryPrint.jsp?printtype=1&printscrope=2&printdet=2","","width=300,height=250,scrollbars=no,resizable=yes") ;
}
</script>
<script language=vbs>
sub onShowResource(spanname, inputname)
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp")
if (Not IsEmpty(id)) then
if id(0)<> "" then
spanname.innerHtml = id(1)
inputname.value=id(0)
else
spanname.innerHtml = ""
inputname.value=""
end if
end if
end sub
sub onShowDepartment(spanname, inputname)
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/company/DepartmentBrowser.jsp?selectedids="&inputname.value)
if (Not IsEmpty(id)) then
if id(0)<> 0 then
spanname.innerHtml = id(1)
inputname.value=id(0)
else
spanname.innerHtml = ""
inputname.value=""
end if
end if
end sub
sub onShowJobActivity(spanname,inputname)
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/jobactivities/JobActivitiesBrowser.jsp")
if Not isempty(id) then
if id(0)<> 0 then
spanname.innerHtml = id(1)
inputname.value=id(0)
else
spanname.innerHtml = ""
inputname.value=""
end if
end if
end sub
sub onShowJobtitle(spanname,inputname)
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/jobtitles/JobTitlesBrowser.jsp")
if (Not IsEmpty(id)) then
if id(0)<> 0 then
spanname.innerHtml = id(1)
inputname.value=id(0)
else
spanname.innerHtml = ""
inputname.value=""
end if
end if
end sub
</script>
</BODY>
<SCRIPT language="javascript" defer="defer" src="/js/datetime_wev8.js"></script>
<SCRIPT language="javascript" defer="defer" src="/js/JSDateTime/WdatePicker_wev8.js"></script>
</HTML>