Commit b1f93fc7 authored by manohar's avatar manohar

Bug fixing, cctr_code in all cases initialised properly as in summ cases "null" was updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@96824 ce508802-f39f-4f6c-b175-0d175dae99d5
parent dafb2144
......@@ -333,7 +333,13 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
HdrMap.put("tran_date",rs.getTimestamp("tran_date"));
HdrMap.put("fin_entity",rs.getString("fin_entity"));
HdrMap.put("acct_code",rs.getString("acct_code"));
HdrMap.put("cctr_code",rs.getString("cctr_code"));
cctrCode = rs.getString("cctr_code");
if (cctrCode == null || "null".equals(cctrCode))
{
cctrCode = " ";
}
HdrMap.put("cctr_code",cctrCode);
HdrMap.put("eff_date",rs.getTimestamp("eff_date"));
HdrMap.put("invoice_id",rs.getString("invoice_id"));
HdrMap.put("amount",rs.getDouble("amount"));
......@@ -358,7 +364,12 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
HdrMap.put("sundry_type",rs.getString("sundry_type"));
HdrMap.put("sundry_code",rs.getString("sundry_code"));
HdrMap.put("acct_code__cf",rs.getString("acct_code__cf"));
HdrMap.put("cctr_code__cf",rs.getString("cctr_code__cf"));
cctrCode = rs.getString("cctr_code__cf");
if (cctrCode == null || "null".equals(cctrCode))
{
cctrCode = " ";
}
HdrMap.put("cctr_code__cf",cctrCode);
HdrMap.put("diff_amt_exch",rs.getDouble("diff_amt_exch"));
HdrMap.put("voucher_no",rs.getString("voucher_no"));
HdrMap.put("invvouc_flag",rs.getString("invvouc_flag"));
......@@ -423,6 +434,10 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
{
cctrCode = (String) HdrMap.get("cctr_code");
}
if (cctrCode == null || "null".equals(cctrCode))
{
cctrCode = " ";
}
/*findIndex = -1;
findIndex = findExistingIndex(DetList,acctCode, cctrCode, (double) Double.parseDouble( "" + HdrMap.get("exch_rate")));
......@@ -491,7 +506,10 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
errCode = "VTACCTRECO";
break;
}
cctrReco = cctrReco == null ? "" : cctrReco ;
if (cctrReco == null || "null".equals(cctrReco))
{
cctrReco = " ";
}
/*findIndex = -1;
findIndex = findExistingIndex(DetList,acctReco, cctrReco, (double) Double.parseDouble( "" + HdrMap.get("exch_rate")));
if (findIndex > -1)
......@@ -553,7 +571,16 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
DetMap.put("emp_code", "");
DetMap.put("anal_code", "");
DetMap.put("acct_code", rs.getString("acct_code"));
DetMap.put("cctr_code", rs.getString("cctr_code"));
cctrCode = rs.getString("cctr_code");
if (cctrCode == null || "null".equals(cctrCode))
{
cctrCode = " ";
}
DetMap.put("cctr_code", cctrCode );
exchRateInv = rs.getDouble("exch_rate__inv");
if (exchRateInv == 0)
{
......@@ -573,7 +600,10 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
{
acctExch = (String) HdrMap.get("acct_code__cf");
cctrExch = (String) HdrMap.get("cctr_code__cf");
cctrExch = cctrExch == null ? "" : cctrExch ;
if (cctrExch == null || "null".equals(cctrExch))
{
cctrExch = " ";
}
DetMap = new HashMap();
DetMap.put("tran_id", rs.getString("tran_id"));
......@@ -599,7 +629,10 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
acctRnd = cctrRnd.substring(0,cctrRnd.indexOf(";"));
cctrRnd = cctrRnd.substring(cctrRnd.indexOf(";")+1);
}
cctrRnd = cctrRnd == null ? "" : cctrRnd ;
if (cctrRnd == null || "null".equals(cctrRnd))
{
cctrRnd = " ";
}
DetMap = new HashMap();
DetMap.put("tran_id", rs.getString("tran_id"));
......@@ -625,7 +658,12 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
pstmt.setString(1,(String) DetMap.get("tran_id"));
pstmt.setString(2,String.valueOf(maxline));
pstmt.setString(3,(String) DetMap.get("acct_code"));
pstmt.setString(4,(String) DetMap.get("cctr_code"));
cctrCode = (String) DetMap.get("cctr_code");
if (cctrCode == null || "null".equals(cctrCode))
{
cctrCode = " ";
}
pstmt.setString(4,cctrCode);
pstmt.setDouble(5,(double) Double.parseDouble( "" +DetMap.get("exch_rate")));
pstmt.setDouble(6,(double) Double.parseDouble( "" +DetMap.get("amount")));
pstmt.setString(7,(String) DetMap.get("emp_code"));
......@@ -660,13 +698,46 @@ public class DrCrInvConf extends ActionHandlerEJB implements DrCrInvConfLocal,Dr
}*/
}
catch(Exception e)
catch(SQLException sqx)
{
//System.out.println(e.getMessage());
//System.out.println("Exception : "+e);
//e.printStackTrace();
errCode = "ERROR";
throw new ITMException(e);
SQLException ex ;
while (sqx != null)
{
if((CommonConstants.DB_NAME).equalsIgnoreCase("oracle") && (sqx).toString().indexOf("ORA-00054") > -1)
{
errCode = "VTLCKERR";
System.out.println("The SQLException occurs in UpdatStock [Stockupdate] Exception[Recod is locked try after some time] ["+sqx.toString() + "]");
}
else
{
errCode = "ERROR";
System.out.println("The SQLException occurs in UpdatStock [Stockupdate] Exception ["+sqx.toString() + "]");
}
//Change by Rohan on 18-02-13 for throwing exception
ex = sqx;
sqx.printStackTrace();
sqx = sqx.getNextException();
//Change by Rohan on 18-02-13 for throwing exception.start
if(sqx == null)
{
sqx = ex;
break;
}
//Change by Rohan on 18-02-13 for throwing exception.end
}
throw new ITMException(sqx);
}
catch(Exception se12){
System.out.println("Exception in UpdatStock [Stockupdate]"+se12);
se12.printStackTrace();
throw new ITMException(se12);
}
return errCode;
}
......
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