<%@page contentType="text/html; charset=UTF-8"%>
<%@page import="com.csc.library.entry.HelpEntry,com.csc.library.system.*,com.csc.library.utilities.*"%>
<%@ page import="com.csc.library.entry.*,com.csc.library.database.*,com.csc.library.session.*"  %>
<jsp:useBean id="PRU031_2" class="com.csc.library.system.Task" scope="page"/>
<%
PRU031_2.setChannel(request ,response);
ProcessEntry screen=(ProcessEntry)PRU031_2.process("ProcessEntry","Process");

CheckNull chk=new CheckNull();
ThaiUtilities thail = new ThaiUtilities();

CscCalendar cc = new CscCalendar();
String getPresentDay = cc.getDDMMYYYY();
String presentMonth = getPresentDay.split("-")[1];
String presentYear = getPresentDay.split("-")[2];

screen.process();
%>
<html ng-app="myHR">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link href="../CSS/TISCO.css" rel="stylesheet" type="text/css">
<link href="../CSS/bootstrap.css" rel="stylesheet"  type="text/css">
<link href="../CSS/bootstrap_csc_backend.css" rel="stylesheet"  type="text/css">
<script type="text/javascript" src="../JS/jquery-2.1.3.min.js"></script>
<script type='text/javascript' src="../JS/bootstrap.js"></script>
<link href="../CSS/Bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<script type='text/javascript' src='../JS/SCREEN.js'></script>
<script language="javascript" src='../JS/DATEINPUT.js'></script>
<script language="javascript" src='../JS/VIEWCALENDAR.js'></script>
<script language="javascript" src='./JS/PROCESS.js'></script>
<script src="../JS/angular-1.3.15/angular.js" type="text/javascript"></script>
<script src="../JS/ANGULAR/SCREEN_ANGULAR.js" type="text/javascript"></script>
<script language="javascript">setLang('<%=screen.getUProfile().get("lang")%>');</script>

<script src="../JS/jquery-1.11.2.js" type="text/javascript"></script>
<script src="../JS/jquery-ui-1.11.4.js" type="text/javascript"></script>
<script type='text/javascript' src='../JS/bootstrap.js'></script>
<!-- Call DWR -->
<script type='text/javascript' src='/hr/dwr/interface/CalculateReconcile.js'></script>
<script type='text/javascript' src='/hr/dwr/engine.js'></script>
<script type='text/javascript' src='/hr/dwr/util.js'></script>

<SCRIPT TYPE='text/JavaScript' SRC='../TA/JS/TA_SCREEN.js'></SCRIPT>

<script language="JavaScript" type="text/JavaScript">

