<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/enrgise-html.tld" prefix="enrgise" %>

<html:html>
<html:base />
<head>
  <TITLE><bean:message  key="hrm.title" /></TITLE>
  <jsp:include page="GenIncludes.jsp" flush="true" />
</head>

<BODY  scroll="auto" onkeydown="hotKeys(event);";>
<html:form name="HrmAdvApplnForm" action="HrmEmpAdvApplnBaseAction" type="wenrgise.hrms.webtier.form.HrmAdvApplnForm">
<bean:define id="ParentForm" name="HrmAdvApplnForm" toScope="request" />
<jsp:include page="GenIconMenu.jsp" flush="true" />


<!--Top Most Blue Bar-->
<TABLE cellSpacing=0 bgColor=#bdd0ef>
    <tr>
        <TD  colSpan=12 class=mainHeader height=10><bean:message key="hrm.HrmEmpAdvance.mainHeader" /></TD>
    </TR>
</TABLE>
<!--//  Display Errors -->
<enrgise:errors/>
<logic:messagesPresent message="true">
<Table>
    <html:messages id="message" message="true">
    <TR><TD>
      <bean:write name="message"/>
    </TD></TR>
    </html:messages>      
</Table>
</logic:messagesPresent>
<!--//  Display Errors -->

<TABLE cellSpacing=0 cellPadding=0 border=0 >
    <TR>
        <TD>
        
        <TABLE cellSpacing=0 cellPadding=0 >
        <!-- Header Starts -->
              <TR>
                    <TD class=subHeader colspan=6><bean:message key="hrm.HrmEmpAdvance.subHeader1" /></TD>
              </TR>
              <TR>
                    <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
              </TR>
              <TR height="6">
                    <TD colspan=6></TD>
              </TR>
              <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.employeeNumber" /></td>
                  <td><html:text  property="employeeNumber" titleKey="hrm.HrmEmpAdvance.employeeNumber" size="23" styleClass="locked" readonly="true" onchange="doChangeHeader();doOnChangeLov();" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmAdvApplnForm"  property="butEmployeeNo" onclick="return ShowEmployeeNo()" /></td>
                  <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.employeeName" /></td>
                  <td colspan="3"><html:text  property="firstName" titleKey="hrm.HrmEmpAdvance.employeeName" size="26" styleClass="locked" readonly="true" /><html:text  property="middleName" titleKey="hrm.HrmEmpAdvance.employeeName" size="33" styleClass="locked" readonly="true" /><html:text  property="lastName" titleKey="hrm.HrmEmpAdvance.employeeName" size="26" styleClass="locked" readonly="true" /></td> 
              </tr>
             
              <tr>
                  <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.grade" /></td>
                  <td><html:text  property="grade" titleKey="hrm.HrmEmpAdvance.grade" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();"  /></td>
                  <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.designation" /></td>
                  <td><html:text  property="designation" titleKey="hrm.HrmEmpAdvance.designation" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();"  /></td>
                  <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.location" /></td>
                  <td><html:text  property="location" titleKey="hrm.HrmEmpAdvance.location" size="26" styleClass="locked" readonly="true" onchange="doChangeHeader();"  /></td>
              </tr>
              <tr>
                  <td colspan="5"></td>
              </tr>
              
 
              <TR>
                    <TD class=subHeader colspan=6>Advance Application Query</TD>
              </TR>
              <TR>
                    <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
              </TR>
              <TR height="10">
                    <TD colspan=6></TD>
              </TR>
              <tr>
                <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.fromDate" /></td>
                <td><html:text  property="fromDate" titleKey="hrm.HrmEmpAdvance.fromDate"  size="23" styleClass="optional" name="HrmAdvApplnForm" alt="D" readonly="true" /><enrgise:img src="../includes/images/cal.gif"   width="15" height="19" align="top" styleClass="lov" property="butFromDate" name="HrmAdvApplnForm"  onclick="showCalendar('fromDate',this)"  /></td>             
                <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.toDate" /></td>
                <td><html:text  property="toDate" titleKey="hrm.HrmEmpAdvance.toDate"  size="23" styleClass="optional" name="HrmAdvApplnForm" alt="D" readonly="true" /><enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" styleClass="lov" name="HrmAdvApplnForm" property="butToDate"  onclick="showCalendar('toDate',this)" /></td>             
                <td colspan="2"></td>
              </tr>
              
              <tr height="10">
                 <td colspan="6"></td>
              </tr>
              
              <TR>
                    <TD class=subHeader colspan=6>Advance Details</TD>
              </TR>
              <TR>
                    <TD colspan=6 bgColor=#4682b4><IMG height=1 src="../includes/images/pixel.gif" width=1 border=0></TD>
              </TR>
              <TR height="10">
                    <TD colspan=6></TD>
              </TR>
              <tr>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.advanceCode" /></td>
                              <td><html:text  property="advanceCode" titleKey="hrm.HrmEmpAdvance.advanceCode" maxlength="10" size="23" name="HrmAdvApplnForm" styleClass="required" alt="P" onchange="doChangeHeader();" readonly="true" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmAdvApplnForm" property="butAdvanceCode" onclick=" return ShowAdvanceCode()" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.dateApplied" /></td>
                              <td><html:text  property="dateApplied" titleKey="hrm.HrmEmpAdvance.dateApplied" size="23" name="HrmAdvApplnForm" styleClass="required" alt="D" onchange="doChangeHeader();"  readonly="true" /><enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" name="HrmAdvApplnForm" styleClass="lov" property="butDateApplied" onclick="showCalendar('dateApplied',this)"  /></td>             
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.amountApplied" /></td>
                              <td><enrgise:text  property="amountApplied" titleKey="hrm.HrmEmpAdvance.amountApplied" maxlength="8" size="26" name="HrmAdvApplnForm" styleClass="required" disabledClass="locked" alt="N" onchange="doChangeHeader();" onkeypress="isInteger(event)" /></td>
                         
                          </tr>
                          
                          <tr> 
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.eligibleAmount" /></td>
                              <td><html:text  property="eligibleAmount" titleKey="hrm.HrmEmpAdvance.eligibleAmount" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="N" readonly="true" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.sanctionedAmount" /></td>
                              <td><enrgise:text  property="sanctionedAmount" titleKey="hrm.HrmEmpAdvance.sanctionedAmount" maxlength="10" size="26" name="HrmAdvApplnForm" styleClass="required" disabledClass="locked" alt="N" onchange="doChangeHeader();" onkeypress="isInteger(event)" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.sanctionDate" /></td>
                              <td><html:text  property="sanctionDate" titleKey="hrm.HrmEmpAdvance.sanctionDate" size="23" name="HrmAdvApplnForm" styleClass="required" alt="D" onchange="doChangeHeader();" readonly="true" /><enrgise:img src="../includes/images/cal.gif"  width="15" height="19" align="top" name="HrmAdvApplnForm" styleClass="lov" property="butSanctionDate" onclick="showCalendar('sanctionDate',this)"  /></td>             
                              
                         </tr> 
                         <tr> 
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.payrollMonth" /></td>
                              <td><enrgise:text  property="payrollMonth" titleKey="hrm.HrmEmpAdvance.payrollMonth" size="26" maxlength="6" name="HrmAdvApplnForm" styleClass="required" disabledClass="locked" alt="N" onchange="doChangeHeader();" onkeypress="isNumber(event)" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.noOfInst" /></td>
                              <td><html:text  property="noOfInst" titleKey="hrm.HrmEmpAdvance.noOfInst" maxlength="2" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="N" onchange="doChangeHeader();" readonly="true" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.monthlyInstallment" /></td>
                              <td><html:text  property="monthlyInstallment" titleKey="hrm.HrmEmpAdvance.monthlyInstallment" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="D" onchange="doChangeHeader();" readonly="true" /></td>             
                              
                         </tr> 
                        <tr>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.reason" /></td>
                              <td><enrgise:textarea  property="reason" titleKey="hrm.HrmEmpAdvance.reason" cols="28" rows="2" name="HrmAdvApplnForm"  styleClass="optional" disabledClass="locked" alt="N" onchange="doChangeHeader();" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.approvedBy" /></td>
                              <td><html:text  property="approverName" titleKey="hrm.HrmEmpLoanAppln.approvedBy" size="23" styleClass="required" readonly="true" onchange="doChangeHeader();" /><enrgise:img height="16" align="center" src="../includes/images/lov.jpg" name="HrmAdvApplnForm"  property="butApproverNo" onclick="return ShowApprover()" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpLoanAppln.remarks" /></td>
                              <td><enrgise:textarea  property="remarks" name="HrmAdvApplnForm" titleKey="hrm.HrmEmpLoanAppln.remarks" rows="2" cols="28" styleClass="optional" disabledClass="locked" onchange="doChangeHeader();" /></td>
                        </tr> 
                        <tr> 
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.paidInstallments" /></td>
                              <td><html:text  property="paidInstallments" titleKey="hrm.HrmEmpAdvance.paidInstallments" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="N" readonly="true" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.settledAmount" /></td>
                              <td><html:text  property="settledAmount" titleKey="hrm.HrmEmpAdvance.settledAmount" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="N" readonly="true" /></td>
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.balance" /></td>
                              <td><html:text  property="balance" titleKey="hrm.HrmEmpAdvance.balance" size="26" name="HrmAdvApplnForm" styleClass="locked" alt="N" readonly="true" /></td>
                              
                         </tr> 
                         
                         
                          <tr>
                              <td></td>
                              <td></td>             
                              <td class="labelText"><bean:message key="hrm.HrmEmpAdvance.bulkSettleAmount" /></td>
                              <td><enrgise:text  property="bulkSettleAmount" name="HrmAdvApplnForm" titleKey="hrm.HrmEmpAdvance.bulkSettleAmount"  size="26" styleClass="required" disabledClass="locked" onkeypress="isInteger(event)" onchange="doChangeHeader();" /></td>
                              <td></td>      
                          </tr>
               
                         
                         <TR height="10">
                              <TD colspan=6></TD>
                        </TR>
          </table>


      <!-- Bottom Blue Bar -->
       <TR>
            <td>
              <TABLE  cellspacing="0" cellpadding="0" border=0>
                     <tr>
                        <td width=45% align=center bgColor=#4682b4></td>
                        <td  bgColor=#4682b4></td>
                        <td bgColor=#4682b4><enrgise:button altKey="hrm.HrmEmpAdvance.bulkSettlement"  onclick="doSettle()" property="butBulkSettlement" name="HrmAdvApplnForm" styleClass="bottomBarText">Bulk Settlement</enrgise:button></td>
                        <td bgColor=#4682b4></td>
                        <td align=right bgColor=#4682b4><img src="../includes/images/man.jpg"></td>
                     </TR>
              </table>
            </td>
          </tr>
 
