Memployeeworkresult_payroll.java 23.9 KB
Newer Older
TongZuu committed
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
package com.csc.library.databean;

import java.text.DecimalFormat;

import com.csc.library.database.DataSet;
import com.csc.library.session.DbInquiry;
import com.csc.library.session.DbRecord;
import com.csc.library.session.InitialInquiry;
import com.csc.library.utilities.CscCalendar;
import com.csc.library.utilities.CscTime;
import com.csc.library.utilities.MyLog;
import com.csc.library.utility.DHMConvert;
import com.csc.library.utility.NUtils;

/**
 *@author _NUISS
 *@since 07/09/2552
 *@see Ѻ§ҹػҡ÷ӧҹ ͧ site PG ҹ ѹ fix code
 *      ͧ meventgrp 
 */
public class Memployeeworkresult_payroll extends Memployee {
	private DecimalFormat dc = new DecimalFormat("0.00");
	private String reportHeader = "";
	// ˹繤
	private int totalWorkWithoutHoliday = 0;// ӹǹѹӧҹἹ˹
											// ¡ѹش
	private int totalHoliday = 0; // ӹǹѹشѡѵġ -ҷԵ
	private int totalWorkPlan = 0;// ӹǹѹӧҹἹ˹
	private int totalDayWork = 0;// ӹǹѹҷӧҹԧ
	private int totalDayLate = 0;// ӹǹѹ
	private int totalDayOT = 0;// ӹǹѹ OT
	private int totalDayLeave = 0;// ӹǹѹ
	private int totalDayAbsent = 0;// ӹǹѹҴҹ

	// ˹ ѹ::ҷ Ѻ calculate value
	private String totalTimeWork = "";// ӹǹѹ-ҷӧҹԧ ѡҷء
	private String totalTimeLate = "";// ӹǹѹ-
	private String totalTimeOT = "";// ӹǹѹ-ҷ OT
	private String totalTimeOT1 = "";// ӹǹѹ-ҷ OT1
	private String totalTimeOT2 = "";// ӹǹѹ-ҷ OT2
	private String totalTimeOT3 = "";// ӹǹѹ-ҷ OT3
	private String totalTimeOT5 = "";// ӹǹѹ-ҷ OT5
	private String totalTimeNotWork = "";// ӹǹѹ-شҹ
	private String totalLeaveAllType = "";// ӹǹѹ- ҷء
	private String totalLeave_Sick = "";// ӹǹѹ- һ
	private String totalLeave_Businese = "";// ӹǹѹ- ҡԨ
	private String totalLeave_GiveBirth = "";// ӹǹѹ- Ҥʹ
	private String totalLeave_Vacation = "";// ӹǹѹ- Ҿѡ͹
	private String totalLeave_Religion = "";// ӹǹѹ- ҾԸշҧʹ
	private String totalAbsent = "";// ӹǹѹ-ҢҴҹ
	private String totalSuspension = "";// ӹǹѹ-Ҿѡҹ
	private String totalLeave_Military = "";// ӹǹѹ- ҷҧ
	private String totalLeave_Training = "";// ӹǹѹ- ҽ֡ͺ

	// ˹ ѹ::ҷ Ѻʴ §ҹ
	private String dspTimeWork = "";// ӹǹѹ-ҷӧҹԧ ѡҷء
	private String dspTimeLate = "";// ӹǹѹ-
	private String dspTimeOT = "";// ӹǹѹ-ҷ OT
	private String dspTimeOT1 = "";// ӹǹѹ-ҷ OT1
	private String dspTimeOT2 = "";// ӹǹѹ-ҷ OT2
	private String dspTimeOT3 = "";// ӹǹѹ-ҷ OT3
	private String dspTimeOT5 = "";// ӹǹѹ-ҷ OT5
	private String dspTimeNotWork = "";// ӹǹѹ-شҹ
	private String dspLeaveAllType = "";// ӹǹѹ- ҷء
	private String dspLeave_Sick = "";// ӹǹѹ- һ
	private String dspLeave_Businese = "";// ӹǹѹ- ҡԨ
	private String dspLeave_GiveBirth = "";// ӹǹѹ- Ҥʹ
	private String dspLeave_Vacation = "";// ӹǹѹ- Ҿѡ͹
	private String dspLeave_Religion = "";// ӹǹѹ- ҾԸշҧʹ
	private String dspAbsent = "";// ӹǹѹ-ҢҴҹ
	private String dspSuspension = "";// ӹǹѹ-Ҿѡҹ
	private String dspLeave_Military = "";// ӹǹѹ- ҷҧ
	private String dspLeave_Training = "";// ӹǹѹ- ҽ֡ͺ

