Commit 8a15fef3 authored by arawankar's avatar arawankar

Updated PayrVoucherRls.java and PayrVoucherHld.java

-Changes made to show error message in case of voucher is already cancelled and user trying to put it on hold or release.

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187004 ce508802-f39f-4f6c-b175-0d175dae99d5
parent a574b42e
......@@ -77,8 +77,23 @@ public class PayrVoucherHld extends ActionHandlerEJB implements PayrVoucherHldLo
hold = rs.getString(2);
System.out.println("hold ::"+hold);
}
//Modified by Anjali R. on [27/06/2018][Added if condition to close resultset]
if(rs != null)
{
rs.close();
rs = null;
}
//Modified by Anjali R. on [27/06/2018][Added condition for cancelled voucher,not allow to put the voucher on hold.][Start]
if("X".equalsIgnoreCase(confirm))
{
errCode = "VTALCANC01";
errString = itmDBAccessEJB.getErrorString("",errCode,"","",conn);
System.out.println("errString------["+errString+"]");
return errString;
}
//Modified by Anjali R. on [27/06/2018][Added condition for cancelled voucher,not allow to put the voucher on hold.][End]
if (confirm.equals("Y"))
{
sql = "SELECT TOT_AMT, ADJ_AMT, HOLD_AMT FROM MISC_PAYABLES "
......@@ -94,8 +109,12 @@ public class PayrVoucherHld extends ActionHandlerEJB implements PayrVoucherHldLo
holdAmt = rs.getDouble(3);
System.out.println("holdAmt ::"+holdAmt);
}
//Modified by Anjali R. on [27/06/2018][Added if condition to close resultset]
if(rs != null)
{
rs.close();
rs = null;
}
if ((totalAmt - adjAmt) == 0)
{
errCode = "VTBAL2"; // already paid off
......@@ -113,8 +132,12 @@ public class PayrVoucherHld extends ActionHandlerEJB implements PayrVoucherHldLo
pstmt.setString(1,"P-VOUC");
pstmt.setString(2,tranId);
updateCnt = pstmt.executeUpdate();
//Modified by Anjali R. on [27/06/2018][Added if condition to close prepared statement]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("updateCnt ::"+updateCnt);
updSql ="UPDATE PAYR_VOUCHER SET HOLD = 'Y' WHERE TRAN_ID = ? ";
......@@ -122,8 +145,12 @@ public class PayrVoucherHld extends ActionHandlerEJB implements PayrVoucherHldLo
pstmt = conn.prepareStatement(updSql);
pstmt.setString(1,tranId);
updateCnt = pstmt.executeUpdate();
//Modified by Anjali R. on [27/06/2018][Added if condition to close prepared statement]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("updateCnt ::"+updateCnt);
if (updateCnt > 0)
{
......@@ -140,8 +167,12 @@ public class PayrVoucherHld extends ActionHandlerEJB implements PayrVoucherHldLo
pstmt = conn.prepareStatement(updSql);
pstmt.setString(1,tranId);
updateCnt = pstmt.executeUpdate();
//Modified by Anjali R. on [27/06/2018][Added if condition to close prepared statement]
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
System.out.println("updateCnt ::"+updateCnt);
if (updateCnt > 0)
{
......
......@@ -79,6 +79,17 @@ public class PayrVoucherRls extends ActionHandlerEJB implements PayrVoucherRlsLo
}
rs.close();
rs = null;
//Modified by Anjali R.on[27/06/2018][Added condition for cancelled voucher,to not allow the release the voucher.][Start]
if("X".equalsIgnoreCase(confirm))
{
errCode = "VTALCANC02";
errString = itmDBAccessEJB.getErrorString("",errCode,"","",conn);
System.out.println("errString---["+errString+"]");
return errString;
}
//Modified by Anjali R.on[27/06/2018][Added condition for cancelled voucher,to not allow the release the voucher.][End]
if (hold.equals(""))
{
errCode = "VTHLDNLL";
......
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