Commit 461132d3 authored by dpingle's avatar dpingle

* updated IT Ret Adjustment component on [16/10/19]

ItRetAdjProcPrc.java


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@209689 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 92321bb7
......@@ -50,7 +50,6 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
String loginSite = "";
String jobId = "";
String objName = "";
String errString = "";
String loginEmpCode = ""; // 10/10/2019
Connection logConn = null;
Connection conn = null;
......@@ -116,7 +115,7 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
}
catch(Exception e)
{
errString = e.getMessage();
retStr = e.getMessage();
e.printStackTrace();
}
// 11/10/2019.End
......@@ -296,8 +295,12 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
+ "AND A.PRD_CODE <= ? "
+ "AND A.SITE_CODE__PAY >= ? "
+ "AND A.SITE_CODE__PAY <= ? "
// Modified on 16/10/2019 [Ignore proc group criteria].Start
/*
+ "AND CASE WHEN B.PROC_GROUP IS NULL THEN ' ' ELSE B.PROC_GROUP END >= ? AND CASE WHEN B.PROC_GROUP IS NULL THEN ' ' ELSE B.PROC_GROUP END <= ? "
+ "ORDER BY EMP_CODE, PRD_CODE";
*/
// Modified on 16/10/2019 [Ignore proc group criteria].End
+ " ORDER BY EMP_CODE, PRD_CODE";
pstmt1 = conn.prepareStatement(sqlStr);
pstmt1.setString(1, finEntity);
pstmt1.setString(2, acctPrd);
......@@ -319,7 +322,10 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
prdAmtToBeAdj = prdAmtToBeAdj - prdAmtAdj;
if(prdAmtToBeAdj == 0)
{
break;
// 11/10/2019.Start
// break;
continue;
// 11/10/2019.End
}
additionalAdjAmt = 0;
......@@ -362,11 +368,17 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
System.out.println("prdAmtAdjTrace:"+prdAmtAdjTrace);
closeResources(null , rs3);
pstmt3.clearParameters();
// Modified on 16/10/2019 [Shuld get added and do not skip if 0 or less as positive amount can be adjusted].Start
/*
grSalAmt = grSalAmt - prdAmtAdjTrace;
if((grSalAmt <= 0d) || (taxAmount > 0 && grSalAmt <= taxAmount + 1))
{
continue;
}
*/
grSalAmt = grSalAmt + prdAmtAdjTrace;
// Modified on 16/10/2019 [Shuld get added and do not skip if 0 or less as positive amount can be adjusted].End
// LINE NO OF IT_RETURN_ADJ_TRACE
lineNoAdjTrace = 0;
......@@ -411,6 +423,16 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
accessAmt = grSalAmt;
}
// Modified on 16/10/2019 [To skip if access amount is les or 0].Start
if ((accessAmt < 0) || (accessAmt == 0 && prdAmtToBeAdj <= 0))
{
continue;
}
else if (accessAmt == 0 && prdAmtToBeAdj > 0)
{
accessAmt = prdAmtToBeAdj;
}
// Modified on 16/10/2019 [To skip if access amount is les or 0].End
if(prdAmtToBeAdj <= accessAmt)
{
accessAmt = prdAmtToBeAdj;
......@@ -453,10 +475,17 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
}
}
// Modified on 16/10/2019 [Should be accessAmt only].Start
/*
additionalAdjAmt = additionalAdjAmt + accessAmt;
if(additionalAdjAmt != 0)
{
pstmtUpdAdj.setDouble(1, additionalAdjAmt);
*/
if(accessAmt != 0)
{
pstmtUpdAdj.setDouble(1, accessAmt);
// Modified on 16/10/2019 [Should be accessAmt only].End
pstmtUpdAdj.setString(2, tranId);
pstmtUpdAdj.setString(3, acctPrd);
pstmtUpdAdj.setString(4, finEntity);
......@@ -477,7 +506,9 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
}
if(errCode != null && errCode.trim().length() > 0)
{
// 11/10/2019.Start
hrLogWriter.gbfErrWrite(acctPrd + ":" + prdCode, empCode, "", errCode, "E", 2, logConn);
// 11/10/2019.End
errString = itmDBAccessEJB.getErrorString("", errCode,userId, "", conn);
try
{
......@@ -496,10 +527,16 @@ public class ItRetAdjProcPrc extends ProcessEJB implements ItRetAdjProcPrcLoca
try
{
conn.commit();
// 11/10/2019.Start
hrLogWriter.gbfErrWrite(acctPrd + ":" + prdCode, empCode, "", " - Process Completed", "I", 1, logConn);
// 11/10/2019.End
}
catch(Exception e01)
{
errString = e01.getMessage();
// 11/10/2019.Start
hrLogWriter.gbfErrWrite(acctPrd + ":" + prdCode, empCode, "", errString, "E", 2, logConn);
// 11/10/2019.End
e01.printStackTrace();
throw new ITMException(e01);
}
......
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