Commit 33eefff0 authored by vvengurlekar's avatar vvengurlekar

PayarrToProc.java - changes as per issue reported by Vinuth sir that duplicate...

PayarrToProc.java - changes as per issue reported by Vinuth sir that duplicate transaction check only if status is Unconfirmed


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194173 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7ba33dd2
......@@ -392,44 +392,47 @@ public class PayarrToProc extends ValidatorEJB implements PayarrToProcLocal,Paya
tranId = checkNull(genericUtility.getColumnValue("tran_id", dom));
status = checkNull(genericUtility.getColumnValue("status", dom));
cnt = 0;
sql = "select count(*) as cnt from payarr_to_proc where EMP_CODE = ?"
+ " and prd_code = ? and proc_type = ? and (status = ? )"
+ "and tran_id <> ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setString(2, prdCode);
pstmt.setString(3, procType);
pstmt.setString(4, status);
pstmt.setString(5, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt("cnt");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
//Modified by Rohini on 03-Dec-2018[System should check for duplicate entries only in case of new Status is 'U']start
if(status.equalsIgnoreCase("U") )
{
pstmt.close();
pstmt = null;
}
if(cnt > 0)
{
errCode = "VTPAYARR09";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
sql = "select count(*) as cnt from payarr_to_proc where EMP_CODE = ?"
+ " and prd_code = ? and proc_type = ? and (status = ? )"
+ "and tran_id <> ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empCode);
pstmt.setString(2, prdCode);
pstmt.setString(3, procType);
pstmt.setString(4, status);
pstmt.setString(5, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
break;
cnt = rs.getInt("cnt");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt > 0)
{
errCode = "VTPAYARR09";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
msgType = errorType(conn, errCode);
if (msgType.equalsIgnoreCase("E"))
{
break;
}
}
}
}
//Modified by Rohini on 03-Dec-2018[System should check for duplicate entries only in case of new Status is 'U']end
//Added by Jaffar S. for validation while editing same record on 19-11-18 [End]
}
}
......@@ -645,16 +648,23 @@ public class PayarrToProc extends ValidatorEJB implements PayarrToProcLocal,Paya
xmlString.append("<site protect=\"1\"><![CDATA[").append(checkNull(site)).append("]]></site>\r\n");
xmlString.append("<descr protect=\"1\"><![CDATA[").append(checkNull(descr)).append("]]></descr>\r\n");
xmlString.append("<prd_code protect=\"1\"><![CDATA[").append(checkNull(prdCode)).append("]]></prd_code>\r\n");
xmlString.append("<status protect=\"0\"><![CDATA[").append("U").append("]]></status>\r\n");
xmlString.append("<prd_code__acc protect=\"1\"><![CDATA[").append(checkNull(prdCodeAcc)).append("]]></prd_code__acc>\r\n");
xmlString.append("<proc_date protect=\"1\"><![CDATA[").append(checkNull(procDate)).append("]]></proc_date>\r\n");
xmlString.append("<proc_type protect=\"1\"><![CDATA[").append("PY").append("]]></proc_type>\r\n");
//Modified by Rohini on 03-Dec-2018[To set user required process type]start
//xmlString.append("<proc_type protect=\"1\"><![CDATA[").append("PY").append("]]></proc_type>\r\n");
xmlString.append("<proc_type protect=\"1\"><![CDATA[").append(procType).append("]]></proc_type>\r\n");
//Modified by Rohini on 03-Dec-2018[To set user required process type]end
xmlString.append("<tran_id protect=\"1\"><![CDATA[").append(checkNull(tranId)).append("]]></tran_id>\r\n");
xmlString.append("<chg_date><![CDATA[").append(checkNull(chgDate)).append("]]></chg_date>\r\n");
xmlString.append("<chg_user><![CDATA[").append(checkNull(chgUser)).append("]]></chg_user>\r\n");
xmlString.append("<chg_term><![CDATA[").append(checkNull(chgTerm)).append("]]></chg_term>\r\n");
if((prdCodeAcc != null && prdCodeAcc.trim().length()>0 ) && status.trim().equalsIgnoreCase("P") )
// if((prdCodeAcc != null && prdCodeAcc.trim().length()>0 ) && status.trim().equalsIgnoreCase("P") )
// {
//
// System.out.println("IN IF CONDITION::::::::::");
// xmlString.append("<status protect=\"1\"><![CDATA[").append(checkNull(status)).append("]]></status>\r\n");
// }
if((status.trim().equalsIgnoreCase("P") ))
{
System.out.println("IN IF CONDITION::::::::::");
xmlString.append("<status protect=\"1\"><![CDATA[").append(checkNull(status)).append("]]></status>\r\n");
......
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