<!-- Container Table Ending Columns Starts-->
  </TD>
    
</TR>
</TBODY>
</TABLE>

<!-- Container Table Ends -->

<html:hidden property="screenName" name="HrmAdvApplnForm" value="HrmEmpAdvance" />
<html:hidden name="HrmAdvApplnForm"  property="forwardedPage" />
<html:hidden property="positionRequested" name="HrmAdvApplnForm" />
<html:hidden property="screenMode" name="HrmAdvApplnForm" />

<input type="hidden" name="multipleFlag" >
<input type="hidden" name="queryParam" >

<html:hidden property="lovKey" name="HrmAdvApplnForm"  />
<html:hidden property="txtSearchFields" name="HrmAdvApplnForm"  />
<html:hidden property="txtDisplayFields" name="HrmAdvApplnForm"  />

<html:hidden property="txtIndex" name="HrmAdvApplnForm"  />
<html:hidden property="employeeId" name="HrmAdvApplnForm"  />
<html:hidden property="approverNoId" name="HrmAdvApplnForm"  />

<html:hidden property="advanceCodeId" name="HrmAdvApplnForm"  />
<html:hidden property="advanceName" name="HrmAdvApplnForm"  />
<html:hidden property="headerDataChanged" name="HrmAdvApplnForm"  />

