Commit 0d7e2115 authored by arawankar's avatar arawankar

FinCommon.java

PayableOpenings.java
-Added validation of sundry code in payableOpening component



git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@191485 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1209727a
...@@ -681,9 +681,35 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -681,9 +681,35 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
finally finally
{ {
try try
{
if(conn != null)
{ {
conn.close(); conn.close();
conn = null; conn = null;
}
//Modified by Anjali R. on[21/09/2018][Start]
if(rs != null)
{
rs.close();
rs = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
//Modified by Anjali R. on[21/09/2018][End]
} }
catch(Exception s){} catch(Exception s){}
} }
...@@ -739,10 +765,16 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -739,10 +765,16 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
int childNodeListLength; int childNodeListLength;
int cnt; int cnt;
SimpleDateFormat simpleDateFormat = null; SimpleDateFormat simpleDateFormat = null;
//Modified by Anjali R. on[21/09/2018][Start]
String sundryCode ="";
int sundryCnt = 0;
String sundryType = "";
FinCommon finCommon = null;
//Modified by Anjali R. on[21/09/2018][End]
try try
{ {
conn = getConnection(); conn = getConnection();
finCommon = new FinCommon();//Modified by Anjali R. on[21/09/2018]
//stmt = conn.createStatement(); //stmt = conn.createStatement();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
System.out.println("userId = "+userId); System.out.println("userId = "+userId);
...@@ -821,15 +853,39 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -821,15 +853,39 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
hm.put("line_no",childNodeValue); hm.put("line_no",childNodeValue);
} }
if(childNodeName.equals("tran_ser")) if(childNodeName.equals("tran_ser"))
{
//Modified by Anjali R. on[21/09/2018][If tran_ser is null then null pointer exception occure][Start]
/*childNodeValue= childNode.getFirstChild().getNodeValue();
hm.put("tran_ser",childNodeValue);*/
if(childNode.getFirstChild() != null)
{ {
childNodeValue= childNode.getFirstChild().getNodeValue(); childNodeValue= childNode.getFirstChild().getNodeValue();
hm.put("tran_ser",childNodeValue); hm.put("tran_ser",childNodeValue);
}
else
{
hm.put("tran_ser","");
}
//Modified by Anjali R. on[21/09/2018][If tran_ser is null then null pointer exception occure][End]
} }
if(childNodeName.equals("ref_no")) if(childNodeName.equals("ref_no"))
{
//Modified by Anjali R. on[21/09/2018][If ref_no is null then null pointer exception occure][Start]
/*childNodeValue= childNode.getFirstChild().getNodeValue();
hm.put("ref_no",childNodeValue);*/
if(childNode.getFirstChild() != null)
{ {
childNodeValue= childNode.getFirstChild().getNodeValue(); childNodeValue= childNode.getFirstChild().getNodeValue();
hm.put("ref_no",childNodeValue); hm.put("ref_no",childNodeValue);
} }
else
{
hm.put("ref_no","");
}
//Modified by Anjali R. on[21/09/2018][If ref_no is null then null pointer exception occure][End]
}
} }
arList.add(hm); arList.add(hm);
} }
...@@ -853,6 +909,25 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -853,6 +909,25 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
errString = getErrorString("sundry_code",errCode,userId); errString = getErrorString("sundry_code",errCode,userId);
break; break;
} }
//Modified by Anjali R. on [21/09/2018][If sundry code is not blank then system should validate the sundry code from sundry master][Start]
else
{
sundryCode = checkNull(genericUtility.getColumnValue("sundry_code", dom));
sundryType = checkNull(genericUtility.getColumnValue("sundry_type", dom));
System.out.println("sundryCode--["+sundryCode+"]---sundryType---["+sundryType+"]");
if(sundryCode != null && sundryCode.trim().length() > 0)
{
sundryCnt = finCommon.getSundryCode(sundryCode, sundryType, conn);
System.out.println("sundryCnt---["+sundryCnt+"]");
if(sundryCnt == 0 )
{
errCode = "VMSUND1";
errString = getErrorString("sundry_code",errCode,userId);
break;
}
}
}
//Modified by Anjali R. on [21/09/2018][If sundry code is not blank then system should validate the sundry code from sundry master][Start]
} }
else if(childNodeName.equals("tran_ser")) else if(childNodeName.equals("tran_ser"))
{ {
...@@ -971,7 +1046,7 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -971,7 +1046,7 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
break; break;
} }
System.out.println("acct_code ................."+acctCode); System.out.println("acct_code ................."+acctCode);
FinCommon finCommon = new FinCommon(); //FinCommon finCommon = new FinCommon();//Commented by Anjali R. on[21/09/2018]
errCode = finCommon.isAcctCode(getColumnValue("site_code",dom1),acctCode,"fin",conn); errCode = finCommon.isAcctCode(getColumnValue("site_code",dom1),acctCode,"fin",conn);
if(errCode != "") if(errCode != "")
{ {
...@@ -1142,17 +1217,47 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -1142,17 +1217,47 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
}//try }//try
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception ::"+e); System.out.println("Exception ::"+e.getMessage());
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e);
} }
finally finally
{ {
try try
{ {
System.out.println("Closing Connection....."); System.out.println("Closing Connection.....");
if(conn != null)
{
conn.close(); conn.close();
conn = null; conn = null;
}catch(Exception se){} }
//Modified by Anjali R. on[21/09/2018][Start]
if(rs != null)
{
rs.close();
rs = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
//Modified by Anjali R. on[21/09/2018][End]
}
catch(Exception se)
{
}
} }
System.out.println("ErrString ::"+errString); System.out.println("ErrString ::"+errString);
return errString; return errString;
...@@ -1367,4 +1472,18 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca ...@@ -1367,4 +1472,18 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
}//outer if }//outer if
return arrList; return arrList;
}//sundryDesc }//sundryDesc
//Modified by Anjali R. on[20/09/2018][Added new method to check null][Start]
private String checkNull(String input)
{
if (input == null)
{
input = "";
}
else
{
input = input.trim();
}
return input;
}
//Modified by Anjali R. on[20/09/2018][Added new method to check null][End]
}//class }//class
\ 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