	public int assignField(DataSet rs) {
		int temp = super.assignField(rs);

		String stDayOfMonth = (String) this.param.get("STDOM");
		String stMonth = (String) this.param.get("STMONTH");
		String stYear = (String) this.param.get("STYEAR");
		String endDayOfMonth = (String) this.param.get("ENDDOM");
		String endMonth = (String) this.param.get("ENDMONTH");
		String endYear = (String) this.param.get("ENDYEAR");
		String reportType = (String) this.param.get("REPORTTYPE");

		CscCalendar cscStart = new CscCalendar(stDayOfMonth + "-" + stMonth
				+ "-" + stYear);
		CscCalendar cscEnd = new CscCalendar(endDayOfMonth + "-" + endMonth
				+ "-" + endYear);

		this.initialValue();

		String tableName = "";
		if (reportType.equals("1")) {
			tableName = "tptime_current1";
			// §ҹ
			if (this.reportHeader.equals("")) {
				if (((String) this.userPro.get("lang")).equalsIgnoreCase("ENG")) {
					this.reportHeader = "Work Time Result Date "
							+ cscStart.getDayOfMonth() + " "
							+ cscStart.getEngLongMonth() + " "
							+ cscStart.getEngYYYY() + " - "
							+ cscEnd.getDayOfMonth() + " "
							+ cscEnd.getEngLongMonth() + " "
							+ cscEnd.getEngYYYY();
				} else {
					this.reportHeader = "§ҹػҡ÷ӧҹ(ѹ  ҷ) ѹ "
							+ cscStart.getDayOfMonth()
							+ " "
							+ cscStart.getThaiLongMonth()
							+ " "
							+ cscStart.getThaiYYYY()
							+ " ֧ "
							+ cscEnd.getDayOfMonth()
							+ " "
							+ cscEnd.getThaiLongMonth()
							+ " "
							+ cscEnd.getThaiYYYY();
				}// end if
			}// end if
		} else {
			tableName = "ttime_history1";
			// §ҹ
			if (this.reportHeader.equals("")) {
				if (((String) this.userPro.get("lang")).equalsIgnoreCase("ENG")) {
					this.reportHeader = "Work Time History Result Date "
							+ cscStart.getDayOfMonth() + " "
							+ cscStart.getEngLongMonth() + " "
							+ cscStart.getEngYYYY() + " - "
							+ cscEnd.getDayOfMonth() + " "
							+ cscEnd.getEngLongMonth() + " "
							+ cscEnd.getEngYYYY();
				} else {
					this.reportHeader = "§ҹػѵҡ÷ӧҹ(ѹ  ҷ) ѹ "
							+ cscStart.getDayOfMonth()
							+ " "
							+ cscStart.getThaiLongMonth()
							+ " "
							+ cscStart.getThaiYYYY()
							+ " ֧ "
							+ cscEnd.getDayOfMonth()
							+ " "
							+ cscEnd.getThaiLongMonth()
							+ " "
							+ cscEnd.getThaiYYYY();
				}// end if
			}// end if
		}// end if
		this.sumWokTimeData(cscStart, cscEnd, tableName);
		return temp;
	}// end method assignField

