Commit 45021b44 authored by ngadkari's avatar ngadkari

Loan Tracking system

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@187594 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b62f0bd8
...@@ -143,7 +143,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -143,7 +143,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
} }
else if(currentColumn.trim().equalsIgnoreCase("loan_party")) else if(currentColumn.trim().equalsIgnoreCase("loan_party"))
{ {
loanParty = genericUtility.getColumnValue("loan_party", dom); loanParty = genericUtility.getColumnValue("loan_party", dom);
sql = "select party_name,acct_code__ap,cctr_code__ap from loanparty where party_code = ? "; sql = "select party_name,acct_code__ap,cctr_code__ap from loanparty where party_code = ? ";
...@@ -221,10 +222,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -221,10 +222,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
valueXmlString.append("<bank_name>").append("<![CDATA[" + checkNull(bankName) + "]]>").append("</bank_name>"); valueXmlString.append("<bank_name>").append("<![CDATA[" + checkNull(bankName) + "]]>").append("</bank_name>");
} }
sql = "select acct_code__cf, cctr_code__cf from bank where bank_code = ?"; sql = "select acct_code__cf, cctr_code__cf from bank where bank_code = UPPER('"+bankCode+"')";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, bankCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
{ {
...@@ -472,14 +471,17 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -472,14 +471,17 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
} }
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn)); while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("IN DETAILS column name is %%%%%%%%%%%%%[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("IN DETAILS column name is %%%%%%%%%%%%%[" + currentColumn + "] ==> '" + columnValue + "'");
/* if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
Node currDetailF=null; Node currDetailF=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1"); Node currDetailF2=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1");
currDetailF = detailList1.item(0); currDetailF = detailList1.item(0);
NodeList detailList2 = dom.getElementsByTagName("Detail2");
currDetailF2 = detailList2.item(0);
loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF)); loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",dom)); diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",currDetailF2));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",dom)); mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",currDetailF2));
diffAmtExch = loanAmtBC - mAmtBC ; diffAmtExch = loanAmtBC - mAmtBC ;
System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'"); System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'");
...@@ -488,8 +490,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -488,8 +490,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
} }
} }
else*/ else if(currentColumn.trim().equalsIgnoreCase("ref_no"))
if(currentColumn.trim().equalsIgnoreCase("ref_no"))
{ {
...@@ -612,7 +613,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -612,7 +613,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrcur = reStrcur.substring(0, poscur); reStrcur = reStrcur.substring(0, poscur);
valueXmlString.append(reStrcur); valueXmlString.append(reStrcur);
valueXmlString.append("<exch_rate>").append("<![CDATA["+exchRate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , exchRate.toString());
} }
...@@ -754,10 +756,18 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -754,10 +756,18 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF); tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF);
siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF); siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF);
currCode =genericUtility.getColumnValue("curr_code", dom); currCode =genericUtility.getColumnValue("curr_code", dom);
mexrate = checkDoubleNull(genericUtility.getColumnValue("exch_rate",dom));
if (mexrate ==0 )
{
mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn); mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn);
valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>"); valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , mexrate.toString()); setNodeValue(dom,"exch_rate" , mexrate.toString());
}
else
{
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams); String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams);
int pos = reStr.indexOf("<Detail2>"); int pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9); reStr = reStr.substring(pos + 9);
...@@ -781,24 +791,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -781,24 +791,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
valueXmlString.append("<amount__bc protect = \"1\">").append("<![CDATA[" + getReqDecimal(mAmtBC,3 ) + "]]>").append("</amount__bc>"); valueXmlString.append("<amount__bc protect = \"1\">").append("<![CDATA[" + getReqDecimal(mAmtBC,3 ) + "]]>").append("</amount__bc>");
/*refNo=checkNullAndTrim(genericUtility.getColumnValue("ref_no", dom));
refSer = checkNull(genericUtility.getColumnValue("ref_ser",dom));
sql = "select exch_rate from misc_payables where ref_no = ? and tran_ser = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refNo);
pstmt.setString(2,refSer);
rs = pstmt.executeQuery();
if(rs.next())
{
exchRatePay=rs.getDouble("exch_rate");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;*/
diffAmtExch = loanAmtBC - mAmtBC ; diffAmtExch = loanAmtBC - mAmtBC ;
valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
...@@ -837,14 +829,17 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -837,14 +829,17 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
} }
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn)); while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
System.out.println("IN DETAILS column name is %%%%%%%%%%%%%[" + currentColumn + "] ==> '" + columnValue + "'"); System.out.println("IN DETAILS column name is %%%%%%%%%%%%%[" + currentColumn + "] ==> '" + columnValue + "'");
/*if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) if (currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
Node currDetailF=null; Node currDetailF=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1"); Node currDetailF2=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1");
currDetailF = detailList1.item(0); currDetailF = detailList1.item(0);
NodeList detailList2 = dom.getElementsByTagName("Detail3");
currDetailF2 = detailList2.item(0);
loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF)); loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",dom)); diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",currDetailF2));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",dom)); mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",currDetailF2));
diffAmtExch = loanAmtBC - mAmtBC ; diffAmtExch = loanAmtBC - mAmtBC ;
System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'"); System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'");
...@@ -853,7 +848,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -853,7 +848,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
} }
} }
else*/ else
if(currentColumn.trim().equalsIgnoreCase("ref_no")) if(currentColumn.trim().equalsIgnoreCase("ref_no"))
{ {
...@@ -925,13 +920,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -925,13 +920,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrc = reStrc.substring(0, posc); reStrc = reStrc.substring(0, posc);
valueXmlString.append(reStrc); valueXmlString.append(reStrc);
/*String reStrA = itemChanged(dom, dom1, dom2, objContext, "margin_amount", editFlag, xtraParams);
int posA = reStrA.indexOf("<Detail3>");
reStrA = reStrA.substring(posA + 9);
posA = reStrA.indexOf("</Detail3>");
reStrA = reStrA.substring(0, posA);
valueXmlString.append(reStrA);*/
valueXmlString.append("<bill_no>").append("<![CDATA["+billNo+"]]>").append("</bill_no>"); valueXmlString.append("<bill_no>").append("<![CDATA["+billNo+"]]>").append("</bill_no>");
if( billdate != null) if( billdate != null)
{ {
...@@ -953,7 +941,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -953,7 +941,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrS = reStrS.substring(0, posS); reStrS = reStrS.substring(0, posS);
valueXmlString.append(reStrS); valueXmlString.append(reStrS);
valueXmlString.append("<exch_rate>").append("<![CDATA["+exchRate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , exchRate.toString());
} }
} }
else if(currentColumn.trim().equalsIgnoreCase("acct_code")) else if(currentColumn.trim().equalsIgnoreCase("acct_code"))
...@@ -1029,10 +1018,18 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -1029,10 +1018,18 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF); tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF);
siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF); siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF);
currCode =genericUtility.getColumnValue("curr_code", dom); currCode =genericUtility.getColumnValue("curr_code", dom);
mexrate = checkDoubleNull(genericUtility.getColumnValue("exch_rate",dom));
if (mexrate ==0 )
{
mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn); mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn);
valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>"); valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , mexrate.toString()); setNodeValue(dom,"exch_rate" , mexrate.toString());
}
else
{
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams); String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams);
int pos = reStr.indexOf("<Detail3>"); int pos = reStr.indexOf("<Detail3>");
reStr = reStr.substring(pos + 9); reStr = reStr.substring(pos + 9);
...@@ -1054,25 +1051,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote ...@@ -1054,25 +1051,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
mAmtBC = amount * mexrate; mAmtBC = amount * mexrate;
valueXmlString.append("<amount__bc protect = \"1\">").append("<![CDATA[" + getReqDecimal(mAmtBC,3 )+ "]]>").append("</amount__bc>"); valueXmlString.append("<amount__bc protect = \"1\">").append("<![CDATA[" + getReqDecimal(mAmtBC,3 )+ "]]>").append("</amount__bc>");
/*refNo=checkNullAndTrim(genericUtility.getColumnValue("ref_no", dom));
refSer = checkNull(genericUtility.getColumnValue("ref_ser",dom));
sql = "select exch_rate from misc_payables where ref_no = ? and tran_ser = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, refNo);
pstmt.setString(2,refSer);
rs = pstmt.executeQuery();
if(rs.next())
{
exchRatePay=rs.getDouble("exch_rate");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
*/
/*diffAmtExch = (amount * exchRatePay) - (amount * mexrate);*/
diffAmtExch = loanAmtBC - mAmtBC ; diffAmtExch = loanAmtBC - mAmtBC ;
valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>"); valueXmlString.append("<diff_amt__exch protect = \"1\">").append("<![CDATA[" + getReqDecimal(diffAmtExch, 3) + "]]>").append("</diff_amt__exch>");
......
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