Commit be87d40c authored by arawankar's avatar arawankar

-Changes made in below components

EmpLvePrkBalTrfConf.java
-Changes made to update proper balance 
EmpLvePrkBalTrfIC.java
-Changes made to not allow the  employee to enter another entry while unconfirmed entry is already exist. 
AD89SUN091.sql
-Added sql file for the messages table


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189375 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9613d783
......@@ -776,7 +776,7 @@ public class EmpLvePrkBalTrfIC extends ValidatorEJB implements EmpLvePrkBalTrfIC
cnt =0;
String tranType = checkNull(genericUtility.getColumnValue("tran_type", dom,objContext ));
System.out.println("tranType--["+tranType+"]");
sql = " SELECT count(*) as cnt FROM EMP_LVEPRKBAL_TRFHDR WHERE EMP_CODE__FR = ? AND TRAN_TYPE = ? AND STATUS <> 'A' ";
sql = " SELECT count(*) as cnt FROM EMP_LVEPRKBAL_TRFHDR WHERE EMP_CODE__FR = ? AND TRAN_TYPE = ? AND STATUS <> 'C' ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCodeFrom);
pstmt.setString(2, tranType);
......
......@@ -132,21 +132,21 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
E12GenericUtility genericUtility = new E12GenericUtility();
boolean successFlag = true;
StringBuffer xmlStringForID = null;
//Added by anjali
double orgAmtBal = 0.0;
try {
System.out.println("Inside confirm method of EmpLvePrkBalTrfConf");
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [START]
/* AppConnectParm appConnect = new AppConnectParm();
/* AppConnectParm appConnect = new AppConnectParm();
InitialContext ctx = new InitialContext(appConnect.getProperty());
itmDBAccess = (ITMDBAccessLocal)ctx.lookup("ibase/ITMDBAccessEJB/local");
empLeaveConf = (EmpLeaveConfLocal)ctx.lookup("ibase/EmpLeaveConf/local");*/
itmDBAccess = new ITMDBAccessEJB();
empLeaveConf = new EmpLeaveConf();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
itmDBAccess = new ITMDBAccessEJB();
empLeaveConf = new EmpLeaveConf();
//Added & Commented by sarita to create object instead creating lookup for ITMDBAccessEJB on 20 JULY 18 [END]
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
java.util.Date currentDate = new java.util.Date();
String currDateStr = sdf.format(currentDate);
System.out.println("currDateStr::::::[" + currDateStr + "]");
......@@ -194,7 +194,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
statusDate = rs.getDate("STATUS_DATE");
empCodeConf = checkNull(rs.getString("EMP_CODE__CONF"));
balCodeAson = checkNull(rs.getString("BALANCE_ASON"));
}
if (rs != null) {
rs.close();
......@@ -204,7 +204,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
pStmt.close();
pStmt = null;
}
if ("X".equalsIgnoreCase(status)) {
retString = itmDBAccess.getErrorString("", "VTELPTRF16", userId, "", conn);
successFlag = false;
......@@ -240,7 +240,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
successFlag = false;
return retString;
}
sql = "SELECT RELIEVE_DATE FROM EMPLOYEE WHERE EMP_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, empCodeFr);
......@@ -256,11 +256,11 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
pStmt.close();
pStmt = null;
}
String releiveDateStr = genericUtility.getValidDateTimeString(relieveDateTM.toString(),
genericUtility.getDBDateFormat(), genericUtility.getApplDateFormat());
System.out.println("releiveDateStr:::::[" + releiveDateStr + "]");
sql = "SELECT CODE FROM PERIOD WHERE ? BETWEEN FR_DATE AND TO_DATE";
pStmt = conn.prepareStatement(sql);
pStmt.setTimestamp(1, relieveDateTM);
......@@ -276,7 +276,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
pStmt.close();
pStmt = null;
}
sql = "SELECT GRADE, CADRE, EMP_SITE, WORK_SITE, PAY_SITE FROM EMPLOYEE WHERE EMP_CODE = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, empCodeTo);
......@@ -338,7 +338,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
logEmpCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginEmpCode");
System.out.println("Umakanta::loginCode[" + logEmpCode + "]");
if ("LVE".equalsIgnoreCase(tranType)) {
sql = "INSERT INTO EMPLEAVE ( EMP_CODE, LVE_DATE_FR, LVE_DATE_TO, LVE_CODE, USE_FLAG, ENCH_AMT, NO_DAYS, STATUS_DATE, PRD_CODE, CHG_DATE, CHG_USER, CHG_TERM, APPL_DATE, TRAN_ID, LEAVE_STARTS, LEAVE_ENDS ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ";
......@@ -411,7 +411,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
System.out.println("empLeave.table::xtraParams[" + xtraParams + "]");
String confirmStatus = empLeaveConf.confirm(tranIdGen, xtraParams, "Y",1, conn);
System.out.println("empLeaveConf.confirm::confirmStatus[" + confirmStatus + "]");
if(!confirmStatus.contains("VTSUCC1"))
{
successFlag = false;
......@@ -567,7 +567,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
sql = "select amt_bal from allowdedn_bal where emp_code =? and ad_code =? and start_date = ? and end_date = ?";
pStmt7 = conn.prepareStatement(sql);
//Added by Anjali R. on[16/08/2018][To give error if amount balance is changes after inserting record in EMP_LVEPRKBAL_TRFHDR][End]
sql = " SELECT ACCT_PRD, BALANCE_CODE , ENCASHABLE, LVE_UNIT, FROM_DATE, TO_DATE, EXP_DATE, BALANCE FROM EMP_LVEPRKBAL_TRFDET WHERE TRAN_ID = ? GROUP BY ACCT_PRD, BALANCE_CODE, ENCASHABLE, LVE_UNIT, FROM_DATE, to_date, exp_date, BALANCE ";
pStmt = conn.prepareStatement(sql);
......@@ -591,7 +591,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
String tranIdGen = tg.generateTranSeqID(refSer, "", keyString, conn);
System.out.println("Umakanta::uniqueKey[" + tranIdGen + "]");
//Added by Anjali R. on[16/08/2018][To give error if amount balance is changes after inserting record in EMP_LVEPRKBAL_TRFHDR][Start]
//Added by Anjali R. on[16/08/2018][To give error if amount transfer is greater than amount balance ][Start]
pStmt7.setString(1,empCodeFr);
pStmt7.setString(2, balCode);
pStmt7.setTimestamp(3, frDate);
......@@ -602,13 +602,34 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
orgAmtBal = rs1.getDouble("amt_bal");
}
System.out.println("orgAmtBal--["+orgAmtBal+"]perkBalance["+perkBalance+"]");
if(orgAmtBal != perkBalance)
if(orgAmtBal > 0)
{
retString = itmDBAccess.getErrorString("", "VTELPTRF25", userId, "", conn);
successFlag = false;
return retString;
if(orgAmtBal < perkBalance)
{
retString = itmDBAccess.getErrorString("", "VTELPTRF25", userId, "", conn);
successFlag = false;
return retString;
}
}
//Added by Anjali R. on[16/08/2018][To give error if amount balance is changes after inserting record in EMP_LVEPRKBAL_TRFHDR][End]
else
{
double perkBalanceAbs = perkBalance;
System.out.println("orgAmtBal--["+orgAmtBal+"]");
orgAmtBal = Math.abs(orgAmtBal);
System.out.println("orgAmtBal--["+orgAmtBal+"]");
System.out.println("perkBalanceAbs--["+perkBalanceAbs+"]");
perkBalanceAbs = Math.abs(perkBalanceAbs);
System.out.println("perkBalance--["+perkBalanceAbs+"]");
if(orgAmtBal < perkBalanceAbs)
{
retString = itmDBAccess.getErrorString("", "VTELPTRF25", userId, "", conn);
successFlag = false;
return retString;
}
}
//Added by Anjali R. on[16/08/2018][To give error if amount transfer is greater than amount balance][End]
pStmt1.setString(1, tranIdGen);
pStmt1.setTimestamp(2, curDateTm);
pStmt1.setString(3, empCodeFr);
......@@ -643,7 +664,7 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
pStmt2.setTimestamp(9, new Timestamp(System.currentTimeMillis()));
pStmt2.setString(10, chgUser);
pStmt2.setString(11, chgTerm);
insrtStatus = pStmt2.executeUpdate();
System.out.println("insert executed = [" + insrtStatus + "]");
pStmt2.clearParameters();
......@@ -656,7 +677,8 @@ public class EmpLvePrkBalTrfConf extends ActionHandlerEJB implements EmpLvePrkBa
// Added by Varsha V on 16-07-18 for updating AMOUNT for emp_code_fr
if (successFlag) {
// Modified by Piyush on 18/07/2018 [Should not update amount].Start
pStmt6.setDouble(1, perkBalance);
//pStmt6.setDouble(1, perkBalance);
pStmt6.setDouble(1, Math.abs(perkBalance));
pStmt6.setDouble(2, perkBalance);
pStmt6.setString(3, empCodeFr);
pStmt6.setString(4, balCode);
......
......@@ -2383,5 +2383,5 @@ END;
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('VTUNCONF01','Already record exist','For this employee unconfirmed record is already present.','E','Y',null,null,null,sysdate,'SUN','SUN',null,null);
Insert into MESSAGES (MSG_NO,MSG_STR,MSG_DESCR,MSG_TYPE,MSG_OPT,MSG_TIME,ALARM,ERR_SOURCE,CHG_DATE,CHG_USER,CHG_TERM,OVERRIDE_INPUT,MAIL_OPTION)
values ('VTELPTRF25','Amount balance Changed','In allow deduction table original amount is changed.','E','Y',null,null,null,sysdate,'SUN','SUN',null,null);
values ('VTELPTRF25','Insufficiant Balance','Employee does not have sufficient balance.','E','Y',null,null,null,sysdate,'SUN','SUN',null,null);
--Added by Anjali R. on[16-08-2018][End]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment