Commit 23ec8e29 authored by smanohar's avatar smanohar

exch_rate protected in case of base currency

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@190629 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9b7bc41b
......@@ -2530,7 +2530,7 @@ conn = getConnection();
String finEntity = "";
String acctPrd = "";
String lsAdvbking = "";
String CurrCode = "";
String currCodeBase = "";
String finentDescr = "";
String bankCode = "";
String cashCode = "";
......@@ -3043,11 +3043,38 @@ conn = getConnection();
cctrCodeAdv = rs.getString(8);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// 11-sep-2018 manoharan code added to protect exch_rate
sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
if (rs.next())
{
finEntity = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
sql = "select curr_code from finent where fin_entity = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, finEntity);
rs = pstmt.executeQuery();
if (rs.next())
{
currCodeBase = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
// end 11-sep-2018 manoharan
valueXmlString.append("<cust_name>").append("<![CDATA[" + custName + "]]>").append("</cust_name>");
valueXmlString.append("<acct_code__ar>").append("<![CDATA[" + acctCodeAr + "]]>").append("</acct_code__ar>");
......@@ -3060,12 +3087,26 @@ conn = getConnection();
tranDate = dateFormat1.parse(genericUtility.getColumnValue("tran_date", dom));
// 21/09/13 manoharan caqll common function
//mexchrate = takeExchRate(currCode, "", siteCode, tranDate, "S", conn);
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
// 11-sep-2018 manoharan commented and in case of customer currency is different then called
//mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
tranIdAdvbking = genericUtility.getColumnValue("tran_id__advbking", dom);
// 11-sep-2018 manoharan protect exch_rate in case of base currency
if (currCode.trim().equals(currCodeBase.trim()))
{
valueXmlString.append("<exch_rate protect = \"1\">").append("<![CDATA[1]]>").append("</exch_rate>");
}
else
{
mexchrate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom), "S", conn);
valueXmlString.append("<exch_rate protect = \"0\">").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
}
// end 11-sep-2018 manoharan protect exch_rate in case of base currency
if ((tranIdAdvbking == null) || (tranIdAdvbking.length() == 0))
{
valueXmlString.append("<exch_rate >").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
valueXmlString.append("<exch_rate_spot >").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate_spot>");
//valueXmlString.append("<exch_rate >").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
valueXmlString.append("<exch_rate_spot protect = \"0\">").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate_spot>");
//valueXmlString.append("<exch_rate protect = \"1\">").append("<![CDATA["+ mexchrate +"]]>").append("</exch_rate>");
}
else
......@@ -3078,7 +3119,7 @@ conn = getConnection();
setNodeValue(dom, "site_code", getAbsString(siteCode));
}
sql = "select fin_entity from site where site_code = ?";
/*sql = "select fin_entity from site where site_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
rs = pstmt.executeQuery();
......@@ -3091,7 +3132,8 @@ conn = getConnection();
rs = null;
pstmt.close();
pstmt = null;
*/
advAmt = Double.parseDouble(genericUtility.getColumnValue("adv_amt", dom));
if (advAmt == 0.0D)
{
......@@ -3156,7 +3198,7 @@ conn = getConnection();
rs = pstmt.executeQuery();
if (rs.next())
{
CurrCode = rs.getString(1);
currCodeBase = rs.getString(1);
}
rs.close();
rs = null;
......@@ -3164,7 +3206,7 @@ conn = getConnection();
pstmt = null;
if (currCode.trim().equals(CurrCode.trim()))
if (currCode.trim().equals(currCodeBase.trim()))
{
valueXmlString.append("<exch_rate protect = \"1\">").append("<![CDATA[" + mexchrate + "]]>").append("</exch_rate>");
}
......
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