<html:hidden property="firstLoad" name="HrmAdvApplnForm"  />

<html:hidden property="userPageRequested" name="HrmAdvApplnForm" />
<html:hidden property="userPositionRequested" name="HrmAdvApplnForm" />
<html:hidden property="pageRequested" name="HrmAdvApplnForm" />
<html:hidden property="buttonName" name="HrmAdvApplnForm"  />
<html:hidden property="empId" name="HrmAdvApplnForm"  />
<html:hidden property="mode" name="HrmAdvApplnForm" />
</html:form>
</body>
</html:html>

<script language="javascript">

function doChangeHeader()
{

 if(document.forms[0].screenMode.value=="U" || document.forms[0].screenMode.value=="N")

 document.forms[0].headerDataChanged.value="true";
}

function doQueryMode()
{
 
  return "HrmEmpAdvApplnQueryModeAction.do";
}

function doInsertMode()
{

  return "HrmEmpAdvApplnNewModeAction.do";
}


function doExecute()
{

  return "HrmEmpAdvApplnGetHeaderAction.do";
}

function doSave()
{
   return "HrmEmpAdvApplnSaveAction.do";
}

function doDelete()
{

  return "HrmEmpAdvApplnDeleteAction.do";
  
}

function doRefresh()
{

  return "HrmEmpAdvApplnRefreshAction.do";
  
}

