Commit f531d44c authored by dpawar's avatar dpawar

updated confirm method


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92337 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d2430d82
......@@ -39,7 +39,7 @@ public class BondRecoveryConfirm extends ActionHandlerEJB implements BondRecover
conn=null;
ITMDBAccessEJB itmdbAccess=new ITMDBAccessEJB();
String sql="",confirmed="",errString="",empcode="",retString="";
double recAmtAct=0.0,recAmtDue=0.0;
double recAmtAct=0.0,empBondReco=0.0;
int updCnt=0;
try
{
......@@ -56,7 +56,7 @@ public class BondRecoveryConfirm extends ActionHandlerEJB implements BondRecover
confirmed =rs.getString("CONFIRMED")==null ? "":rs.getString("CONFIRMED");
empcode=rs.getString(1);
}
System.out.println("confirm value before update :"+confirmed);
if( pstmt != null )
{
pstmt.close();
......@@ -72,28 +72,32 @@ public class BondRecoveryConfirm extends ActionHandlerEJB implements BondRecover
errString = itmdbAccess.getErrorString("", "AEBCONF", "", "", conn);
return errString;
}
sql="select emp_code,recovery_amt__act,recovery_amt__due from Bond_recovery where emp_code = ?";
else
{
sql="select bond_amt__reco from employee where emp_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, empcode);
rs = pstmt.executeQuery();
if(rs.next()) empBondReco=rs.getDouble(1);
pstmt.close();rs.close();
pstmt = null;rs=null;
sql="update employee set BOND_AMT__RECO = ? where emp_code = ?";
pstmt = conn.prepareStatement( sql );
while(rs.next())
{
empcode=rs.getString(1);
recAmtAct=recAmtAct+rs.getDouble(2);
recAmtDue=rs.getDouble(3);
sql="select emp_code,recovery_amt__act from bond_recovery where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
rs = pstmt.executeQuery();
System.out.println("empcode -->"+empcode+"recAmtAct : "+recAmtAct+" recAmtDue : "+recAmtDue);
}
System.out.println("Recovery amt actual------>>>>"+recAmtAct);
pstmt.setDouble(1,recAmtAct);
if(rs.next()) recAmtAct=rs.getDouble(2);
System.out.println("Recovery amt actual : "+recAmtAct);
sql="update employee set BOND_AMT__RECO = ? where emp_code = ?";
pstmt = conn.prepareStatement( sql );
pstmt.setDouble(1,recAmtAct+empBondReco);
pstmt.setString(2,empcode);
updCnt = pstmt.executeUpdate();
System.out.println("recAmtAct+empBondReco "+(recAmtAct+empBondReco));
if( pstmt != null )
{
pstmt.close();
......@@ -119,6 +123,7 @@ public class BondRecoveryConfirm extends ActionHandlerEJB implements BondRecover
conn.rollback();
System.out.println("Not Updated actual Bond amount........");
}
}
}
catch(Exception e)
......
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