Commit 6fd1e236 authored by vvengurlekar's avatar vvengurlekar

AdmCommon.java

AllowDednSalComp.java
PayrollSplitgenAccPrc.java - changes done to add new functions in script engine


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213028 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6c48b02c
...@@ -5836,4 +5836,52 @@ public class AdmCommon ...@@ -5836,4 +5836,52 @@ public class AdmCommon
return timeStampValue; return timeStampValue;
} }
//Added By Vikas Lagad on 13-09-2019[To get timestamp value] End //Added By Vikas Lagad on 13-09-2019[To get timestamp value] End
//Added by Varsha V on 28-11-19 as per suggested by Sir
public double gfCallPayrollDdf(String empcode, String prdcode, String proctype, String calctype, double acNewamt, String adcode, Connection conn) throws SQLException, ITMException
{
double retAmt = 0.0;
String sql = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
System.out.println("gfCallPayrollDdf Method called");
try
{
sql = "select nvl(ddf_pyrl_calc(?,?,?,?,?,?),0) as ret_amt from dual";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empcode);
pstmt.setString(2, prdcode);
pstmt.setString(3, proctype);
pstmt.setString(4, calctype);
pstmt.setDouble(5, acNewamt);
pstmt.setString(6, adcode);
rs = pstmt.executeQuery();
if(rs.next())
{
retAmt = rs.getDouble("ret_amt");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
}
return retAmt;
}
//Ended by Varsha V on 28-11-19 as per suggested by Sir
} }
...@@ -36,6 +36,7 @@ public class AllowDednSalComp ...@@ -36,6 +36,7 @@ public class AllowDednSalComp
ArrayList<String> pbSyntaxKeyList = new ArrayList<String>(); ArrayList<String> pbSyntaxKeyList = new ArrayList<String>();
ArrayList<String> pbToJavaSyntaxKeyList = new ArrayList<String>(); ArrayList<String> pbToJavaSyntaxKeyList = new ArrayList<String>();
int pbToJavaSyntaxKeySize = 0; int pbToJavaSyntaxKeySize = 0;
Connection admCommonConn = null;
private String convertFormulaInJava(String input, Connection conn) throws ITMException private String convertFormulaInJava(String input, Connection conn) throws ITMException
{ {
try try
...@@ -812,6 +813,16 @@ public class AllowDednSalComp ...@@ -812,6 +813,16 @@ public class AllowDednSalComp
exprsEngine.eval("function IIF(a,b,c) {return a?b:c}"); exprsEngine.eval("function IIF(a,b,c) {return a?b:c}");
exprsEngine.eval("function ISNULL(a) {return a==null?true:false}"); exprsEngine.eval("function ISNULL(a) {return a==null?true:false}");
//Ended by Varsha V on 22-07-19 //Ended by Varsha V on 22-07-19
//Added by Varsha V on 02-12-19
exprsEngine.eval("function GF_GETENV(a,b) {var compName = Packages.ibase.webitm.ejb.adm.AllowDednSalComp;"
+ "var obj = new Packages.ibase.webitm.ejb.adm.AllowDednSalComp();"
+ "var res = obj.getEnv(a,b);"
+ "return res;}");
exprsEngine.eval("function GF_CALL_PYRL_DDF(a,b,c,d,e,f) {var compName = Packages.ibase.webitm.ejb.adm.AllowDednSalComp;"
+ "var obj = new Packages.ibase.webitm.ejb.adm.AllowDednSalComp();"
+ "var res = obj.gfCallPayrollDdf(a,b,c,d,e,f);"
+ "return res;}");
//Ended by Varsha V on 02-12-19
AdmCommon admCommon = new AdmCommon(); AdmCommon admCommon = new AdmCommon();
PayrollSplitgenAccPrc payrollPrc = new PayrollSplitgenAccPrc(); PayrollSplitgenAccPrc payrollPrc = new PayrollSplitgenAccPrc();
UtilMethods utilMethods = new UtilMethods(); UtilMethods utilMethods = new UtilMethods();
...@@ -837,6 +848,8 @@ public class AllowDednSalComp ...@@ -837,6 +848,8 @@ public class AllowDednSalComp
ArrayList payAdList = null; ArrayList payAdList = null;
try try
{ {
//Added below line by Varsha V on 02-12-19
admCommonConn = argConn;
/*sql = "select date_join, relieve_date, retirement_date from employee where emp_code = ? "; /*sql = "select date_join, relieve_date, retirement_date from employee where emp_code = ? ";
pstmt = argConn.prepareStatement(sql);*/ pstmt = argConn.prepareStatement(sql);*/
...@@ -2227,5 +2240,43 @@ public class AllowDednSalComp ...@@ -2227,5 +2240,43 @@ public class AllowDednSalComp
return retMap; return retMap;
} }
//Added by Varsha V on 2-12-19
public String getEnv(String prdCode, String varName) throws ITMException
{
String retValue = "";
String sql = "";
PreparedStatement pStmt = null;
ResultSet rs = null;
try
{
System.out.println("prd_code: "+prdCode+ " varName: "+varName);
retValue = admCommon.getEnv(prdCode, varName, admCommonConn);
}
catch (Exception e)
{
System.out.println("Exception :ITMDBAccessEJB :getEnvFin:" + e.getMessage() + ":");
e.printStackTrace();
throw new ITMException(e);
}
return retValue;
}
public double gfCallPayrollDdf(String empcode, String prdcode, String proctype, String calctype, double acNewamt, String adcode) throws SQLException, ITMException
{
double retAmt = 0.0;
System.out.println("gfCallPayrollDdf Method called");
try
{
retAmt = admCommon.gfCallPayrollDdf(empcode, prdcode, proctype, calctype, acNewamt, adcode, admCommonConn);
}
catch(Exception e)
{
System.out.println(e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
return retAmt;
}
//Ended by Varsha V on 2-12-19
} }
...@@ -984,6 +984,10 @@ public class PayrollSplitgenAccPrc extends ProcessEJB implements PayrollSplitgen ...@@ -984,6 +984,10 @@ public class PayrollSplitgenAccPrc extends ProcessEJB implements PayrollSplitgen
{ {
payrollDataMap.put("PRD_CODE__ACC", prdCodeArr); payrollDataMap.put("PRD_CODE__ACC", prdCodeArr);
} }
else//Added else block by Varsha V on 02-12-19
{
payrollDataMap.put("PRD_CODE__ACC", "");
}
if("U".equalsIgnoreCase(runMode)) if("U".equalsIgnoreCase(runMode))
{ {
cntInner = 0; cntInner = 0;
...@@ -1067,6 +1071,19 @@ public class PayrollSplitgenAccPrc extends ProcessEJB implements PayrollSplitgen ...@@ -1067,6 +1071,19 @@ public class PayrollSplitgenAccPrc extends ProcessEJB implements PayrollSplitgen
payrollDataMap.put("FROM_DATE", (Timestamp) fromDates.get(runPrd)); payrollDataMap.put("FROM_DATE", (Timestamp) fromDates.get(runPrd));
payrollDataMap.put("TO_DATE", (Timestamp) toDates.get(runPrd)); payrollDataMap.put("TO_DATE", (Timestamp) toDates.get(runPrd));
// Modified by Piyush on 07/09/2019 [To add additional values which are populated in further methods].End // Modified by Piyush on 07/09/2019 [To add additional values which are populated in further methods].End
//Added by Varsha V on 2-12-19 to add new parameters
if("PY".equalsIgnoreCase(type))
{
payrollDataMap.put("CALC_BASE", "D");
payrollDataMap.put("CALC_BASE_CRITERIA", "D");
}
else
{
payrollDataMap.put("CALC_BASE", "");
payrollDataMap.put("CALC_BASE_CRITERIA", "");
}
payrollDataMap.put("FROM_DATE", (Timestamp) fromDates.get(runPrd));
//Ended by Varsha V on 2-12-19 to add new parameters
payrollDataMapAll.put(prdItem, payrollDataMap); payrollDataMapAll.put(prdItem, payrollDataMap);
} }
} }
......
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