function goHelp(helpName,inputName){
	with(document.cscform){
		var helpReturn;
		__fixCon.value="";
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(inputName=="__sp_period" ){ // go help chick in source period
			if(__salatype.value === ""){
				alert((lang === "tha")?"กรุณาเลือกประเภทงวดเงินเดือน":"Please select salary type first.");
			}else{
				bCon=confirm((lang === "tha")?"ต้องการจะเลือกงวดปัจจุบันหรือไม่":"Do you want to select a current period?");
				var getSalaType = __salatype.value;

				if(bCon==true){
					//__fixCon.value = "end_date in (select tpy1.gendate from tpytran1 as tpy1 LEFT JOIN tpytran0 as tpy0 on tpy1.employeeid = tpy0.employeeid where tpy0.salatype = '"+getSalaType+"') and codeid = '"+getSalaType+"' and posted != '2'";
					__fixCon.value = "salatype = '"+getSalaType+"'";
					__condition$flag.value = "true";
					helpName="TPYTRAN1_DISTINCTGENDATE";
				}else{
					//__fixCon.value = "end_date in (select gendate from mempl_taxm where salatype = '"+getSalaType+"') and codeid = '"+getSalaType+"' and posted = '2'";
					__fixCon.value = "salatype = '"+getSalaType+"'";
					__condition$flag.value = "false";
				}

				//helpReturn="__sp_period:line_no,__getEndDateSP:gendate";
				helpReturn="__getEndDateSP:gendate";
				linkHelp_Return_CallFunction(helpName,helpReturn,"splitDateSP");
			}
		}else if (inputName=="__rp_period") {
			if(__salatype.value === ""){
				alert((lang === "tha")?"กรุณาเลือกประเภทงวดเงินเดือน":"Please select salary type first.");
			}else{
				var getSalaType = __salatype.value;

				//__fixCon.value="end_date in (select gendate from mempl_taxm where salatype = '"+getSalaType+"') and codeid = '"+getSalaType+"' and posted = '2'";
				__fixCon.value = "salatype = '"+getSalaType+"'";

				//helpReturn="__rp_period:line_no,__getEndDateRP:gendate";
				helpReturn="__getEndDateRP:gendate";

				linkHelp_Return_CallFunction(helpName,helpReturn,"splitDateRP"); //Do before post
			}
		}else if (inputName=="__salatype") {
			if(lang === 'tha'){
				__fixCon.value = "";

				helpReturn="__salatype:codeid,__salamain:tdesc";
				linkHelp_Return_CallFunction(helpName,helpReturn,"clearValue");
				__fixCon.value=fixcon;
			} else {
				__fixCon.value = "";

				helpReturn="__salatype:codeid,__salamain:edesc";
				linkHelp_Return_CallFunction(helpName,helpReturn,"clearValue");
			}

		}else if (inputName=="__reconcileid") {
			__fixCon.value="";

			helpReturn="__reconcileid:reconcileid,__tdesc:tdesc,__edesc:edesc,__salatype:salatype,__salamain:msalatype0.edesc|desc,__sp_period:sp_period,__sp_month:sp_month,__sp_year:sp_year,__rp_period:rp_period,__rp_month:rp_month,__rp_year:rp_year,__sp_head_total:sp_head_total,__sp_netpay_total:sp_netpay_total,__rp_head_total:rp_head_total,__rp_netpay_total:rp_netpay_total,__np_head_total:np_head_total,__np_netpay_total:np_netpay_total,__stop_head_total:stop_head_total,__stop_netpay_total:stop_netpay_total,__diff_head_total:diff_head_total,__diff_netpay_total:diff_netpay_total,__getEndDateSP:spdate,__getEndDateRP:rpdate";
			linkHelp_Return_CallFunction(helpName,helpReturn,"getDesc");
		}
	}
}

function getDesc(){
	with(document.cscform){
		var salatype = __salatype.value;
		var enddatesp = __getEndDateSP.value;
		CalculateReconcile.getDesc(salatype,enddatesp,afterGetDesc);
	}
}

function afterGetDesc(data){
	with(document.cscform){
		__condition$flag.value = data;
	}
}

function clearValue(){
	with(document.cscform){
		__sp_period.value = "";
		__sp_month.value = "";
		__sp_year.value = "";
		__rp_period.value = "";
		__rp_month.value = "";
		__rp_year.value = "";
		__sp_head_total.value = '0';
		__sp_netpay_total.value = '0.00';
		__rp_head_total.value = '0';
		__rp_netpay_total.value = '0.00';
		__np_head_total.value = '0';
		__np_netpay_total.value = '0.00';
		__stop_head_total.value = '0';
		__stop_netpay_total.value = '0.00';
		__diff_head_total.value = '0';
		__diff_netpay_total.value = '0.00';
	}
}

function splitDateSP(){
	with(document.cscform){
		var getDateSP = __getEndDateSP.value;
		var splitSP = getDateSP.split("-");
		//var SPYearValue = splitSP[2]+"-"+splitSP[1]+"-"+splitSP[0];
		var SPYearValue = getDateSP;
		var presentMonth = "<%=presentMonth%>";
		var presentYear = "<%=presentYear%>";
		var parsePresentMonth = parseInt(presentMonth);
		var parsePresentYear = parseInt(presentYear);
		var presentDate = new Date('<%=cc.getYYYYMMDD()%>');
		var parseSPMonth = parseInt(splitSP[1]);
		var parseSPYear = parseInt(splitSP[0]);
		var spDate = new Date(SPYearValue);
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(__rp_period.value != "" && __rp_month.value != "" && __rp_year.value != ""){
			//Do something
			var parseRPMonth = parseInt(__rp_month.value);
			var parseRPYear = parseInt(__rp_year.value);
			var rpDate = new Date(__rp_year.value + '-' + __rp_month.value + '-01');
			if(rpDate.getTime() >= spDate.getTime()){
				if(lang === 'tha'){
					alert('ไม่สามารถเลือก งวดการจ่าย ที่มีเดือนน้อยกว่าหรือเท่ากับ งวดตั้งต้น ได้');
				} else {
					alert("Can't select period that less than or equal Reconcile Period's month.");
				}
				__sp_period.value = "";
				__sp_month.value = "";
				__sp_year.value = "";
			}else if(spDate.getTime() <= presentDate.getTime()){
				__sp_month.value = splitSP[1];
				__sp_year.value = splitSP[0];
				__sp_period.value = splitSP[1]+"-"+splitSP[2];
			}else{
				if(lang === 'tha'){
					alert('ไม่สามารถเลือก period ที่มีเดือนมากกว่าเดือนปัจจุบันได้');
				} else {
					alert("Can't select period that more than present day.");
				}
				__sp_period.value = "";
				__sp_month.value = "";
				__sp_year.value = "";
			}
		}else{
			if(__sp_period.value === '01'){
				if(lang === 'tha'){
					alert('ไม่สามารถเลือก period ที่ 1 ได้');
				} else {
					alert("Can't select first period.");
				}
				__sp_period.value = "";
				__sp_month.value = "";
				__sp_year.value = "";
			} else {
				__sp_month.value = splitSP[1];
				__sp_year.value = splitSP[0];
				__sp_period.value = splitSP[1]+"-"+splitSP[2];
			}
		}
		__getEndDateSP.value = SPYearValue;
	}
}

function splitDateRP(){
	with(document.cscform){
		var getDateRP = __getEndDateRP.value;
		var splitRP = getDateRP.split("-");
		//var RPYearValue = splitRP[2]+"-"+splitRP[1]+"-"+splitRP[0];
		var RPYearValue = getDateRP;
		var presentMonth = "<%=presentMonth%>";
		var presentYear = "<%=presentYear%>";
		var parsePresentMonth = parseInt(presentMonth);
		var parsePresentYear = parseInt(presentYear);
		var presentDate = new Date('<%=cc.getYYYYMMDD()%>');
		var parseRPMonth = parseInt(splitRP[1]);
		var parseRPYear = parseInt(splitRP[0]);
		var rpDate = new Date(RPYearValue);
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(__sp_period.value != "" && __sp_month.value != "" && __sp_year.value != ""){
			//Do something
			var parseSPMonth = parseInt(__sp_month.value);
			var parseSPYear = parseInt(__sp_year.value);
			var spDate = new Date(__sp_year.value + '-' + __sp_month.value + '-01');
			if(rpDate.getTime() >= spDate.getTime()){
				if(lang === 'tha'){
					alert('ไม่สามารถเลือก period ที่มีเดือนน้อยกว่าหรือเท่ากับ Source Period ได้');
				} else {
					alert("Can't select period that more than or equal Source Period's month.");
				}
				__rp_period.value = "";
				__rp_month.value = "";
				__rp_year.value = "";
			}else{
				__rp_month.value = splitRP[1];
				__rp_year.value = splitRP[0];
				__rp_period.value = splitRP[1]+"-"+splitRP[2];
			}
		}else{
			if(rpDate.getTime() >= presentDate.getTime()){
				if(lang === 'tha'){
					alert('ไม่สามารถเลือก period ที่มีเดือนมากกว่าหรือเท่ากับเดือนปัจจุบันได้');
				} else {
					alert("Can't select period that more than or equal present day.");
				}
				__rp_period.value = "";
				__rp_month.value = "";
				__rp_year.value = "";

			}else{
				__rp_month.value = splitRP[1];
				__rp_year.value = splitRP[0];
				__rp_period.value = splitRP[1]+"-"+splitRP[2];
			}
		}
		__getEndDateRP.value = RPYearValue;
	}
}

