CarDriverSalaryTotalRp.jsp
12.5 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.Timestamp" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="AllManagers" class="weaver.hrm.resource.AllManagers" scope="page"/>
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<HTML><HEAD>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
</head>
<%
if(!HrmUserVarify.checkUserRight("Car:Maintenance",user)) {
response.sendRedirect("/notice/noright.jsp") ;
return ;
}
%>
<%
String imagefilename = "/images/hdHRM_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(17631,user.getLanguage())+":"+SystemEnv.getHtmlLabelName(17676,user.getLanguage());
String needfav ="1";
String needhelp ="";
String sql="" ;
String show=Util.fromScreen(request.getParameter("show"),user.getLanguage());
String driverid = Util.fromScreen(request.getParameter("driverid"),user.getLanguage());
String startdate1 = Util.fromScreen(request.getParameter("startdate1"),user.getLanguage());
String startdate2 = Util.fromScreen(request.getParameter("startdate2"),user.getLanguage());
//String starttime1 = Util.fromScreen(request.getParameter("starttime1"),user.getLanguage());
//String starttime2 = Util.fromScreen(request.getParameter("starttime2"),user.getLanguage());
if(show.equals("default")){
Calendar today = Calendar.getInstance();
String currentdate = Util.add0(today.get(Calendar.YEAR), 4) +"-"+
Util.add0(today.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
int thisyear=today.get(Calendar.YEAR);
int thismonth=today.get(Calendar.MONTH);
int thisday=today.get(Calendar.DAY_OF_MONTH)+1;
int fromday=1;
int endday=0;
today.set(thisyear,thismonth,fromday);
startdate1= Util.add0(today.get(Calendar.YEAR), 4) +"-"+
Util.add0(today.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
today.set(thisyear,thismonth+1,endday);
startdate2=Util.add0(today.get(Calendar.YEAR), 4) +"-"+
Util.add0(today.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
}
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(354,user.getLanguage())+",javascript:onSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_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">
<form name=frmmain action="CarDriverSalaryTotalRp.jsp">
<table class=viewform>
<COLGROUP>
<COL width="10%"><COL width="40%"><COL width="10%"><COL width="40%">
<tr>
<td><%=SystemEnv.getHtmlLabelName(17649,user.getLanguage())%></td>
<TD class=Field>
<select name="driverid" size=1 style="width:80%" onchange="frmmain.submit()">
<option value=""><%=SystemEnv.getHtmlLabelName(17650,user.getLanguage())%></option>
<%
sql="select distinct driverid from cardriverdata";
RecordSet.executeSql(sql);
while(RecordSet.next()){
String tmpdriverid=RecordSet.getString("driverid");
String tmpdrivername=ResourceComInfo.getResourcename(tmpdriverid+"");
String selected ="" ;
if(tmpdriverid.equals(driverid)) selected="selected " ;
%> <option value="<%=tmpdriverid%>" <%=selected%>><%=tmpdrivername%></option>
<%
}
%>
</select>
</TD>
<td><%=SystemEnv.getHtmlLabelName(17656,user.getLanguage())%>
<TD class=Field><BUTTON type='button' class=Calendar onclick="getStartdate1()"></BUTTON>
<input type=hidden name="startdate1" value="<%=startdate1%>">
<SPAN id=startdate1span><%=startdate1%></SPAN> -
<BUTTON type='button' class=Calendar onclick="getStartdate2()"></BUTTON>
<input type=hidden name="startdate2" value="<%=startdate2%>">
<SPAN id=startdate2span><%=startdate2%></SPAN>
</tr>
</table>
</form>
<br>
<TABLE class=ListStyle cellspacing=1>
<COLGROUP>
<COL width="10%"><COL width="10%"><COL width="10%"><COL width="10%"><COL width="10%">
<COL width="10%"><COL width="10%"><COL width="10%"><COL width="20%">
<TBODY>
<TR class=Header><th colspan=9><%=SystemEnv.getHtmlLabelName(361,user.getLanguage())%></th></tr>
<TR class=separator>
<TD class=Sep1 colSpan=9></TD></TR>
<TR class=Header>
<TD><%=SystemEnv.getHtmlLabelName(17649,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17659,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17685,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17662,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17686,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17682,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17683,user.getLanguage())%></TD>
<TD><%=SystemEnv.getHtmlLabelName(17684,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(17687,user.getLanguage())%></TD>
</tr>
<%
//司机基本基数信息
sql = "select * from cardriverbasicinfo";
RecordSet.executeSql(sql);
RecordSet.next();
String basicsalary = RecordSet.getString("basicsalary");
float receptionpara = RecordSet.getFloat("receptionpara");
float basickm = RecordSet.getFloat("basicKM");
float basickmpara = RecordSet.getFloat("basicKMpara");
float basictime = RecordSet.getFloat("basictime");
float basictimepara = RecordSet.getFloat("basictimepara");
int basicout = RecordSet.getInt("basicout");
float basicoutpara = RecordSet.getFloat("basicoutpara");
boolean islight=true;
sql="select * from cardriverdata ";
String sqlwhere = "" ;
if(!driverid.equals("")){
if(sqlwhere.equals(""))
sqlwhere+=" where driverid =" + driverid ;
else
sqlwhere+=" and driverid =" + driverid ;
}
if(!startdate1.equals("")){
if(sqlwhere.equals(""))
sqlwhere+=" where startdate >='" + startdate1 + "'" ;
else
sqlwhere+=" and startdate >='" + startdate1 + "'" ;
}
if(!startdate2.equals("")){
if(sqlwhere.equals(""))
sqlwhere+=" where startdate <='" + startdate2 + "'" ;
else
sqlwhere+=" and startdate <='" + startdate2 + "'" ;
}
sql=sql + sqlwhere + " order by driverid,startdate desc,starttime desc" ;
String tmpsql="";
String tmpdriverid="";
float totalrunkm = 0;
float totalruntime =0;
float totalkm = 0;
float totaltime = 0 ;
int totalcarout = 0 ;
int totalreception = 0 ;
float floatsalary = 0 ;
float totalsalary = 0 ;
float countrunkm = 0;
float countruntime =0;
float counttotalkm = 0 ;
float counttotaltime = 0 ;
int countcarout = 0 ;
int countreception = 0 ;
float countfloatsalary = 0 ;
float counttotalsalary = 0 ;
RecordSet.executeSql(sql);
while(RecordSet.next()){
boolean showtotal=false ;
String driverid1=RecordSet.getString("driverid");
int isreception=RecordSet.getInt("isreception");
int iscarout=RecordSet.getInt("iscarout");
String startdate = RecordSet.getString("startdate");
String starttime = RecordSet.getString("starttime");
String backtime = RecordSet.getString("backtime");
String remark = RecordSet.getString("remark");
float runkm=RecordSet.getFloat("runKM");
float runtime = RecordSet.getFloat("runtime");
float normalkm = RecordSet.getFloat("normalkm");
float overtimekm = RecordSet.getFloat("overtimekm");
float normaltime = RecordSet.getFloat("normaltime");
float overtime = RecordSet.getFloat("overtime");
float realkm = RecordSet.getFloat("realkm");
float realtime = RecordSet.getFloat("realtime");
String drivername=ResourceComInfo.getResourcename(driverid1+"");
if(!tmpdriverid.equals(driverid1)){
tmpdriverid=driverid1 ;
totalrunkm = runkm ;
totalruntime = runtime ;
totalkm = realkm ;
totaltime = realtime ;
totalcarout = iscarout ;
totalreception = isreception ;
} else {
totalrunkm += runkm ;
totalruntime += runtime ;
totalkm += realkm ;
totaltime += realtime ;
totalcarout += iscarout ;
totalreception += isreception ;
}
if(RecordSet.next()){
if(!tmpdriverid.equals(RecordSet.getString("driverid")))
showtotal=true ;
RecordSet.previous() ;
}
else showtotal=true ;
if(showtotal){
float extkm = totalkm - basickm ;
//if(extkm<0) extkm = 0 ;
float exttime = totaltime - basictime ;
//if(exttime<0) exttime = 0 ;
int extout = totalcarout - basicout ;
//if(extout<0) extout = 0 ;
floatsalary = extkm * basickmpara + exttime * basictimepara + extout*basicoutpara + totalreception*receptionpara ;
/*
float extkm1 = basickm - totalkm ;
if(extkm1<0) extkm1 = 0 ;
float exttime1 = basictime - totaltime ;
if(exttime1<0) exttime1 = 0 ;
int extout1 = basicout - totalcarout ;
if(extout1<0) extout1 = 0 ;
float basicsalary1 = Util.getFloatValue(basicsalary) - (extkm1 * basickmpara + exttime1 * basictimepara + extout1*basicoutpara);
basicsalary1 = (float) (int)(basicsalary1*100)/100 ;
totalsalary = basicsalary1 + floatsalary ;
*/
totalsalary = Util.getFloatValue(basicsalary) + floatsalary ;
countfloatsalary+=floatsalary ;
counttotalsalary+=totalsalary ;
countrunkm += totalrunkm;
countruntime +=totalruntime;
counttotalkm +=totalkm ;
counttotaltime += totaltime ;
countcarout += totalcarout ;
countreception += totalreception ;
floatsalary = (float) ((int)(floatsalary*100))/100 ;
}
%>
<%if(showtotal){%>
<TR <%if(islight){%> class=datalight <%} else {%> class=datadark <%}%>>
<td><%=drivername%></td>
<td><%=Util.getPointValue(String.valueOf(totalrunkm),2,"0.00")%></td>
<td><%=Util.getPointValue(String.valueOf(totalkm),2,"0.00")%></td>
<td><%=Util.getPointValue(String.valueOf(totalruntime),2,"0.00")%></td>
<td><%=Util.getPointValue(String.valueOf(totaltime),2,"0.00")%></td>
<td><%=totalcarout%></td>
<td><%=totalreception%></td>
<td><%=Util.getPointValue(String.valueOf(floatsalary),2,"0.00")%></td>
<td><%=Util.getPointValue(String.valueOf(totalsalary),2,"0.00")%></td>
</tr>
<%}%>
<%
islight=!islight ;
}
%>
<TR class=TOTAL style="FONT-WEIGHT: bold; COLOR: red">
<TD><%=SystemEnv.getHtmlLabelName(523,user.getLanguage())%></TD>
<TD align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(countrunkm),2,"0.00"),3)%></TD>
<TD align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(counttotalkm),2,"0.00"),3)%></TD>
<TD align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(countruntime),2,"0.00"),3)%></TD>
<TD align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(counttotaltime),2,"0.00"),3)%></TD>
<TD align=right><%=countcarout%></TD>
<TD align=right><%=countreception%></TD>
<td align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(countfloatsalary),2,"0.00"),3)%></td>
<td align=right><%=Util.getFloatStr(Util.getPointValue(String.valueOf(counttotalsalary),2,"0.00"),3)%></td>
</tr>
</TBODY></TABLE>
</td>
</tr>
</TABLE>
</td>
<td></td>
</tr>
<tr>
<td height="10" colspan="3"></td>
</tr>
</table>
<script language=javascript>
function onSubmit(){
document.frmmain.submit();
}
</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>