Commit 44643d49 authored by arawankar's avatar arawankar

MiscRcpPostSave.java

- Changes made to give error if adjustment amount is greater than net amount

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@197803 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 90ac6127
package ibase.webitm.ejb.fin;
import ibase.webitm.ejb.ITMDBAccessEJB;
import ibase.webitm.ejb.ValidatorEJB;
import ibase.webitm.utility.GenericUtility;
import ibase.webitm.utility.ITMException;
......@@ -40,6 +41,13 @@ public class MiscRcpPostSave extends ValidatorEJB implements MiscRcpPostSaveLoca
int lineno =1;
int cnt=0,cnt1=0,listCnt=0;//,exchrate = 0;
double exchrate=0;
//Modified by Anjali R. on [28/02/2019][Start]
ITMDBAccessEJB itmDAccessEjb = new ITMDBAccessEJB();
String errString = "";
double sumAdjAmt = 0.0;
//Modified by Anjali R. on [28/02/2019][End]
try
{
......@@ -101,7 +109,34 @@ public class MiscRcpPostSave extends ValidatorEJB implements MiscRcpPostSaveLoca
pstmt = null;
System.out.println("Total net Amount for header = >>>>"+netAmtDet);
//Modified by Anjali R. on [28/02/2019][To check adjustment amount can not be greater than net amount of receipt][Start]
sumAdjAmt = 0.0;
sql = "select sum(case when adj_amt is null then 0 else adj_amt end) as tot_adj_amt from misc_pay_rcp_trace where tran_id__rcp = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
if(rs.next())
{
sumAdjAmt = rs.getDouble("tot_adj_amt");
}
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(sumAdjAmt > netAmtDet)
{
errString = itmDAccessEjb.getErrorString("", "VTADJAMT1", "","",conn);
isError = false;
return errString;
}
//Modified by Anjali R. on [28/02/2019][To check adjustment amount can not be greater than net amount of receipt][End]
// selecting exch rate from header
sql = "select exch_rate from misc_receipt where tran_id = ? ";
pstmt = conn.prepareStatement(sql);
......@@ -180,7 +215,9 @@ public class MiscRcpPostSave extends ValidatorEJB implements MiscRcpPostSaveLoca
}
else
{
conn.commit();
//Modified by Anjali R. on [28/02/2019][Commit will not done here ,as connection passed to the method][Start]
//conn.commit();
//Modified by Anjali R. on [28/02/2019][Commit will not done here ,as connection passed to the method][End]
}
}
if(pstmt != null)
......
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