function processCalculate(){
	with(document.cscform){
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(__sp_period.value == '' || __rp_period.value == ''){
			if(lang === 'tha'){
				alert('กรุณาเลือก period ก่อน');
			} else {
				alert("Please Choose 'period' first.");
			}
		}else{
			var getSPDate = __getEndDateSP.value;
			var getRPDate = __getEndDateRP.value;
			var getSalatype = __salatype.value;
			var checkTpytran = __condition$flag.value;

			console.log("getSPDate = " + getSPDate);
			console.log("getRPDate = " + getRPDate);
			console.log("getSalatype = " + getSalatype);
			console.log("checkTpytran = " + checkTpytran);

			waitingDialog.show('Processing');
			CalculateReconcile.calculation(getSPDate,getRPDate,getSalatype,checkTpytran,AfterCalculate);
		}
	}
}

function AfterCalculate(data){
	with(document.cscform){
		waitingDialog.hide();
		var result = data.split(",,");
		//Do something --> Yeah
		//alert("Hello DWR")
		//alert(result);
		__sp_head_total.value = result[0];
		__sp_netpay_total.value = result[1];
		__rp_head_total.value = result[8];
		__rp_netpay_total.value = result[9];
		__np_head_total.value = result[2];
		__np_netpay_total.value = result[3];
		__stop_head_total.value = result[6];
		__stop_netpay_total.value = result[7];
		__diff_head_total.value = result[4];
		__diff_netpay_total.value = result[5];
	}
}

function process() {
	with(document.cscform){
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(__sp_head_total.value == '0' || __sp_netpay_total.value == '0.00' || __rp_head_total.value == '0' || __rp_netpay_total.value == '0.00'){
			if(lang === 'tha'){
				alert('กรุณากด ปุ่ม Process ก่อน Save');
			}else {
				alert("Please click 'Process' first.");
			}
		}else{
			bCon=confirm("Confirm Save?");
			if (bCon==true)	{
				//Set value to do something

				__condition$reconcileid.value = __reconcileid.value;
				__condition$tdesc.value = __tdesc.value;
				__condition$edesc.value = __edesc.value;
				__condition$salatype.value = __salatype.value;
				__condition$sp_period.value = __sp_period.value;
				__condition$sp_month.value = __sp_month.value;
				__condition$sp_year.value = __sp_year.value;
				__condition$rp_period.value = __rp_period.value;
				__condition$rp_month.value = __rp_month.value;
				__condition$rp_year.value = __rp_year.value;
				__condition$sp_head_total.value = __sp_head_total.value;
				__condition$sp_netpay_total.value = __sp_netpay_total.value;
				__condition$rp_head_total.value = __rp_head_total.value;
				__condition$rp_netpay_total.value = __rp_netpay_total.value;
				__condition$np_head_total.value = __np_head_total.value;
				__condition$np_netpay_total.value = __np_netpay_total.value;
				__condition$stop_head_total.value = __stop_head_total.value;
				__condition$stop_netpay_total.value = __stop_netpay_total.value;
				__condition$diff_head_total.value = __diff_head_total.value;
				__condition$diff_netpay_total.value = __diff_netpay_total.value;
				__condition$spdate.value = __getEndDateSP.value;
				__condition$rpdate.value = __getEndDateRP.value;
				//__tname.value = "ระบบเปรียบเทียบข้อมูลเงินเดือน(บันทึก)";
				//__ename.value = "Payroll Reconcile(Save)";
				__cmd.value = "save";
				submit();
			}else {
				//Do Nothing
			}
		}
	}
}

function GoDelete(){
	with(document.cscform){
		var getReconcileID = __reconcileid.value;
		var lang = '<%=screen.getUProfile().get("lang")%>';
		if(getReconcileID != ""){
			__condition$reconcileid.value = __reconcileid.value;
			__tname.value = "ระบบเปรียบเทียบข้อมูลเงินเดือน(ลบข้อมูล)";
			__ename.value = "Payroll Reconcile(Delete)";
			__condition$getdel.value = "yes";
			__cmd.value = "save";
			submit();
		}else{
			if(lang === 'tha'){
				alert('กรุณาเลือกรหัสเปรียบเทียบก่อน');
			} else {
				alert("Please select reconcileID first.");
			}
		}
	}
}

//-->
</script>
</head>
<body  leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" >
<form name="cscform" method="post" action="">


<!----------BEGIN CSC INITIAL ZONE ------------------------>

<%=screen.InitialVariable()%>