function doPrevHeader()
{
  return "HrmEmpAdvApplnGetNextHeaderAction.do"; 
}

function doNextHeader()
{
  return "HrmEmpAdvApplnGetNextHeaderAction.do"; 
}

function doJumpHeader()
{
  return "HrmEmpAdvApplnFirstGetNextHeaderAction.do"; 
}

function doGetDetail()
{

  return "HrmEmpAdvApplnGetDetailAction.do";
}

function doAddRow()
{

  return "HrmEmpAdvApplnAddRowAction.do"; 
}

function doDelRow()
{
 return "HrmEmpAdvApplnDeleteRowAction.do";  
}

function doGetDetailTableName()
{
  return "HrmEmpAdvAppln";
}

function doPrevDetail()
{

  return "HrmEmpAdvApplnGetDetailPageAction.do";  
}

function doNextDetail()
{

  return "HrmEmpAdvApplnGetDetailPageAction.do";
}
function doExit()
{

  return "HrmEmpAdvApplnExitAction.do";
}

function doJumpDetail()
{
  return  "HrmEmpAdvApplnGetDetailPageAction.do"; 
}
function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmEmpAdvApplnOnLoadAction.do"; 
  }
}
function ShowAdvanceCode()
{
        document.forms[0].lovKey.value = "EmpAdvanceCode" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpAdvance.advanceCodes";
        document.forms[0].txtDisplayFields.value = "advanceCodeId,advanceCode,noOfInst";
        document.forms[0].multipleFlag.value = "false";
        document.forms[0].queryParam.value="employeeId="+document.forms[0].employeeId.value;
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAdvApplnForm');
        return true;
}

function doGetInsertData()
{}

function ShowEmployeeNo()
{
        document.forms[0].queryParam.value ="SelUser="+ document.getElementsByName("empId")[0].value  ;
        document.forms[0].lovKey.value = "AdvAppEmpNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpLoanAppln.employeeNumber,hrm.HrmEmpLoanAppln.employeeName";
        document.forms[0].txtDisplayFields.value = "employeeId,employeeNumber,firstName,middleName,lastName,grade,designation,location";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAdvApplnForm');
        return true;
        
}
function ShowApprover()
{
        document.forms[0].lovKey.value = "AdvAppApproverNo" + document.forms[0].screenName.value + document.forms[0].screenMode.value;
        document.forms[0].txtSearchFields.value = "hrm.HrmEmpLoanAppln.employeeNumber,hrm.HrmEmpLoanAppln.employeeName";
        document.forms[0].txtDisplayFields.value = "approverNoId,approverName";
        document.forms[0].multipleFlag.value = "false";
        showLov('<html:rewrite page="/hrms/jsp/CommonSearchScreen.jsp" />','HrmAdvApplnForm');
        return true;
        
}
function doOnLoad()
{
  if(document.forms[0].firstLoad.value!="false")
  {
    return  "HrmEmpAdvApplnOnLoadAction.do"; 
  }
}
function doOnChangeLov(lovName)
{
   if(lovName=="AdvAppEmpNoHrmEmpAdvanceN")
    {
      doBaseValidate();
    }
}

function doValidate()
{
  return "HrmEmpAdvApplnValidateAction.do";
}

function doSettle()
{
    document.forms[0].buttonName.value="butBulkSettlement";
    document.forms[0].mode.value="B";
    document.forms[0].action=contextRoot + "HrmEmpAdvApplnValidateAction.do";
    document.forms[0].submit();
}

</script>    