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
......@@ -682,8 +682,34 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
{
try
{
if(conn != null)
{
conn.close();
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){}
}
......@@ -739,10 +765,16 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
int childNodeListLength;
int cnt;
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
{
conn = getConnection();
finCommon = new FinCommon();//Modified by Anjali R. on[21/09/2018]
//stmt = conn.createStatement();
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
System.out.println("userId = "+userId);
......@@ -821,15 +853,39 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
hm.put("line_no",childNodeValue);
}
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();
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"))
{
//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();
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);
}
......@@ -853,6 +909,25 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
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
{
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"))
{
......@@ -971,7 +1046,7 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
break;
}
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);
if(errCode != "")
{
......@@ -1142,17 +1217,47 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
}//try
catch(Exception e)
{
System.out.println("Exception ::"+e);
System.out.println("Exception ::"+e.getMessage());
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
System.out.println("Closing Connection.....");
conn.close();
conn = null;
}catch(Exception se){}
if(conn != null)
{
conn.close();
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 se)
{
}
}
System.out.println("ErrString ::"+errString);
return errString;
......@@ -1367,4 +1472,18 @@ public class PayableOpenings extends ValidatorEJB implements PayableOpeningsLoca
}//outer if
return arrList;
}//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
\ 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