	private void initialValue() {
		// ˹繤
		this.totalWorkPlan = 0;// ӹǹѹӧҹἹ˹
		this.totalWorkWithoutHoliday = 0;// ӹǹѹӧҹἹ˹
											// ¡ѹش
		this.totalDayWork = 0;// ӹǹѹҷӧҹԧ
		this.totalDayLate = 0;// ӹǹѹ
		this.totalDayOT = 0;// ӹǹѹ OT
		this.totalDayLeave = 0;// ӹǹѹ
		this.totalDayAbsent = 0;// ӹǹѹҴҹ
		this.totalHoliday = 0; // ӹǹѹشѡѵġ -ҷԵ

		// ˹ ѹ::ҷ Ѻ calculate value
		this.totalTimeWork = "0.00";// ӹǹѹ-ҷӧҹԧ ѡҴ
		this.totalTimeLate = "0.00";// ӹǹѹ-
		this.totalTimeOT = "0.00";// ӹǹѹ-ҷ OT
		this.totalTimeOT1 = "0.00";// ӹǹѹ-ҷ OT1
		this.totalTimeOT2 = "0.00";// ӹǹѹ-ҷ OT2
		this.totalTimeOT3 = "0.00";// ӹǹѹ-ҷ OT3
		this.totalTimeOT5 = "0.00";// ӹǹѹ-ҷ OT5
		this.totalTimeNotWork = "0.00";// ӹǹѹ-شҹ
		this.totalLeaveAllType = "0.00";// ӹǹѹ- ҷء
		this.totalLeave_Sick = "0.00";// ӹǹѹ- һ
		this.totalLeave_Businese = "0.00";// ӹǹѹ- ҡԨ
		this.totalLeave_GiveBirth = "0.00";// ӹǹѹ- Ҥʹ
		this.totalLeave_Vacation = "0.00";// ӹǹѹ- Ҿѡ͹
		this.totalLeave_Religion = "0.00";// ӹǹѹ- ҾԸշҧʹ
		this.totalAbsent = "0.00";// ӹǹѹ-ҢҴҹ
		this.totalSuspension = "0.00";// ӹǹѹ-Ҿѡҹ
		this.totalLeave_Military = "0.00";// ӹǹѹ- ҷҧ
		this.totalLeave_Training = "0.00";// ӹǹѹ- ҽ֡ͺ

		// ˹ ѹ::ҷ Ѻʴ §ҹ
		this.dspTimeWork = "0:0:00";// ӹǹѹ-ҷӧҹԧ ѡҴ
		this.dspTimeLate = "0:0:00";// ӹǹѹ-
		this.dspTimeOT = "0:0:00";// ӹǹѹ-ҷ OT
		this.dspTimeOT1 = "0:0:00";// ӹǹѹ-ҷ OT
		this.dspTimeOT2 = "0:0:00";// ӹǹѹ-ҷ OT
		this.dspTimeOT3 = "0:0:00";// ӹǹѹ-ҷ OT
		this.dspTimeOT5 = "0:0:00";// ӹǹѹ-ҷ OT
		this.dspTimeNotWork = "0:0:00";// ӹǹѹ-شҹ
		this.dspLeaveAllType = "0.00";// ӹǹѹ- ҷء
		this.dspLeave_Sick = "0:0:00";// ӹǹѹ- һ
		this.dspLeave_Businese = "0:0:00";// ӹǹѹ- ҡԨ
		this.dspLeave_GiveBirth = "0:0:00";// ӹǹѹ- Ҥʹ
		this.dspLeave_Vacation = "0:0:00";// ӹǹѹ- Ҿѡ͹
		this.dspLeave_Religion = "0:0:00";// ӹǹѹ- ҾԸշҧʹ
		this.dspAbsent = "0:0:00";// ӹǹѹ-ҢҴҹ
		this.dspSuspension = "0:0:00";// ӹǹѹ-Ҿѡҹ
		this.dspLeave_Military = "0:0:00";// ӹǹѹ- ҷҧ
		this.dspLeave_Training = "0:0:00";// ӹǹѹ- ҽ֡ͺ

	}// end method initialValue

