Commit bcacfa07 authored by smanohar's avatar smanohar

Bug fixing - rollback added also errString checking logic corrected

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187476 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 00eb970b
......@@ -391,7 +391,7 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
Connection conn = null;
String fromDateStr = "", refDateDet1="",toDateStr = "", dateLastProcStr = "",errString = "",sTranDate="";
String xmlRetString = "";
String xmlRetString = "", retString = "";
double exchRate=0.0;
PreparedStatement pstmt = null, pstmt1 = null, pstmt2 = null;
ResultSet rs = null, rs1 = null, rs2 = null;
......@@ -720,12 +720,16 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
System.out.println("@V@ Tran id :- ");
errString = "";
if (cnt == 0)
{
}
}//Exist if result of process is 1.
else
{
retString = errString;
}
//update receipt sql
diffTot = diffTot + diff ;
sql = "update receipt set diff_amt__exch = ? where TRAN_ID = ?";
......@@ -736,7 +740,8 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
pstmt.close();
pstmt = null;
if(errString != null && errString.trim().length() > 0)
//if(errString != null && errString.trim().length() > 0)
if(retString == null || retString.trim().length() == 0)
{
errString = itmDBAccessEJB.getErrorString("","VTCOMPL","","",conn);
conn.commit();
......@@ -744,7 +749,9 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
}
else
{
return errString;
conn.rollback();
return retString;
}
}
//Insert into Misc Tables
......@@ -887,11 +894,27 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
int endIndexIssue = arrayForTranIdIssue[1].indexOf("</TranID>");
tranId = arrayForTranIdIssue[1].substring(0, endIndexIssue);
System.out.println("@V@ Tran id :- ");
errString = ""
}//Exist if result of process is 1.
else
{
retString = errString;
}
//update receipt sql
diffTot = diffTot + diff ;
sql = "update receipt set diff_amt__exch = ? where TRAN_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setDouble(1, diffTot);
pstmt.setString(2, tranId);
rs = pstmt.executeQuery();
pstmt.close();
pstmt = null;
//if(errString != null && errString.trim().length() > 0)
}
if(errString ==null || errString.trim().length() == 0)
//if(errString ==null || errString.trim().length() == 0)
if(retString == null || retString.trim().length() == 0)
{
sql = "update pdc_received set status = 'P',tran_ref_rcp = ? where TRAN_ID = ?";
......@@ -907,7 +930,8 @@ public class PdcToReceiptPrc extends ProcessEJB implements PdcToReceiptPrcLocal,
}
else
{
return errString;
conn.rollback();
return retString;
}
......
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