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
......@@ -144,6 +144,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
}
else if(currentColumn.trim().equalsIgnoreCase("loan_party"))
{
loanParty = genericUtility.getColumnValue("loan_party", dom);
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
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.setString(1, bankCode);
rs = pstmt.executeQuery();
if (rs.next())
{
......@@ -472,14 +471,17 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
}
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
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 currDetailF2=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1");
currDetailF = detailList1.item(0);
NodeList detailList2 = dom.getElementsByTagName("Detail2");
currDetailF2 = detailList2.item(0);
loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",dom));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",dom));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",currDetailF2));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",currDetailF2));
diffAmtExch = loanAmtBC - mAmtBC ;
System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'");
......@@ -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>");
}
}
else*/
if(currentColumn.trim().equalsIgnoreCase("ref_no"))
else if(currentColumn.trim().equalsIgnoreCase("ref_no"))
{
......@@ -612,7 +613,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrcur = reStrcur.substring(0, poscur);
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
tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF);
siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF);
currCode =genericUtility.getColumnValue("curr_code", dom);
mexrate = checkDoubleNull(genericUtility.getColumnValue("exch_rate",dom));
if (mexrate ==0 )
{
mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn);
valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
else
{
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams);
int pos = reStr.indexOf("<Detail2>");
reStr = reStr.substring(pos + 9);
......@@ -782,24 +792,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
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 ;
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
}
while(ctr < childNodeListLength && !childNodeName.equals(currentColumn));
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 currDetailF2=null;
NodeList detailList1 = dom2.getElementsByTagName("Detail1");
currDetailF = detailList1.item(0);
NodeList detailList2 = dom.getElementsByTagName("Detail3");
currDetailF2 = detailList2.item(0);
loanAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("loan_amt__bc",currDetailF));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",dom));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",dom));
diffAmtExchEX = checkDoubleNull(genericUtility.getColumnValueFromNode("diff_amt__exch",currDetailF2));
mAmtBC = checkDoubleNull(genericUtility.getColumnValueFromNode("amount__bc",currDetailF2));
diffAmtExch = loanAmtBC - mAmtBC ;
System.out.println("diffAmtExch[" + diffAmtExch + "] ==>diffAmtExchEX '" + diffAmtExchEX + "'");
......@@ -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>");
}
}
else*/
else
if(currentColumn.trim().equalsIgnoreCase("ref_no"))
{
......@@ -925,13 +920,6 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrc = reStrc.substring(0, posc);
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>");
if( billdate != null)
{
......@@ -953,7 +941,8 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
reStrS = reStrS.substring(0, posS);
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"))
......@@ -1029,10 +1018,18 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
tranDate = genericUtility.getColumnValueFromNode("tran_date",currDetailF);
siteCode = genericUtility.getColumnValueFromNode("site_code",currDetailF);
currCode =genericUtility.getColumnValue("curr_code", dom);
mexrate = checkDoubleNull(genericUtility.getColumnValue("exch_rate",dom));
if (mexrate ==0 )
{
mexrate = finCommon.getDailyExchRateSellBuy(currCode, "", siteCode, tranDate, "B", conn);
valueXmlString.append("<exch_rate>").append("<![CDATA["+mexrate+"]]>").append("</exch_rate>");
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
else
{
setNodeValue(dom,"exch_rate" , mexrate.toString());
}
String reStr = itemChanged(dom, dom1, dom2, objContext, "exch_rate", editFlag, xtraParams);
int pos = reStr.indexOf("<Detail3>");
reStr = reStr.substring(pos + 9);
......@@ -1054,25 +1051,7 @@ public class LoanIC extends ValidatorEJB implements LoanICLocal, LoanICRemote
mAmtBC = amount * mexrate;
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 ;
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