Process Folw:
XXHCMEmpReimbursementsCO:
/*===========================================================================+
| |
| |
+===========================================================================+
| HISTORY
| |
+===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.form.OASubmitButtonBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;
/**
* Controller for ...
*/
public class XXHCMEmpReimbursementsCO extends OAControllerImpl {
public static final String RCS_ID = "$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
XXHCMEmpReimbursementAMImpl am = (XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
String status= am.getStatus();
am.invokeMethod("initEnterpriseVO");
if(status.equalsIgnoreCase("N")){
OASubmitButtonBean btn = (OASubmitButtonBean)webBean.findChildRecursive("create");
btn.setDisabled(true);
}
try{
String bg_id=am.findViewObject("XXHCMEnterpriseVO1").first().getAttribute(0).toString();
if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428"))
{
am.invokeMethod("initBtnDiablsVO");
System.out.println("Button Status :"+am.getBtnStatus());
if(am.getBtnStatus().equalsIgnoreCase("Y")){
OASubmitButtonBean btn = (OASubmitButtonBean)webBean.findChildRecursive("create");
btn.setDisabled(true);
}
}
}catch(Exception e)
{
System.out.println("Error ");
}
if(pageContext.getParameter("TRANSACTION_STATUS")!=null){
pageContext.removeParameter("TRANSACTION_STATUS");
throw new OAException("Transaction successful.",OAException.CONFIRMATION);
}
}
/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext,
OAWebBean webBean) {
super.processFormRequest(pageContext, webBean);
if ("VIEW_DETAILS".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {
pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMReimbursementDetailsPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
Vo
if("ACTION_PENDING".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))){
pageContext.putParameter("PAGE_MODE","U");
pageContext.putParameter("PAGE_TITLE","Update");
pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMCreateReimbursementPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO); }
if (pageContext.getParameter("create") != null) {
pageContext.putParameter("PAGE_MODE","C");
pageContext.putParameter("PAGE_TITLE","Create");
pageContext.forwardImmediately("OA.jsp?page=/xxhcm/oracle/apps/per/reimb/webui/XXHCMCreateReimbursementPG",
null,
OAWebBeanConstants.KEEP_MENU_CONTEXT,
null, null, true,
OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
}
}
}
XXEmpDetailsVo:
SELECT PAPF.FULL_NAME EMPLOYEE_NAME
,PAPF.EMPLOYEE_NUMBER
,HAOU.NAME ORGANIZATION_NAME
,HAOU.NAME COMPANY_NAME
,pay_in_utils.get_position_name(PAAF.assignment_id, sysdate) POSITION
,pay_in_utils.get_hire_date(PAAF.assignment_id) HIRE_DATE
,PG.NAME GRADE_NAME
,HRL.LOCATION_CODE LOCATION_NAME
,XXHCM_REIMBURSMENT_PKG.XXMB_CURR_FIN_YEAR_FNC FIN_YEAR
FROM PER_ALL_PEOPLE_F PAPF
,PER_ALL_ASSIGNMENTS_F PAAF
,HR_ALL_ORGANIZATION_UNITS HAOU
,FND_USER FU
,PER_GRADES PG
, HR_LOCATIONS_ALL HRL
WHERE FU.USER_ID=:1 --FND_PROFILE.VALUE('USER_ID')
AND PAPF.PERSON_ID = FU.EMPLOYEE_ID
AND PAAF.PERSON_ID= PAPF.PERSON_ID
AND PAAF.PRIMARY_FLAG='Y'
AND PG.GRADE_ID (+) = PAAF.GRADE_ID
AND PAAF.LOCATION_ID= HRL.LOCATION_ID(+)
AND HAOU.ORGANIZATION_ID=PAAF.ORGANIZATION_ID
AND (TRUNC(SYSDATE) BETWEEN PAPF.EFFECTIVE_START_DATE AND PAPF.EFFECTIVE_END_DATE)
AND (TRUNC(SYSDATE) BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
XXPendingApprReimbVO:
SELECT SUM(A.SUBMITTED_BILLS)
,MAX(A.UPDATED_DATE)
,A.DETAILS
,DECODE(SIGN(SYSDATE-A.CUT),1,'pendingActionDisabled','pendingActionEnabled') Action
,a.assignment_id
FROM
(SELECT SUM(NVL(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5),0)) SUBMITTED_BILLS
,MAX(PEI.LAST_UPDATE_DATE) UPDATED_DATE
,PTP.CUT_OFF_DATE CUT
,'Details' DETAILS
,paaf.assignment_id
FROM PER_PEOPLE_EXTRA_INFO PEI
,FND_USER FU
,PER_ALL_ASSIGNMENTS_F PAAF
,PAY_ALL_PAYROLLS_F PAPRF
,PER_TIME_PERIODS PTP
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
AND FU.USER_ID=:1
AND PEI.PEI_INFORMATION_CATEGORY='IN_REIMBURSEMENT_DETAILS'
AND PEI.PEI_INFORMATION6 ='Pending Approval'
AND PEI.PERSON_ID=PAAF.PERSON_ID
AND PAPRF.PAYROLL_ID = PAAF.PAYROLL_ID
AND PTP.PAYROLL_ID= PAAF.PAYROLL_ID
AND (SYSDATE BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
AND (SYSDATE BETWEEN PAPRF.EFFECTIVE_START_DATE AND PAPRF.EFFECTIVE_END_DATE)
AND (TRUNC(SYSDATE)>= PTP.START_DATE AND TRUNC(SYSDATE)<=PTP.END_DATE)
group by PEI_INFORMATION5, PEI.LAST_UPDATE_DATE , PTP.CUT_OFF_DATE, paaf.assignment_id
) A
GROUP BY a.assignment_id, A.CUT, A.DETAILS
UNION
SELECT SUM(A.SUBMITTED_BILLS)
,MAX(A.UPDATED_DATE)
,A.DETAILS
,DECODE(SIGN(SYSDATE-A.CUT),1,'pendingActionDisabled','pendingActionEnabled') Action
,a.assignment_id
FROM
(SELECT SUM(NVL(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5),0)) SUBMITTED_BILLS
,MAX(PEI.LAST_UPDATE_DATE) UPDATED_DATE
,PTP.CUT_OFF_DATE CUT
,'Details' DETAILS
,paaf.assignment_id
FROM PER_PEOPLE_EXTRA_INFO PEI
,FND_USER FU
,PER_ALL_ASSIGNMENTS_F PAAF
,PAY_ALL_PAYROLLS_F PAPRF
,PER_TIME_PERIODS PTP
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
AND FU.USER_ID= :1
AND PEI.PEI_INFORMATION_CATEGORY='XX_IN_REIMBURSEMENT_DETAILS' -- Information category Name
AND PEI.PEI_INFORMATION6 ='Pending Approval'
AND PEI.PERSON_ID=PAAF.PERSON_ID
AND PAPRF.PAYROLL_ID = PAAF.PAYROLL_ID
AND PTP.PAYROLL_ID= PAAF.PAYROLL_ID
AND (SYSDATE BETWEEN PAAF.EFFECTIVE_START_DATE AND PAAF.EFFECTIVE_END_DATE)
AND (SYSDATE BETWEEN PAPRF.EFFECTIVE_START_DATE AND PAPRF.EFFECTIVE_END_DATE)
AND (TRUNC(SYSDATE)>= PTP.START_DATE AND TRUNC(SYSDATE)<=PTP.END_DATE)
group by PEI_INFORMATION5, PEI.LAST_UPDATE_DATE , PTP.CUT_OFF_DATE, paaf.assignment_id
) A
GROUP BY a.assignment_id, A.CUT, A.DETAILS
XXExcemptedReimbVO:
SELECT NVL(SUM(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION5)),0) SUBMITTED_BILLS
,NVL(SUM(FND_NUMBER.CANONICAL_TO_NUMBER(PEI_INFORMATION10)),0) EXEMPT_BILLS
,'DETAILS' DETAILS
FROM PER_PEOPLE_EXTRA_INFO PEI
,FND_USER FU
WHERE PEI.PERSON_ID = FU.EMPLOYEE_ID
AND FU.USER_ID=:1 --FND_PROFILE.VALUE('USER_ID')
AND PEI.PEI_INFORMATION_CATEGORY=Decode(
XXHCM_ENTERPRISE_PKG.Ret_Enterprise(FND_PROFILE.Value('PER_BUSINESS_GROUP_ID'))
,42,'XX_IN_REIMBURSEMENT_DETAILS',
'IN_REIMBURSEMENT_DETAILS'
)
AND PEI.PEI_INFORMATION6 in ('Approved','Rejected')
XXHCMPendingApprovalsCO:
/*===========================================================================+
| |
| |
+===========================================================================+
| HISTORY
| |
+===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;
/**
* Controller for ...
*/
public class XXHCMPendingApprovalsCO extends OAControllerImpl
{
public static final String RCS_ID="$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processRequest(pageContext, webBean);
XXHCMEmpReimbursementAMImpl am =(XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("initPendingReimbursementsVO");
}
/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{
super.processFormRequest(pageContext, webBean);
}
}
XXHCMExemptedReimbursementsCO:
/*===========================================================================+
| |
| |
+===========================================================================+
| HISTORY
| |
+===========================================================================*/
package xxhcm.oracle.apps.per.reimb.webui;
import oracle.apps.fnd.common.VersionInfo;
import oracle.apps.fnd.framework.webui.OAControllerImpl;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import xxhcm.oracle.apps.per.reimb.server.XXHCMEmpReimbursementAMImpl;
import xxhcm.oracle.apps.per.reimb.server.XXHCMPendingApprReimbVOImpl;
/**
* Controller for ...
*/
public class XXHCMExemptedReimbursementsCO extends OAControllerImpl {
public static final String RCS_ID = "$Header$";
public static final boolean RCS_ID_RECORDED =
VersionInfo.recordClassVersion(RCS_ID, "%packagename%");
/**
* Layout and page setup logic for a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
XXHCMEmpReimbursementAMImpl am =
(XXHCMEmpReimbursementAMImpl)pageContext.getApplicationModule(webBean);
am.invokeMethod("initApprovedReimbursementsVO");
}
/**
* Procedure to handle form submissions for form elements in
* a region.
* @param pageContext the current OA page context
* @param webBean the web bean corresponding to the region
*/
public void processFormRequest(OAPageContext pageContext,
OAWebBean webBean) {
super.processFormRequest(pageContext, webBean);
}
}
XXHCMEmpReiXXursementAMImpl :
package xxhcm.oracle.apps.per.reiXX.server;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.server.OAApplicationModuleImpl;
import oracle.apps.fnd.framework.server.OADBTransaction;
import oracle.jbo.Row;
import oracle.jbo.RowSet;
import oracle.xml.parser.v2.XMLDocument;
import oracle.xml.parser.v2.XMLElement;
import oracle.jbo.domain.NuXXer;
// ---------------------------------------------------------------------
// --- File generated by Oracle ADF Business Components Design Time.
// --- Custom code may be added to this class.
// --- Warning: Do not modify method signatures of generated methods.
// ---------------------------------------------------------------------
public class XXHCMEmpReiXXursementAMImpl extends OAApplicationModuleImpl
{
/**This is the default constructor (do not remove)
*/
public XXHCMEmpReiXXursementAMImpl() {
}
private String isXX = new String("N");
/**Sample main for debugging Business Components code using the tester.
*/
public static void main(String[] args) { /* package name */
/* Configuration Name */launchTester("xxhcm.oracle.apps.per.reiXX.server",
"XXHCMEmpReiXXursementAMLocal");
}
/**Container's getter for XXHCMEmployeeDetailsVO1
*/
public XXHCMEmpDetailsVOImpl getXXHCMEmployeeDetailsVO1() {
return (XXHCMEmpDetailsVOImpl)findViewObject("XXHCMEmployeeDetailsVO1");
}
public void initEmpDetailsVO() {
XXHCMEmpDetailsVOImpl vo = getXXHCMEmployeeDetailsVO1();
vo.clearCache();
// if (!vo.isPreparedForExecution()) {
int userId = getOADBTransaction().getUserId();
vo.initQuery(userId);
// }
}
public ArrayList initEligibilityDetailsVO() {
ArrayList list = new ArrayList();
XXHCMEligibilityVOImpl vo = getXXHCMEligibilityVO1();
//if (!vo.isPreparedForExecution()) {
vo.setFetchSize(vo.FETCH_ALL);
int userId = getOADBTransaction().getUserId();
vo.initQuery(userId);
//}
RowSet rowset = vo.getRowSet();
while (rowset.hasNext()) {
XXHCMEligibilityVORowImpl voRow =
(XXHCMEligibilityVORowImpl)rowset.next();
String eligibilityName = voRow.getEligibilityType();
String accruedAmount = voRow.getAccruedAmount().toString();
list.add(eligibilityName);
list.add(accruedAmount);
}
return list;
}
/**Container's getter for XXHCMPendingApprReiXXVO1
*/
public XXHCMPendingApprReiXXVOImpl getXXHCMPendingApprReiXXVO1() {
return (XXHCMPendingApprReiXXVOImpl)findViewObject("XXHCMPendingApprReiXXVO1");
}
/**Container's getter for XXHCMExcemptedReiXXVO1
*/
public XXHCMExcemptedReiXXVOImpl getXXHCMExcemptedReiXXVO1() {
return (XXHCMExcemptedReiXXVOImpl)findViewObject("XXHCMExcemptedReiXXVO1");
}
public void initPendingReiXXursementsVO() {
XXHCMPendingApprReiXXVOImpl vo = getXXHCMPendingApprReiXXVO1();
int userId = getOADBTransaction().getUserId();
vo.initQuery(userId);
}
public void initApprovedReiXXursementsVO() {
XXHCMExcemptedReiXXVOImpl vo = getXXHCMExcemptedReiXXVO1();
int userId = getOADBTransaction().getUserId();
vo.initQuery(userId);
}
/**Container's getter for XXHCMReiXXursementDetailsVO1
*/
public XXHCMReiXXursementDetailsVOImpl getXXHCMReiXXursementDetailsVO1() {
return (XXHCMReiXXursementDetailsVOImpl)findViewObject("XXHCMReiXXursementDetailsVO1");
}
public void initEmployeeReiXXursementVO(String param) {
XXHCMReiXXursementDetailsVOImpl vo = getXXHCMReiXXursementDetailsVO1();
int userId = getOADBTransaction().getUserId();
vo.initQuery(param, userId);
}
public XMLElement getReportXml(String param) {
String bg_id ="-1";
NuXXer totalAmount=new NuXXer(0);
NuXXer totalPendingAmt =new NuXXer(0);
int userId = getOADBTransaction().getUserId();
XXHCMEmpDetailsVOImpl empDetailsVO = getXXHCMEmployeeDetailsVO1();
empDetailsVO.initQuery(userId);
XXHCMReiXXursementDetailsVOImpl reiXXDetailsVO =
getXXHCMReiXXursementDetailsVO1();
//added By Saha Gopal For execute VO depending on Enterprise
try{
XXHCMEnterpriseVOImpl entVo= getXXHCMEnterpriseVO1();
bg_id=entVo.first().getAttribute(0).toString();
System.out.println("bg_id :"+bg_id);
} catch(Exception e)
{
System.out.println("Error during Medical ReiXXursement Filter");
}
//added By Saha Gopal For XX
if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428")){
reiXXDetailsVO.setWhereClauseParams(null);
reiXXDetailsVO.setWhereClauseParam(0,param);
reiXXDetailsVO.setWhereClauseParam(1,userId);
reiXXDetailsVO.setWhereClause(" REIXXURSEMENT_TYPE <>'Medical ReiXXursement'");
reiXXDetailsVO.executeQuery();
}
else{
reiXXDetailsVO.initQuery(param, userId);
}
XMLDocument doc = new XMLDocument();
XMLElement root = new XMLElement("root");
doc.appendChild(root);
XMLElement empDetails = new XMLElement("empDetails");
root.appendChild(empDetails);
for (int i = 0; i < empDetailsVO.getRowCount(); i++) {
XXHCMEmpDetailsVORowImpl vor =
(XXHCMEmpDetailsVORowImpl)empDetailsVO.getRowAtRangeIndex(i);
String empName = vor.getEmployeeName();
String empNo = vor.getEmployeeNuXXer();
String organization = vor.getOrganizationName();
// String position = vor.getPosition();
//This is a change because we need to show grade name.
String position = vor.getGradeName();
String hireDate = vor.getHireDate().toString();
String locationName = vor.getLocationName().toString();
String finYear = vor.getFinYear().toString();
if (position == null) {
position = " ";
}
XMLElement empNameElement = new XMLElement("empName");
empNameElement.addText(empName);
empDetails.appendChild(empNameElement);
XMLElement empNoElement = new XMLElement("empNo");
empNoElement.addText(empNo);
empDetails.appendChild(empNoElement);
XMLElement orgElement = new XMLElement("orgName");
orgElement.addText(organization);
empDetails.appendChild(orgElement);
XMLElement positionElement = new XMLElement("position");
positionElement.addText(position);
empDetails.appendChild(positionElement);
XMLElement hireDateElement = new XMLElement("hireDate");
hireDateElement.addText(hireDate);
empDetails.appendChild(hireDateElement);
//ADDED BY SAHA GOPAL FOR XX
XMLElement locationElement = new XMLElement("locationName");
locationElement.addText(locationName);
empDetails.appendChild(locationElement);
XMLElement finYearElement = new XMLElement("finYear");
finYearElement.addText(finYear);
empDetails.appendChild(finYearElement);
}
XMLElement reiXXElement = new XMLElement("reiXX");
root.appendChild(reiXXElement);
// reiXXDetailsVO.first();
RowSet rs = reiXXDetailsVO.getRowSet();
// System.out.println(rs.getRowCount());
// rs.first();
//for (int i = 0; i < rs.getRowCount(); i++) {
while (rs.hasNext()) {
XMLElement reiXXDetailElement = new XMLElement("reiXXDetails");
reiXXElement.appendChild(reiXXDetailElement);
XXHCMReiXXursementDetailsVORowImpl vor =
(XXHCMReiXXursementDetailsVORowImpl)rs.next();
String reiXXType = vor.getReiXXursementType();
XMLElement reiXXTypeElement = new XMLElement("reiXXType");
reiXXTypeElement.addText(reiXXType);
reiXXDetailElement.appendChild(reiXXTypeElement);
String benName = vor.getBeneficiaryName();
XMLElement benNameElement = new XMLElement("benName");
benNameElement.addText(benName);
reiXXDetailElement.appendChild(benNameElement);
String billNuXXer = vor.getBillNuXXer();
XMLElement billNuXXerElement = new XMLElement("billNuXXer");
billNuXXerElement.addText(billNuXXer);
reiXXDetailElement.appendChild(billNuXXerElement);
String billDate = vor.getBillDate();
XMLElement billDateElement = new XMLElement("billDate");
billDateElement.addText(billDate);
reiXXDetailElement.appendChild(billDateElement);
String billAmount = vor.getSubmittedBillValue();
XMLElement billAmountElement = new XMLElement("billAmount");
billAmountElement.addText(billAmount);
reiXXDetailElement.appendChild(billAmountElement);
String empComments = vor.getEmployeeComments();
if (empComments == null) {
empComments = "";
}
XMLElement empCommentsElement = new XMLElement("empComments");
empCommentsElement.addText(empComments);
reiXXDetailElement.appendChild(empCommentsElement);
}
/*
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
doc.print(outputStream);
System.out.println(outputStream.toString());
} catch (Exception e) {
throw new OAException(e.getMessage());
}*/
//-- added By saha Gopal For XX Medical ReiXXursement Details
//added By Saha Gopal For XX
if (bg_id.equalsIgnoreCase("2008") || bg_id.equalsIgnoreCase("1428")){
XXHCMMedBenDetailsVOImpl medVO = getXXHCMMedBenDetailsVO1();
medVO.initMedQuery(param, userId);
XXHCMPrintDetVOImpl printVO = getXXHCMPrintDetVO1();
printVO.initPrintQuery(userId,getPersonId());
XMLElement medElement = new XMLElement("medDetail");
root.appendChild(medElement);
RowSet rs1 = medVO.getRowSet();
XMLElement printElement = new XMLElement("printDetails");
root.appendChild(printElement);
RowSet rs2 = printVO.getRowSet();
while (rs1.hasNext()) {
System.out.println("~~~~~~~~~~~~~~~~~~~~~~inside record set1 ");
XMLElement medDetailsElement = new XMLElement("medDetails");
medElement.appendChild(medDetailsElement);
XXHCMMedBenDetailsVORowImpl medVor = (XXHCMMedBenDetailsVORowImpl)rs1.next();
String slNo = medVor.getSlNo().toString();
XMLElement slTypeElement = new XMLElement("slNo");
slTypeElement.addText(slNo);
medDetailsElement.appendChild(slTypeElement);
String billNuXXer = medVor.getBillNuXXer().toString();
XMLElement billtypeElement = new XMLElement("billNuXXer");
billtypeElement.addText(billNuXXer);
medDetailsElement.appendChild(billtypeElement);
String billDate = medVor.getBillDate().toString();
XMLElement billDatetypeElement = new XMLElement("billDate");
billDatetypeElement.addText(billDate);
medDetailsElement.appendChild(billDatetypeElement);
String benFinName = medVor.getBeneficiaryName().toString();
XMLElement benNameElement = new XMLElement("benFinName");
benNameElement.addText(benFinName);
medDetailsElement.appendChild(benNameElement);
String relationShip = medVor.getRelationship().toString();
XMLElement relationShipElement = new XMLElement("relationShip");
relationShipElement.addText(relationShip);
medDetailsElement.appendChild(relationShipElement);
String billAmount = medVor.getSubmittedBillValue().toString();
System.out.println("billAmount :"+billAmount);
XMLElement billAmountElement = new XMLElement("billAmount");
billAmountElement.addText(billAmount);
medDetailsElement.appendChild(billAmountElement);
try {
totalAmount = new NuXXer(totalAmount).add(new NuXXer(billAmount));
}catch(Exception e){
System.out.println("Error occured during total amount calculation");
}
}
XMLElement totalAmtElement = new XMLElement("totalAmount");
root.appendChild(totalAmtElement);
totalAmtElement.addText(totalAmount.toString());
while(rs2.hasNext()){
System.out.println("~~~~~~~~~~~~~~~~~~~~~~inside record set2 ");
XMLElement printDetElement = new XMLElement("printDet");
printElement.appendChild(printDetElement);
XXHCMPrintDetVORowImpl printDetVor =(XXHCMPrintDetVORowImpl) rs2.next();
String reimEleName = printDetVor.getReimType().toString();
XMLElement reimTypeELement = new XMLElement("reimEleName");
reimTypeELement.addText(reimEleName);
printDetElement.appendChild(reimTypeELement);
String anlElgAmt =printDetVor.getAnlElig().toString();
XMLElement anlElgAmtElement = new XMLElement("anlElgAmt");
anlElgAmtElement.addText(anlElgAmt);
printDetElement.appendChild(anlElgAmtElement);
String ytdElg = printDetVor.getYtdElig().toString();
XMLElement ytdElgElement = new XMLElement("ytdElg");
ytdElgElement.addText(ytdElg);
printDetElement.appendChild(ytdElgElement);
String ytdClaim = printDetVor.getYtdClaimed().toString();
XMLElement ytdClaimElement = new XMLElement("ytdClaim");
ytdClaimElement.addText(ytdClaim);
printDetElement.appendChild(ytdClaimElement);
String pendingClaims = printDetVor.getClaimUnderProcess().toString();
XMLElement pendingClaimsElement = new XMLElement("pendingClaims");
pendingClaimsElement.addText(pendingClaims);
printDetElement.appendChild(pendingClaimsElement);
try {
totalPendingAmt = new NuXXer(totalPendingAmt).add(new NuXXer(pendingClaims));
}catch(Exception e){
System.out.println("Error occured during total amount calculation");
}
}
XMLElement totalPendingAmtElement = new XMLElement("totalPendingAmt");
root.appendChild(totalPendingAmtElement);
totalPendingAmtElement.addText(totalPendingAmt.toString());
}
return root;
}
/**Container's getter for XXHCMCreateReiXXVO1
*/
public XXHCMCreateReiXXVOImpl getXXHCMCreateReiXXVO1() {
return (XXHCMCreateReiXXVOImpl)findViewObject("XXHCMCreateReiXXVO1");
}
public void createRows(String mode) {
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
vo.clearCache();
int personId = getPersonId();
// if (!vo.isPreparedForExecution()) {
vo.initQuery(mode, personId);
//}
if (mode.equalsIgnoreCase("U")) {
return;
}
for (int i = 0; i < 20; i++) {
XXHCMCreateReiXXVORowImpl row =
(XXHCMCreateReiXXVORowImpl)vo.createRow();
row.setNewRowState(Row.STATUS_INITIALIZED);
vo.insertRow(row);
}
}
/**Container's getter for XXHCMEligibilityVO1
*/
public XXHCMEligibilityVOImpl getXXHCMEligibilityVO1() {
return (XXHCMEligibilityVOImpl)findViewObject("XXHCMEligibilityVO1");
}
public void updateEIT() {
String bgId = new String("");
try
{
getXXHCMEnterpriseVO1().executeQuery();
bgId = getXXHCMEnterpriseVO1().first().getAttribute(0).toString();
System.out.println("bgId: "+bgId);
isXX = "Y";
}
catch(Exception e) {
System.out.println("Exception while getting bgid ");
}
if(isXX .equalsIgnoreCase("Y"))
{
System.out.println("XX .. Validate reiXXursments..");
validateReiXXursment();
}
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
int personId = getPersonId();
ArrayList<String> sqlStatements = new ArrayList<String>();
for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++) {
int vcount = rowIndex+1;
XXHCMCreateReiXXVORowImpl vor =
(XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
String reiXXType = vor.getReiXXursementType();
if (reiXXType != null && reiXXType.length() > 0) {
String beneficiaryName = vor.getBeneficiaryName();
if (beneficiaryName == null)
beneficiaryName = " ";
String billNuXXer = vor.getBillNuXXer();
if (billNuXXer == null)
billNuXXer = " ";
if (vor.getBillDate() == null) {
throw new OAException("Bill Date can not be empty for bill nuXXer:" +
billNuXXer, OAException.ERROR);
}
String billDate = vor.getBillDate().toString();
String billAmount = vor.getBillAmount();
if (billAmount == null) {
throw new OAException("Bill Amount can not be empty for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate, OAException.ERROR);
}
try {
Double billAmountInt = Double.parseDouble(billAmount);
if (billAmountInt <= 0) {
throw new OAException("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate +
" should be more than zero.",
OAException.ERROR);
}
} catch (NuXXerFormatException nex) {
System.out.println("***********inside exception3");
throw new OAException("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be numeric.",
OAException.ERROR);
}
String empRemarks = vor.getEmployeeComments();
if (empRemarks == null)
empRemarks = " ";
empRemarks = empRemarks.replace("'", "''");
int personExtraInfoId =
Integer.parseInt(vor.getPersonExtraInfoId().toString());
int objectVersionNuXXer =
Integer.parseInt(vor.getObjectVersionNuXXer().toString());
String sqlStatement =
"declare povn nuXXer:=" + objectVersionNuXXer + ";" +
"begin " +
" hr_person_extra_info_api.update_person_extra_info(" +
" p_person_extra_info_id =>" +
personExtraInfoId +
" ,p_object_version_nuXXer => povn" +
" ,p_pei_information1 =>'" + reiXXType + "'" +
" ,p_pei_information2 =>'" + beneficiaryName +
"'" + " ,p_pei_information3 =>'" + billNuXXer +
"'" + " ,p_pei_information4 =>'" + billDate +
"'" + " ,p_pei_information5 =>'" + billAmount +
"'" + " ,p_pei_information7 =>'" + empRemarks +
"'" + "); " + "end;";
sqlStatements.add(sqlStatement);
}
}
executeStatement(sqlStatements);
}
public void createEIT() {
System.out.println("Inside createEIT");
String bgId = new String("");
String billDate=new String("");
String p_information_type =new String("IN_REIXXURSEMENT_DETAILS");
String p_pei_information_category=new String("IN_REIXXURSEMENT_DETAILS");
// try
// {
// getXXHCMEnterpriseVO1().executeQuery();
// if(getXXHCMEnterpriseVO1().first()!=null){
// if(getXXHCMEnterpriseVO1().first()!=null)
// bgId = (String)getXXHCMEnterpriseVO1().first().getAttribute("Bgid");}
// System.out.println("bgId: "+bgId);
//
// if(bgId !=null || "".equals(bgId)){
// isXX = "N";
// p_information_type =new String("IN_REIXXURSEMENT_DETAILS");
// p_pei_information_category=new String("IN_REIXXURSEMENT_DETAILS");
// }
// else{
// isXX = "Y";
// p_information_type = "XXTEST_IN_REIXXURSEMENT_DETAILS";
// p_pei_information_category = "XXTEST_IN_REIXXURSEMENT_DETAILS";
// }
// }
// catch(Exception e) {
// System.out.println("Exception while getting bgid ");
// p_information_type = "IN_REIXXURSEMENT_DETAILS";
// p_pei_information_category= "IN_REIXXURSEMENT_DETAILS";
// getOADBTransaction().writeDiagnostics(e.getMessage(),"ARUMOY",1);
// }
//
// if(isXX .equalsIgnoreCase("Y"))
// {
// System.out.println("XX .. Validate reiXXursments..");
// validateReiXXursment();
// }
if((getOADBTransaction().getBusinessGroupId()==2008 )|| (getOADBTransaction().getBusinessGroupId()==1428) )
{ p_information_type = "XXTEST_IN_REIXXURSEMENT_DETAILS";
p_pei_information_category = "XXTEST_IN_REIXXURSEMENT_DETAILS";
validateReiXXursment();}
else
{
p_information_type = "IN_REIXXURSEMENT_DETAILS";
p_pei_information_category= "IN_REIXXURSEMENT_DETAILS";
}
System.out.println(p_information_type);
System.out.println(p_pei_information_category);
getOADBTransaction().writeDiagnostics(p_information_type,"ARUMOY",1);
getOADBTransaction().writeDiagnostics(p_pei_information_category,"ARUMOY",1);
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
int personId = getPersonId();
ArrayList<String> sqlStatements = new ArrayList<String>();
for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++)
{
int vcount = rowIndex+1;
System.out.println("At Row "+rowIndex+1);
XXHCMCreateReiXXVORowImpl vor =
(XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
String reiXXType = vor.getReiXXursementType();
System.out.println("ReiXXursment Type.."+reiXXType);
if (reiXXType != null && reiXXType.length() > 0)
{
String beneficiaryName = vor.getBeneficiaryName();
//if (beneficiaryName == null)
// beneficiaryName = " ";
if (vor.getBeneficiaryName() == null) {
throw new OAException("Benificery name cannot Be empty:" +
OAException.ERROR);
}
String billNuXXer = vor.getBillNuXXer();
if (billNuXXer == null)
billNuXXer = " ";
// if (vor.getBillNuXXer() == null) {
// throw new OAException("Bill NuXXer Can Not Be empty ");
// }
//if (vor.getBillDate() == null) {
// throw new OAException("Bill Date can not be empty :" +
// billNuXXer, OAException.ERROR);
// }
if(vor.getBillDate()==null)
billDate ="";
else
billDate = vor.getBillDate().toString();
System.out.println("Bill Date "+billDate);
String billAmount = vor.getBillAmount();
if (billAmount == null) {
throw new OAException("Bill Amount can not be empty for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate, OAException.ERROR);
}
try {
Double billAmountInt = Double.parseDouble(billAmount);
if (billAmountInt <= 0) {
throw new OAException("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate +
" should be more than zero.",
OAException.ERROR);
}
} catch (NuXXerFormatException nex) {
throw new OAException("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be numeric.",
OAException.ERROR);
}
String empRemarks = vor.getEmployeeComments();
if (empRemarks == null)
empRemarks = " ";
empRemarks = empRemarks.replace("'", "''");
String sqlStatement =
"declare " + " p_eeid nuXXer:=0; " +
" povn nuXXer:=0; " +
" begin " +
" hr_person_extra_info_api.create_person_extra_info(" +
" p_person_id =>" +
personId +
" ,p_information_type =>"+"'"+p_information_type+"'"+
" ,p_pei_information_category =>"+"'"+p_pei_information_category+"'"+
" ,p_pei_information1 =>'" +
reiXXType + "'" +
" ,p_pei_information2 =>'" +
beneficiaryName + "'" +
" ,p_pei_information3 =>'" +
billNuXXer + "'" +
" ,p_pei_information4 =>'" +
billDate + "'" +
" ,p_pei_information5 =>'" +
billAmount + "'" +
" ,p_pei_information6 =>'Pending Approval'" +
" ,p_pei_information7 =>'" +
empRemarks + "'" +
" ,p_pei_information10 =>0" +
" ,p_pei_information11 => FND_DATE.DATE_TO_CANONICAL(FND_DATE.STRING_TO_DATE('31-DEC-4712','DD-MON-YYYY'))"+
" ,p_person_extra_info_id =>p_eeid " +
" ,p_object_version_nuXXer=>povn); " +
" end;";
sqlStatements.add(sqlStatement);
//
}
}
System.out.println("Callin executeStatement ");
executeStatement(sqlStatements);
}
private void executeStatement(ArrayList<String> sqlStatements) {
OADBTransaction tx = getOADBTransaction();
for (String sqlStatement: sqlStatements) {
try {
PreparedStatement ps =
tx.createPreparedStatement(sqlStatement, 0);
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
getOADBTransaction().writeDiagnostics(e.getMessage(),"",1);
throw new OAException("Error", "A SQL Exception has occured",
e);
}
}
tx.commit();
}
private int getPersonId() {
String statement = "SELECT EMPLOYEE_ID FROM FND_USER WHERE USER_ID=:1";
OADBTransaction tx = getOADBTransaction();
int userId = tx.getUserId();
CallableStatement st = tx.createCallableStatement(statement, 1);
int personId = -1;
try {
st.setInt(1, userId);
st.execute();
ResultSet rs = st.getResultSet();
while (rs.next())
personId = rs.getInt("EMPLOYEE_ID");
} catch (SQLException e) {
e.printStackTrace();
throw new OAException("Error", "A SQL Exception has occured", e);
}
return personId;
}
public void addRows() {
addRows(10);
}
private void addRows(int nuXXerOfRows) {
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
Row row = vo.last();
vo.setCurrentRow(row);
for (int i = 0; i < nuXXerOfRows; i++) {
XXHCMCreateReiXXVORowImpl vrow =
(XXHCMCreateReiXXVORowImpl)vo.createRow();
vrow.setNewRowState(Row.STATUS_INITIALIZED);
vo.insertRow(vrow);
}
}
public void initContactPicklist() {
XXHCMContactDetailsVOImpl vo = getXXHCMContactDetailsVO1();
vo.clearCache();
int userId = getOADBTransaction().getUserId();
vo.initQuery(userId);
}
public void deleteEIT(String mode) {
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
int deletedRows = 0;
if (!vo.isDirty()) {
return;
}
Row[] rows = vo.getFilteredRows("Select", "Y");
ArrayList<String> sqlStatements = new ArrayList<String>();
for (int i = 0; i < rows.length; i++) {
XXHCMCreateReiXXVORowImpl vor = (XXHCMCreateReiXXVORowImpl)rows[i];
String select = vor.getSelect();
if (select != null && select.equalsIgnoreCase("Y")) {
if (mode.equalsIgnoreCase("U")) {
//System.out.println("In update Mode");
int ovn =
Integer.parseInt(vor.getObjectVersionNuXXer().toString());
int personExtraInfoId =
Integer.parseInt(vor.getPersonExtraInfoId().toString());
String sqlStatement =
"Begin hr_person_extra_info_api.delete_person_extra_info(" +
"p_person_extra_info_id =>" + personExtraInfoId +
",p_object_version_nuXXer=>" + ovn + "); end;";
//executeStatement(sqlStatement);
sqlStatements.add(sqlStatement);
}
vo.setCurrentRow(vor);
vo.removeCurrentRow();
deletedRows++;
}
}
executeStatement(sqlStatements);
if (mode.equalsIgnoreCase("C")) {
addRows(deletedRows);
}
}
/**Container's getter for XXHCMReiXXStateVO1
*/
public XXHCMReiXXStateVOImpl getXXHCMReiXXStateVO1() {
return (XXHCMReiXXStateVOImpl)findViewObject("XXHCMReiXXStateVO1");
}
public String getStatus() {
XXHCMReiXXStateVOImpl vo = getXXHCMReiXXStateVO1();
int userId = getOADBTransaction().getUserId();
System.out.println("User ID is "+userId);
vo.initQuery(userId);
System.out.println("Total Row in XXHCMReiXXStateVO "+vo.getRowCount());
System.out.println("Total Row_2 in XXHCMReiXXStateVO "+vo.getFetchedRowCount());
XXHCMReiXXStateVORowImpl vor = (XXHCMReiXXStateVORowImpl)vo.first();
// return vor.getState();
return "Y";
}
/**Container's getter for XXHCMContactDetailsVO1
*/
public XXHCMContactDetailsVOImpl getXXHCMContactDetailsVO1() {
return (XXHCMContactDetailsVOImpl)findViewObject("XXHCMContactDetailsVO1");
}
/**Container's getter for XXHCMEnterpriseVO1
*/
public XXHCMEnterpriseVOImpl getXXHCMEnterpriseVO1() {
return (XXHCMEnterpriseVOImpl)findViewObject("XXHCMEnterpriseVO1");
}
public void initEnterpriseVO() {
getXXHCMEnterpriseVO1().executeQuery();
}
/**Container's getter for XXHCMIsBillDateValidVVO1
*/
public XXHCMIsBillDateValidVVOImpl getXXHCMIsBillDateValidVVO1() {
return (XXHCMIsBillDateValidVVOImpl)findViewObject("XXHCMIsBillDateValidVVO1");
}
/**Container's getter for XXHCMCheckReiXXEligibVO1
*/
public XXHCMCheckReiXXEligibVOImpl getXXHCMCheckReiXXEligibVO1() {
return (XXHCMCheckReiXXEligibVOImpl)findViewObject("XXHCMCheckReiXXEligibVO1");
}
public void validateReiXXursment()
{
System.out.println("Inside Validate ReiXXursment..");
com.sun.java.util.collections.ArrayList ExceptionList = new com.sun.java.util.collections.ArrayList();
XXHCMCreateReiXXVOImpl vo = getXXHCMCreateReiXXVO1();
int personId = getPersonId();
int exceptionCount =0;
Double billTotCarFuel = new Double(0.00);
Double billTotCarLease = new Double(0.00);
Double billTotCarMaintanance = new Double(0.00);
Double billTotCommReiXX = new Double(0.00);
Double billTotHigherEcucation = new Double(0.00);
Double billTotLTA = new Double(0.00);
Double billTotDriverSal = new Double(0.00);
Double billTotMedicalReiXX = new Double(0.00);
Double billTotCompLeasedAccom = new Double(0.00);
Double billTotHardFurnishing = new Double(0.00);
Double billTotNotiecepayReiXX = new Double(0.00);
String reiXXType = new String("");
String EligibleAmountCF = new String("");
String EligibleAmountCM = new String("");
String EligibleAmountCR = new String("");
String EligibleAmountHR = new String("");
String EligibleAmountLTA = new String("");
String EligibleAmountDS = new String("");
String EligibleAmountMR = new String("");
String billDate = new String("");
ExceptionList.clear();
for (int rowIndex = 0; rowIndex < vo.getRowCount(); rowIndex++)
{
int vcount = rowIndex+1;
XXHCMCreateReiXXVORowImpl vor = (XXHCMCreateReiXXVORowImpl)vo.getRowAtRangeIndex(rowIndex);
reiXXType = vor.getReiXXursementType();
System.out.println("reiXXType :"+reiXXType);
if(reiXXType!=null && reiXXType.length()>0)
{
// if(vor.getBillDate() == null){
// billDate = "";
// }
// else
// billDate= vor.getBillDate().toString();
// Validating Benificery Name
String empFullName = getXXHCMEmployeeDetailsVO1().first().getAttribute("EmployeeName").toString();
empFullName = empFullName.trim();
String benificieryName = vor.getBeneficiaryName();
System.out.println("benificieryName" +benificieryName);
if(benificieryName != null && benificieryName.length()>1)
{
String benificieryName1 = benificieryName.trim();
System.out.println("benificieryName1" +benificieryName1);
if(!(reiXXType.equalsIgnoreCase("Medical ReiXXursement"))){
if(!(empFullName.equalsIgnoreCase(benificieryName1)))
{
ExceptionList.add(new OAException("Line "+vcount+"Employee can only be Benificiery."));
exceptionCount++;
}
}
}
else{
System.out.println("Raising Exception For Benificiery Name");
ExceptionList.add(new OAException("Line "+vcount+" Benificiery Name is Mandatory."));
exceptionCount++;
}
// Validating Bill NuXXer
System.out.println("~~~~~~~Bill NuXXer~~~~");
String billNuXXer = vor.getBillNuXXer();
System.out.println("billNuXXer :"+billNuXXer);
if(billNuXXer==null || billNuXXer.length()<1)
{
if(reiXXType.equalsIgnoreCase("Car Fuel")
||reiXXType.equalsIgnoreCase("Car Maintenance")
||reiXXType.equalsIgnoreCase("Communication ReiXXursement")
||reiXXType.equalsIgnoreCase("Medical ReiXXursement")
)
{
ExceptionList.add(new OAException("Line "+vcount+" Bill NuXXer is Mandatory."));
exceptionCount++;
}
}
// Validating Bill Date
if(vor.getBillDate() == null){
billDate = null;
}
else
billDate= vor.getBillDate().toString();
if(billDate!=null && billDate.length()>1 ){
System.out.println("~~~~~~~BilDate~~~~ ");
getXXHCMIsBillDateValidVVO1().setWhereClause(null);
getXXHCMIsBillDateValidVVO1().setWhereClauseParams(null);
getXXHCMIsBillDateValidVVO1().setWhereClauseParam(0,billDate);
getXXHCMIsBillDateValidVVO1().executeQuery();
String isBilldateValie = getXXHCMIsBillDateValidVVO1().first().getAttribute(0).toString();
System.out.println("isBilldateValie : "+isBilldateValie);
if(isBilldateValie.equals("N"))
{
ExceptionList.add(new OAException("Line "+vcount+" Bill Date not in Current Financial Year/Can not Be future Date Please Correct."));
exceptionCount++;
}
try{
getXXHCMDateEligiblityVO1().setWhereClauseParams(null);
getXXHCMDateEligiblityVO1().setWhereClauseParam(0,billDate);
getXXHCMDateEligiblityVO1().setWhereClauseParam(1,personId);
getXXHCMDateEligiblityVO1().executeQuery();
}
catch(Exception e){
System.out.println("Exception Occured during executing getXXHCMDateEligiblityVO1");
}
}
else
{
ExceptionList.add(new OAException("Line "+vcount+" Bill Date is Mandatory."));
exceptionCount++;
}
if(vor.getBillDate() != null ){
if(getXXHCMDateEligiblityVO1().first().getAttribute(0) !=null){
String isOldBill = getXXHCMDateEligiblityVO1().first().getAttribute(0).toString();
if (isOldBill.equalsIgnoreCase("N"))
{
ExceptionList.add(new OAException("Line "+vcount+"Bill Date can not be before employee hire date."));
exceptionCount++;
}
}
}
String billAmount = vor.getBillAmount();
//---- Validating Bill Amount
try{
Double billAmount1 = Double.parseDouble(vor.getBillAmount());
if(billAmount !=null){
try{
getXXHCMEntitleAmountVO1().setWhereClauseParams(null);
getXXHCMEntitleAmountVO1().setWhereClauseParam(0,personId);
getXXHCMEntitleAmountVO1().setWhereClauseParam(1,reiXXType);
getXXHCMEntitleAmountVO1().executeQuery();
}catch(Exception e){
System.out.println("Exception Occured during executing XXHCMEntitleAmountVO1");
}
try {
if(reiXXType.equalsIgnoreCase("Car Fuel")) {
billTotCarFuel = billTotCarFuel+Double.parseDouble(vor.getBillAmount());
EligibleAmountCF =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
System.out.println("~~EligibleAmountCF :"+EligibleAmountCF);
}
}catch(Exception e){
if (billTotCarFuel==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountCF ="0";
ExceptionList.add(new OAException("Eligibility exceed for Car Fuel please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCF));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("Car Maintenance"))
{
billTotCarMaintanance = billTotCarMaintanance+Double.parseDouble(vor.getBillAmount());
EligibleAmountCM =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotCarMaintanance==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountCM ="0";
ExceptionList.add(new OAException("Eligibility exceed for Car Maintenance please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCM));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("Communication ReiXXursement"))
{
billTotCommReiXX = billTotCommReiXX+Double.parseDouble(vor.getBillAmount());
EligibleAmountCR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotCommReiXX==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountCR ="0";
ExceptionList.add(new OAException("Eligibility exceed for Communication ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCR));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("Higher Education ReiXXursement"))
{
billTotHigherEcucation = billTotHigherEcucation+Double.parseDouble(vor.getBillAmount());
EligibleAmountHR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotHigherEcucation==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountHR ="0";
ExceptionList.add(new OAException("Eligibility exceed for Higher Education ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountHR));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("LTA"))
{
billTotLTA = billTotLTA+Double.parseDouble(vor.getBillAmount());
EligibleAmountLTA =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotLTA==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountLTA ="0";
ExceptionList.add(new OAException("Eligibility exceed for LTA ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountLTA));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("Driver Salary"))
{
billTotDriverSal = billTotDriverSal+Double.parseDouble(vor.getBillAmount());
EligibleAmountDS =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotDriverSal==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountDS ="0";
ExceptionList.add(new OAException("Eligibility exceed for Driver Salary please correct and resubmit. XX Eligible Amount :"+ EligibleAmountDS));
}
exceptionCount++;
}
try{
if(reiXXType.equalsIgnoreCase("Medical ReiXXursement"))
{
billTotMedicalReiXX = billTotMedicalReiXX+Double.parseDouble(vor.getBillAmount());
EligibleAmountMR =getXXHCMEntitleAmountVO1().first().getAttribute(0).toString();
}
}catch(Exception e){
if (billTotMedicalReiXX==0){
ExceptionList.add(new OAException ("Bill Amount for bill nuXXer:" +
billNuXXer + " on bill date:" +
billDate + " should be more than 0.",
OAException.ERROR));
}
else{
EligibleAmountMR ="0";
ExceptionList.add(new OAException("Eligibility exceed for Medical ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountMR));
}
exceptionCount++;
}
}
}
catch(Exception e)
{
if (billAmount==null )
{
System.out.println("***********inside exception1");
throw new OAException("Line "+vcount+"Bill Amount is mandatory" );
}
else
{
System.out.println("***********inside exception2");
throw new OAException("Bill Amount should be numeric" );
}
}
}
}
// Call Validation VO if any of the bill amount is greater than 0.
if(EligibleAmountCF !="0" && EligibleAmountCF != null){
if(billTotCarFuel>0)
{
String isError = returnError("Car Fuel",billTotCarFuel,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Car Fuel please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCF));
exceptionCount++;
}
}
}
if(EligibleAmountCM !="0" && EligibleAmountCM != null){
if(billTotCarMaintanance>0)
{
String isError = returnError("Car Maintenance",billTotCarMaintanance,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Car Maintenance please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCM));
exceptionCount++;
}
}
}
if(EligibleAmountCR !="0" && EligibleAmountCR != null){
if(billTotCommReiXX>0)
{
String isError = returnError("Communication ReiXXursement",billTotCommReiXX,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Communication ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountCR));
exceptionCount++;
}
}
}
if (EligibleAmountHR !="0" && EligibleAmountCF != null){
if(billTotHigherEcucation>0)
{
String isError = returnError("Higher Education ReiXXursement",billTotHigherEcucation,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Higher Education ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountHR));
exceptionCount++;
}
}
}
if(EligibleAmountLTA !="0" && EligibleAmountLTA != null){
if(billTotLTA>0)
{
String isError = returnError("LTA",billTotLTA,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for LTA ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountLTA));
exceptionCount++;
}
}
}
if(EligibleAmountDS !="0" && EligibleAmountDS != null){
if(billTotDriverSal>0)
{
String isError = returnError("Driver Salary",billTotDriverSal,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Driver Salary please correct and resubmit. XX Eligible Amount :"+ EligibleAmountDS));
exceptionCount++;
}
}
}
if(EligibleAmountMR !="0" && EligibleAmountMR != null){
if(billTotMedicalReiXX>0)
{
String isError = returnError("Medical ReiXXursement",billTotMedicalReiXX,personId);
System.out.println("isError : "+isError);
if(isError.equals("Y"))
{
ExceptionList.add(new OAException("Eligibility exceed for Medical ReiXXursement please correct and resubmit. XX Eligible Amount :"+ EligibleAmountMR));
exceptionCount++;
}
}
}
System.out.println("Exception Size is "+ExceptionList.size());
System.out.println("Error Count is : "+exceptionCount);
if(ExceptionList.size()>0)
OAException.raiseBundledOAException(ExceptionList);
} // End Validate ReiXXursment..
public String returnError(String reiXXType, Double billTotCarFuel, int personId)
{
try
{
getXXHCMCheckReiXXEligibVO1().setWhereClauseParams(null);
getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(0,reiXXType);
getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(1,billTotCarFuel);
getXXHCMCheckReiXXEligibVO1().setWhereClauseParam(2,personId);
getXXHCMCheckReiXXEligibVO1().executeQuery();
String isError = getXXHCMCheckReiXXEligibVO1().first().getAttribute(0).toString();
return isError;
}
catch(Exception e)
{
return "N" ;
}
}
public void initBtnDiablsVO(){
getXXHCXXtnDisableVO1().executeQuery();
}
public String getBtnStatus()
{
try{
String btnStatus= getXXHCXXtnDisableVO1().first().getAttribute(0).toString();
System.out.println("Button Status"+btnStatus);
return btnStatus;
}catch(Exception e)
{
return "N";
}
}
/**Container's getter for XXHCMDateEligiblityVO1
*/
public XXHCMDateEligiblityVOImpl getXXHCMDateEligiblityVO1()
{
return (XXHCMDateEligiblityVOImpl)findViewObject("XXHCMDateEligiblityVO1");
}
/**Container's getter for XXHCMEntitleAmountVO1
*/
public XXHCMEntitleAmountVOImpl getXXHCMEntitleAmountVO1()
{
return (XXHCMEntitleAmountVOImpl)findViewObject("XXHCMEntitleAmountVO1");
}
/**Container's getter for XXHCXXtnDisableVO1
*/
public XXHCXXtnDisableVOImpl getXXHCXXtnDisableVO1()
{
return (XXHCXXtnDisableVOImpl)findViewObject("XXHCXXtnDisableVO1");
}
/**Container's getter for XXHCMMedBenDetailsVO1
*/
public XXHCMMedBenDetailsVOImpl getXXHCMMedBenDetailsVO1()
{
return (XXHCMMedBenDetailsVOImpl)findViewObject("XXHCMMedBenDetailsVO1");
}
/**Container's getter for XXHCMPrintDetVO1
*/
public XXHCMPrintDetVOImpl getXXHCMPrintDetVO1()
{
return (XXHCMPrintDetVOImpl)findViewObject("XXHCMPrintDetVO1");
}
}