	private void sumWokTimeData(CscCalendar startDate, CscCalendar endDate,
		String tableName) {
		NUtils nUtils = new NUtils();
		DecimalFormat dc = new DecimalFormat();
		StringBuffer filter = new StringBuffer();
		dc.applyPattern("#0.00");
		try {
			filter.append("employeeid='").append(this.getString("employeeid"))
					.append("'");
			filter.append(" and dateid >='").append(startDate.getYYYYMMDD())
					.append("'");
			filter.append(" and dateid <='").append(endDate.getYYYYMMDD())
					.append("'");

			DbInquiry inqT1 = this.getInq(tableName, startDate);
			inqT1.setFilter(filter.toString());
			inqT1.refresh();

			while (inqT1.next()) {
				DbRecord recT1 = inqT1.getCurrentDbRecord();

				// ӹǹ .ѹ  div[/] Ҩӹǹѹ
				float hourPerDay = recT1.getFloat("hour_s");

				// ================= ˹繤 =================
				// ӹǹѹӧҹἹ˹ ¡ѹش
				if ((recT1.getString("sequence").equals("01") || Integer
						.valueOf(recT1.getString("sequence")) == 1)
						&& (!recT1.getString("eventgrp").equals("H") && !recT1
								.getString("eventgrp").equals("I"))) {
					this.totalWorkWithoutHoliday++;
				}
				// ӹǹѹشѡѵġ   - 
				if ((recT1.getString("sequence").equals("01") || Integer
						.valueOf(recT1.getString("sequence")) == 1)
						&& recT1.getString("eventgrp").equals("I")) {
					this.totalHoliday++;
				}
				// ӹǹѹӧҹἹ˹
				if (recT1.getString("sequence").equals("01")
						|| Integer.valueOf(recT1.getString("sequence")) == 1) {
					this.totalWorkPlan++;
				}
				// ӹǹѹҷӧҹԧ Ѻ row  OT ͡
				// ѹ¡ա row ֧
				if (recT1.getFloat("hour_d") > 0f
						&& recT1.getString("lv_ty").indexOf("T") >= 0) {
					this.totalDayWork++;
				}
				// ӹǹѹ
				if (recT1.getFloat("lt") > 0f) {
					this.totalDayLate++;
				}
				// ӹǹѹ OT
				if (recT1.getString("doctype").equalsIgnoreCase("O")
						|| recT1.getString("doctype").equalsIgnoreCase("B")
						|| recT1.getString("doctype").equalsIgnoreCase("OM")) {
					this.totalDayOT++;
				}
				// ӹǹѹ
				if (recT1.getString("doctype").equalsIgnoreCase("A")) {
					this.totalDayLeave++;
				}
				// ӹǹѹҴҹ
				if (recT1.getString("eventgrp").equalsIgnoreCase("J")) {
					this.totalDayAbsent++;
				}

				// ================= ˹ ѹ::ҷ
				// =================
				// ӹǹѹ-  ء
				if (recT1.getString("doctype").equalsIgnoreCase("A")) {
					CscTime leaveAllType = new CscTime(0f);
					leaveAllType.add(Float.valueOf(this.totalLeaveAllType));
					leaveAllType.add(recT1.getFloat("m_lv"));
					this.totalLeaveAllType = String.valueOf(leaveAllType
							.getFloat());
					this.dspLeaveAllType = this.setData2Display(leaveAllType,
							hourPerDay);
				}
				// ӹǹѹ-ҷӧҹԧ ѡҷء
				if (recT1.getString("eventgrp").equalsIgnoreCase("T")) {
					CscTime timeWork = new CscTime(0f);
					timeWork.add(Float.valueOf(this.totalTimeWork));
					timeWork.add(recT1.getFloat("hour_d"));
					this.totalTimeWork = String.valueOf(timeWork.getFloat());
					String workHHMM = dc.format(recT1.getFloat("hour_d"))
							.replace(".", ":");
					this.dspTimeWork = nUtils.addDayTime(this.dspTimeWork,
							"00:" + workHHMM, hourPerDay, ":", false);
				}
				// ӹǹѹ-
				if (recT1.getFloat("lt") > 0f) {
					CscTime ltTime = new CscTime(0f);
					ltTime.add(Float.valueOf(this.totalTimeLate));
					ltTime.add(recT1.getFloat("lt"));
					this.totalTimeLate = String.valueOf(ltTime.getFloat());
					String lateHHMM = dc.format(recT1.getFloat("lt")).replace(
							".", ":");
					this.dspTimeLate = nUtils.addDayTime(this.dspTimeLate,
							"00:" + lateHHMM, hourPerDay, ":", false);
				}
				// ӹǹѹ-ҷ OT
				if (recT1.getString("doctype").equalsIgnoreCase("O")
						|| recT1.getString("doctype").equalsIgnoreCase("B")
						|| recT1.getString("doctype").equalsIgnoreCase("OM")) {
					CscTime otTime = new CscTime(0f);
					CscTime otTime1 = new CscTime(0f);
					CscTime otTime2 = new CscTime(0f);
					CscTime otTime3 = new CscTime(0f);
					CscTime otTime5 = new CscTime(0f);

					otTime.add(Float.valueOf(this.totalTimeOT));
					otTime.add(recT1.getFloat("ot1"));
					otTime.add(recT1.getFloat("ot5"));
					otTime.add(recT1.getFloat("ot2"));
					otTime.add(recT1.getFloat("ot3"));

					otTime1.add(Float.valueOf(this.totalTimeOT1));
					otTime1.add(recT1.getFloat("ot1"));

					otTime2.add(Float.valueOf(this.totalTimeOT2));
					otTime2.add(recT1.getFloat("ot2"));

					otTime3.add(Float.valueOf(this.totalTimeOT3));
					otTime3.add(recT1.getFloat("ot3"));

					otTime5.add(Float.valueOf(this.totalTimeOT5));
					otTime5.add(recT1.getFloat("ot5"));

					this.totalTimeOT = String.valueOf(otTime.getFloat());
					this.totalTimeOT1 = String.valueOf(otTime1.getFloat());
					this.totalTimeOT2 = String.valueOf(otTime2.getFloat());
					this.totalTimeOT3 = String.valueOf(otTime3.getFloat());
					this.totalTimeOT5 = String.valueOf(otTime5.getFloat());
					this.dspTimeOT = this.setData2Display(otTime, hourPerDay);
				}
				// ӹǹѹ-شҹ
				if (recT1.getString("eventgrp").equalsIgnoreCase("J")
						|| recT1.getString("doctype").equalsIgnoreCase("A")) {
					CscTime stopTime = new CscTime(0f);
					stopTime.add(Float.valueOf(this.totalTimeNotWork));
					stopTime.add(recT1.getFloat("m_lv"));
					this.totalTimeNotWork = String.valueOf(stopTime.getFloat());
					String notWorkHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspTimeNotWork = nUtils.addDayTime(
							this.dspTimeNotWork, "00:" + notWorkHHMM,
							hourPerDay, ":", false);
				}
				// ӹǹѹ- һ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& (recT1.getString("eventgrp").equalsIgnoreCase("B") || recT1
								.getString("eventgrp").equalsIgnoreCase("K"))) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Sick));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Sick = String.valueOf(leaveType.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Sick = nUtils.addDayTime(this.dspLeave_Sick,
							"00:" + leaveHHMM, hourPerDay, ":", false);
				}
				// ӹǹѹ- ҡԨ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& (recT1.getString("eventgrp").equalsIgnoreCase("E") || recT1
								.getString("eventgrp").equalsIgnoreCase("G"))) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Businese));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Businese = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Businese = nUtils.addDayTime(
							this.dspLeave_Businese, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
				// ӹǹѹ- Ҥʹ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& recT1.getString("eventgrp").equalsIgnoreCase("C")) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_GiveBirth));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_GiveBirth = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_GiveBirth = nUtils.addDayTime(
							this.dspLeave_GiveBirth, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
				// ӹǹѹ- Ҿѡ͹
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& (recT1.getString("eventgrp").equalsIgnoreCase("F") || recT1
								.getString("eventgrp").equalsIgnoreCase("P"))) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Vacation));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Vacation = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Vacation = nUtils.addDayTime(
							this.dspLeave_Vacation, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
				// ӹǹѹ- ҾԸշҧʹ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& (recT1.getString("eventgrp").equalsIgnoreCase("1") || recT1
								.getString("eventgrp").equalsIgnoreCase("L"))) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Religion));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Religion = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Religion = nUtils.addDayTime(
							this.dspLeave_Religion, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
				// ӹǹѹ- Ҵҹ
				if (recT1.getString("eventgrp").equalsIgnoreCase("J")) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalAbsent));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalAbsent = String.valueOf(leaveType.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspAbsent = nUtils.addDayTime(this.dspAbsent, "00:"
							+ leaveHHMM, hourPerDay, ":", false);
				}
				// ӹǹѹ- ѡҹ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& recT1.getString("eventgrp").equalsIgnoreCase("X")) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalSuspension));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalSuspension = String.valueOf(leaveType.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspSuspension = nUtils.addDayTime(this.dspSuspension,
							"00:" + leaveHHMM, hourPerDay, ":", false);
				}
				// ӹǹѹ- ҷҧ
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& recT1.getString("eventgrp").equalsIgnoreCase("N")) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Military));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Military = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Military = nUtils.addDayTime(
							this.dspLeave_Military, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
				if (recT1.getString("doctype").equalsIgnoreCase("A")
						&& recT1.getString("eventgrp").equalsIgnoreCase("M")) {
					CscTime leaveType = new CscTime(0f);
					leaveType.add(Float.valueOf(this.totalLeave_Training));
					leaveType.add(recT1.getFloat("m_lv"));
					this.totalLeave_Training = String.valueOf(leaveType
							.getFloat());
					String leaveHHMM = dc.format(recT1.getFloat("m_lv"))
							.replace(".", ":");
					this.dspLeave_Training = nUtils.addDayTime(
							this.dspLeave_Training, "00:" + leaveHHMM,
							hourPerDay, ":", false);
				}
			}// end while
		} catch (Exception e) {
			MyLog
					.error("!! Error at MemployeeWorkResult.sumWokTimeData() employeeid is: "
							+ this.getString("employeeid"));
		}// end try
	}// end method sumWokTimeData

	private String setData2Display(CscTime timeValue, float hourPerDay) {
		DHMConvert dhm = new DHMConvert(timeValue.getDouble(),hourPerDay);
		return dhm.parseDHM();
	}// end method setData2Display

	public String getString(String fieldName) {
		if (fieldName.equalsIgnoreCase("totalWorkWithoutHoliday")) {
			return String.valueOf(this.totalWorkWithoutHoliday);
		} else if (fieldName.equalsIgnoreCase("totalHoliday")) {
			return String.valueOf(this.totalHoliday);
		} else if (fieldName.equalsIgnoreCase("totalWorkPlan")) {
			return String.valueOf(this.totalWorkPlan);
		} else if (fieldName.equalsIgnoreCase("totalDayWork")) {
			return String.valueOf(this.totalDayWork);
		} else if (fieldName.equalsIgnoreCase("totalDayLate")) {
			return String.valueOf(this.totalDayLate);
		} else if (fieldName.equalsIgnoreCase("totalDayOT")) {
			return String.valueOf(this.totalDayOT);
		} else if (fieldName.equalsIgnoreCase("totalDayLeave")) {
			return String.valueOf(this.totalDayLeave);
		} else if (fieldName.equalsIgnoreCase("totalDayAbsent")) {
			return String.valueOf(this.totalDayAbsent);
		} else if (fieldName.equalsIgnoreCase("totalTimeWork")) {
			return String.valueOf(this.dspTimeWork);
		} else if (fieldName.equalsIgnoreCase("totalTimeLate")) {
			return String.valueOf(this.dspTimeLate);
		} else if (fieldName.equalsIgnoreCase("totalTimeOT")) {
			return String.valueOf(this.dspTimeOT);
		} else if (fieldName.equalsIgnoreCase("totalTimeOT1")) {
			return String.valueOf(this.totalTimeOT1);
		} else if (fieldName.equalsIgnoreCase("totalTimeOT2")) {
			return String.valueOf(this.totalTimeOT2);
		} else if (fieldName.equalsIgnoreCase("totalTimeOT3")) {
			return String.valueOf(this.totalTimeOT3);
		} else if (fieldName.equalsIgnoreCase("totalTimeOT5")) {
			return String.valueOf(this.totalTimeOT5);
		} else if (fieldName.equalsIgnoreCase("totalTimeNotWork")) {
			return String.valueOf(this.dspTimeNotWork);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Sick")) {
			return String.valueOf(this.dspLeave_Sick);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Businese")) {
			return String.valueOf(this.dspLeave_Businese);
		} else if (fieldName.equalsIgnoreCase("totalLeave_GiveBirth")) {
			return String.valueOf(this.dspLeave_GiveBirth);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Vacation")) {
			return String.valueOf(this.dspLeave_Vacation);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Religion")) {
			return String.valueOf(this.dspLeave_Religion);
		} else if (fieldName.equalsIgnoreCase("totalAbsent")) {
			return String.valueOf(this.dspAbsent);
		} else if (fieldName.equalsIgnoreCase("totalSuspension")) {
			return String.valueOf(this.dspSuspension);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Military")) {
			return String.valueOf(this.dspLeave_Military);
		} else if (fieldName.equalsIgnoreCase("totalLeave_Training")) {
			return String.valueOf(this.dspLeave_Training);
		} else if (fieldName.equalsIgnoreCase("header")) {
			return String.valueOf(this.reportHeader);
		} else {
			return super.getString(fieldName);
		}// end if
	}// end method getString

	private DbInquiry getInq(String tableName, CscCalendar startDate) {
		DbInquiry inq = null;
		try {
			if (inq == null) {
				inq = new InitialInquiry(this.userPro).getDbInquiry();
				inq.setParam(this.param);
				inq.setSchemaName(this.userPro.getSchemaName());
				inq.initMyTable(tableName, "", "");
				inq.setColumn("*");
			}// end if
		} catch (Exception e) {
			MyLog.error("!! Error at MemployeeWorkResult.getInq()!!");
		}// end try
		return inq;
	}// end method getInq

}// end class TimeWorkResult