<!----------END CSC INITIAL ZONE -------------------------->

	<input type="hidden" name="__screen"  value="PRU031_2">
	<input type="hidden" name="__fixCon"  value="">
	<input type="hidden" name="__cmd"  value="">
	<input type="hidden" name="__help"  value="">
	<input type="hidden" name="__user" value="<%=screen.getUProfile().getUserId()%>">
	<input type="hidden" name="__companyid" value='<%=screen.getUProfile().get("companyid")%>'>
	<input type="hidden" name="__tname" value="ระบบเปรียบเทียบข้อมูลเงินเดือน">
	<input type="hidden" name="__ename" value="Payroll Reconcile">
	<input type="hidden" name="__ptype" value="">
	<input type="hidden" name="__prclass" value="Tpayrollreconcile_save">
	<input type="hidden" name="maxlist" value="500">
	<input type="hidden" name="__calendar" value="">
	<script language="javascript">getInputFormatDate();</script>
	<input type="hidden" name="__language" value ="<%=screen.getUProfile().get("lang")%>">
	<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
  	<script language="javascript">initToolTips();</script>
	<!-- Do Something -->
	<input type="hidden" name="__condition$employeeProcess"
	value='<%=screen.getUProfile().get("employeeid")%>'>
	<input type="hidden" name="__condition$reconcileid" value="">
	<input type="hidden" name="__condition$tdesc" value="">
	<input type="hidden" name="__condition$edesc" value="">
	<input type="hidden" name="__condition$salatype" value="">
	<input type="hidden" name="__condition$sp_period" value="">
	<input type="hidden" name="__condition$sp_month" value="">
	<input type="hidden" name="__condition$sp_year" value="">
	<input type="hidden" name="__condition$rp_period" value="">
	<input type="hidden" name="__condition$rp_month" value="">
	<input type="hidden" name="__condition$rp_year" value="">
	<input type="hidden" name="__condition$sp_head_total" value="">
	<input type="hidden" name="__condition$sp_netpay_total" value="">
	<input type="hidden" name="__condition$rp_head_total" value="">
	<input type="hidden" name="__condition$rp_netpay_total" value="">
	<input type="hidden" name="__condition$np_head_total" value="">
	<input type="hidden" name="__condition$np_netpay_total" value="">
	<input type="hidden" name="__condition$stop_head_total" value="">
	<input type="hidden" name="__condition$stop_netpay_total" value="">
	<input type="hidden" name="__condition$diff_head_total" value="">
	<input type="hidden" name="__condition$diff_netpay_total" value="">
	<input type="hidden" name="__condition$spdate" value="">
	<input type="hidden" name="__condition$rpdate" value="">
	<input type="hidden" name="__condition$cmdValue" value="">
	<input type="hidden" name="__condition$flag" value="false"><!-- ใช้ตรวจสอบช่วงตั้งต้น(Source Period) ว่าในช่วงนั้นเป็นช่วงของเดือนปัจจุบันหรือไม่ ถ้ายังไม่มีการทำเงินเดือนในช่วงเดือนปัจจุบันแล้วจะเอาเดือนก่อนหน้าที่อยู่ในตาราง tpytran1 มาทำการคำนวณ และ บันทึกในตาราง tpayrollreconciliation0 และ tpayrollreconciliation1 -->
	<input type="hidden" name="__condition$getdel" value="no">
	<input type="hidden" name="__condition$getDBType" value="<%=screen.getUProfile().getDbType()%>">
	<input name="__getEndDateSP" type="hidden" value="">
	<input name="__getEndDateRP" type="hidden" value="">
	<script language="JavaScript" src="../JS/HOTKEY.js"></script>
    <script language="javascript">
    </script>
 	<br>
  	<div align="center">
    <table cellpadding="0" cellspacing="0" class="largest">
    <tr>
         <td colspan="2" class="header" >PRU031_2, <span swlang code="SW012067">Payroll Reconciliation</span>&nbsp;</td>
    </tr>
    <tr>
          <td>
          <table class="maxsize" border="0" align="center" cellpadding="0" cellspacing="1">
          <tr>
                  <td colspan="12" class="blankspace">
                  <table width="800" border="0" align="center" cellpadding="0" cellspacing="1" class="inframe">
                  <tr>
                         <td colspan="2" class="blankspace"></td>
                  </tr>
                  <tr>
                         <td class="columnlabel"  style="width:250px"><span swlang code="SW011657">Reconcile ID</span>&nbsp;</td>
						 <td class="columnobject1" ><!-- Reconcile ID -->
							<input type="Text" name="__reconcileid" size="10" maxlength="10" value="" onkeypress="chkSpecialKey(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Reconcile Code" onmousemver="toolTip('Reconcile Code')" onmouseout="toolTip()">&nbsp;
                                                        <a href="javascript:goHelp('TPAYROLLRECONCILIATION0HELP','__reconcileid');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__reconcileid_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__reconcileid_image" width="21" height="21" border="0" align="absmiddle"></a>
						 </td>
                  </tr>
				  <tr>
                         <td class="columnlabel"><span swlang code="SW011658">Reconcile Name(Thai)</span>&nbsp;</td>       <td class="columnobject1"><!-- Reconcile TDESC -->
							<input type="Text" name="__tdesc" size="70" maxlength="100" value="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Reconcile Name(Thai)" onmousemver="toolTip('Reconcile Name(Thai)')" onmouseout="toolTip()">
						 </td>
                  </tr>
				  <tr>
                        <td class="columnlabel" ><span swlang code="SW011659">Reconcile Name(English)</span>&nbsp;</td>
						<td class="columnobject1"><!-- Reconcile EDESC -->
							<input type="Text" name="__edesc" size="70" maxlength="100" value="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Reconcile Name(English)" onmousemver="toolTip('Reconcile Name(English)')" onmouseout="toolTip()">
						</td>
                  </tr>
				  <tr>
                        <td class="columnlabel" ><span swlang code="SW000865">Salary Type</span>&nbsp;</td>
						<td class="columnobject1"><!-- Reconcile Salary Type -->
							<input type="Text" name="__salatype" size="5" maxlength="5" value="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Salary Type" onmousemver="toolTip('Salary Type')" onmouseout="toolTip()">&nbsp;
							<a href="javascript:goHelp('MSALATYPE0HELP','__salatype');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__salatype_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__salatype_image" width="21" height="21" border="0" align="absmiddle"></a>
                                                        <input name="__salamain" type="text" disabled="true" size="20" value="<%//=screen.getDataLabel("MSALATYPE0","TDESC")%>">
						</td>
                  </tr>
                  <tr>
                         <td colspan="2" class="blankspace"></td>
                  </tr>
				  <tr>
						 <table width="800" border="0" align="center" cellpadding="0" cellspacing="1" class="columnobject1">
						 <tr class="title1">
                               <td width="30%" nowrap  align="center"></td>
                               <td width="15%" nowrap  align="center"><b><span swlang code="SW000907">Period</span></b></td>
                               <td width="15%" nowrap  align="center"><b><span swlang code="SW000800">Month</span></b></td>
                               <td width="15%" nowrap  align="center"><b><span swlang code="SW000717">Year</span></b></td>
						 </tr>
						 <tr>
								<td width="30%" nowrap  align="left"><span swlang code="SW012068">Source Period</span></td>
                                <td width="15%" nowrap  align="center">
									<input type="Text" name="__sp_period" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Period of Source Period" onmousemver="toolTip('Period of Source Period')" onmouseout="toolTip()">&nbsp;
									<a href="javascript:goHelp('MEMPL_TAXM_DISTINCTGENDATE','__sp_period');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__sp_period_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__sp_period_image" width="21" height="21" border="0" align="absmiddle"></a>
								</td>
                                <td width="15%" nowrap  align="center">
									<input type="Text" name="__sp_month" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Month of Source Period" onmousemver="toolTip('Month of Source Period')" onmouseout="toolTip()">
								</td>
                                <td width="15%" nowrap  align="center">
									<input type="Text" name="__sp_year" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Year of Source Period" onmousemver="toolTip('Year of Source Period')" onmouseout="toolTip()">
								</td>
						</tr>
						<tr>
								<td width="30%" nowrap  align="left"><span swlang code="SW012069">Reconcile Period</span></td>
                                <td width="15%" nowrap  align="center">
									<input type="Text" name="__rp_period" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Period of Reconcile Period" onmousemver="toolTip('Period of Reconcile Period')" onmouseout="toolTip()">&nbsp;
									<a href="javascript:goHelp('MEMPL_TAXM_DISTINCTGENDATE','__rp_period');" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('__rp_period_image','','../IMAGES/BUTTON/SWAP/SEARCH_SWAP20.gif',1)"><img src="../IMAGES/BUTTON/MAIN/SEARCH20.gif" alt="SEARCH" name="__rp_period_image" width="21" height="21" border="0" align="absmiddle"></a>
								</td>
								<td width="15%" nowrap  align="center">
									<input type="Text" name="__rp_month" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Month of Reconcile Period" onmousemver="toolTip('Month of Reconcile Period')" onmouseout="toolTip()">
								</td>
                                <td width="15%" nowrap  align="center">
									<input type="Text" name="__rp_year" size="5" maxlength="5" value="" readonly="" onkeypress="chkSpecialStr(event);" onkeyup="sysIsEdit();" onblur="trimValue(this);" onfocus="this.select();" alt="Year of Reconcile Period" onmousemver="toolTip('Year of Reconcile Period')" onmouseout="toolTip()">
								</td>
						</tr>
						</table>
						</tr>
                        </table>
                               <br>
                         </td>
                         </tr>
                         <tr>
                                <td colspan="2" class="blankspace">	</td>
                         </tr>
						<tr>
						<td>
							<table width="300" border="0" align="center" cellpadding="0" cellspacing="1" class="columnobject1">
										<tr class="title1">
                                            <td width="30%" nowrap  align="center">
											</td>
                                            <td width="35%" nowrap  align="center"><b><span swlang code="SW012070">Head</span></b></td>
                                            <td width="35%" nowrap  align="center"><b><span swlang code="SW012071">Amount</span></b></td>
										</tr>
										<tr>
											<td width="30%" nowrap  align="left"><span swlang code="SW012068">Source Period</span>
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__sp_head_total" size="20" maxlength="20" value="0" readonly="" class="numeric" onkeypress="chkInteger(event);" onkeyup="sysIsEdit();" onblur="checkNumInt(this,0,900000000);" onfocus="callDelComma(this);" alt="Source Period Head Total" onmousemver="toolTip('Source Period Head Total')" onmouseout="toolTip()">
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__sp_netpay_total" size="20" maxlength="20" value="0.00" readonly="" class="numeric" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,900000000);" onfocus="callDelComma(this);" alt="Source Period Netpay Total" onmousemver="toolTip('Source Period Netpay Total')" onmouseout="toolTip()">
											</td>
										</tr>
										<tr>
											<td width="30%" nowrap  align="left"><span swlang code="SW012072">New Payment</span>
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__np_head_total" size="20" maxlength="20" value="0" readonly="" class="numeric" onkeypress="chkInteger(event);" onkeyup="sysIsEdit();" onblur="checkNumInt(this,0,900000000);" onfocus="callDelComma(this);" alt="New Payment Head Total" onmousemver="toolTip('New Payment Head Total')" onmouseout="toolTip()">
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__np_netpay_total" size="20" maxlength="20" value="0.00" readonly="" class="numeric" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,900000000);" onfocus="callDelComma(this);" alt="New Payment Netpay Total" onmousemver="toolTip('New Payment Netpay Total')" onmouseout="toolTip()">
											</td>
										</tr>
										<tr>
											<td width="30%" nowrap  align="left"><span swlang code="SW012073">Difference</span>
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__diff_head_total" size="20" maxlength="20" value="0" readonly="" class="numeric" onkeypress="chkInteger(event);" onkeyup="sysIsEdit();" onblur="checkNumInt(this,0,900000000);" onfocus="callDelComma(this);" alt="Difference Head Total" onmousemver="toolTip('Difference Head Total')" onmouseout="toolTip()">
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__diff_netpay_total" size="20" maxlength="20" value="0.00" readonly="" class="numeric" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,900000000);" onfocus="callDelComma(this);" alt="Difference Netpay Total" onmousemver="toolTip('Difference Netpay Total')" onmouseout="toolTip()">
											</td>
										</tr>
										<tr>
											<td width="30%" nowrap  align="left"><span swlang code="SW012074">Stop Payment</span>
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__stop_head_total" size="20" maxlength="20" value="0" readonly="" class="numeric" onkeypress="chkInteger(event);" onkeyup="sysIsEdit();" onblur="checkNumInt(this,0,900000000);" onfocus="callDelComma(this);" alt="Stop Payment Head Total" onmousemver="toolTip('Stop Payment Head Total')" onmouseout="toolTip()">
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__stop_netpay_total" size="20" maxlength="20" value="0.00" readonly="" class="numeric" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,900000000);" onfocus="callDelComma(this);" alt="Stop Payment Netpay Total" onmousemver="toolTip('Stop Payment Netpay Total')" onmouseout="toolTip()">
											</td>
										</tr>
										<tr>
											<td width="30%" nowrap  align="left"><span swlang code="SW012075">Reconcile Period</span>
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__rp_head_total" size="20" maxlength="20" value="0" readonly="" class="numeric" onkeypress="chkInteger(event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumInt(this,0,900000000);" onfocus="callDelComma(this);" alt="Reconcile Period Head Total" onmousemver="toolTip('Reconcile Period Head Total')" onmouseout="toolTip()">
											</td>
                                            <td width="35%" nowrap  align="center">
												<input type="text" name="__rp_netpay_total" size="20" maxlength="20" value="0.00" readonly="" class="numeric" onkeypress="checkWordNumber(this.value,event);" onkeyup="sysIsEdit();checkComma(this,2);" onblur="checkNumFloat(this,0,900000000);" onfocus="callDelComma(this);" alt="Reconcile Period Netpay Total" onmousemver="toolTip('Reconcile Period Netpay Total')" onmouseout="toolTip()">
											</td>
										</tr>
										</table>
										</td>
							</tr>
							<tr>
                                <td colspan="2" class="blankspace"></td>
                            </tr>

													<tr>
														<td  class="buttonline" colspan="7"><div align="center">
															<button type="button" class="btn btn-primary width100" swlang code="SW013188" onClick="processCalculate();">CALCULATE</button>&nbsp;
															<button type="button" class="btn btn-primary width100" swlang code="SW000117" onClick="process();">SAVE</button>&nbsp;
															<button type="button" class="btn btn-primary width100" swlang code="SW000123" onClick="GoDelete();">DELETE</button>
														</div>
														</td>
													</tr>
                            <tr>
                                <td colspan="2" class="blankspace"></td>
                            </tr>
                            <tr>
                                <td colspan="2" class="bottom"></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
	</div>
</form>
</body>
<script>
	var waitingDialog = waitingDialog || (function ($) {
		'use strict';

		// Creating modal dialog's DOM
		var $dialog = $(
			'<div class="modal fade" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-hidden="true" style="padding-top:15%; overflow-y:visible;">' +
			'<div class="modal-dialog modal-m">' +
			'<div class="modal-content">' +
				'<div class="modal-header"><h3 style="margin:0;"></h3></div>' +
				'<div class="modal-body">' +
					'<div class="progress progress-striped active" style="margin-bottom:0;"><div class="progress-bar" style="width: 100%"></div></div>' +
				'</div>' +
			'</div></div></div>');

		return {
			show: function (message, options) {
				// Assigning defaults
				if (typeof options === 'undefined') {
					options = {};
				}
				if (typeof message === 'undefined') {
					message = 'Loading';
				}
				var settings = $.extend({
					dialogSize: 'm',
					progressType: '',
					onHide: null // This callback runs after the dialog was hidden
				}, options);

				// Configuring dialog
				$dialog.find('.modal-dialog').attr('class', 'modal-dialog').addClass('modal-' + settings.dialogSize);
				$dialog.find('.progress-bar').attr('class', 'progress-bar');
				if (settings.progressType) {
					$dialog.find('.progress-bar').addClass('progress-bar-' + settings.progressType);
				}
				$dialog.find('h3').text(message);
				// Adding callbacks
				if (typeof settings.onHide === 'function') {
					$dialog.off('hidden.bs.modal').on('hidden.bs.modal', function (e) {
						settings.onHide.call($dialog);
					});
				}
				$dialog.modal();
			},
			hide: function () {
				$dialog.modal('hide');
			}
		};

	})(jQuery);
</script>
</html>