Commit 586a7640 authored by manohar's avatar manohar

in case header and receivables curr_code same the exch_rate in detail set as...

in case header and receivables curr_code same the exch_rate in detail set as hearer exch_rate and made non editable


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95543 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2b388daa
......@@ -2439,7 +2439,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt = null;
String hCurrCode = "";
ResultSet rs = null;
GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver();
......@@ -3145,9 +3145,19 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
pstmt = null;
}
// 21/09/13 manoharan to get the exchange rate for detail currency
//hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
// 03/07/14 manoharan in case receivables.curr_code = header curr_code use the same exch_rate in header
// else get the exch_rate from master
siteCode = genericUtility.getColumnValue("site_code", dom1);
hexchRate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
hCurrCode = genericUtility.getColumnValue("curr_code", dom1);
if ( hCurrCode.trim().equals(currCode.trim()) )
{
hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
}
else
{
hexchRate = finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
}
sql = "select descr from currency where currency.curr_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, currCode);
......@@ -3161,8 +3171,6 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
rs = null;
pstmt.close();
pstmt = null;
sql = "select descr from accounts where accounts.acct_code = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, acctCode);
......@@ -3229,7 +3237,14 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
valueXmlString.append("<ref_date/>");
}
valueXmlString.append("<exch_rate>").append("<![CDATA[" + hexchRate + "]]>").append("</exch_rate>");
if ( hCurrCode.trim().equals(currCode.trim()) )
{
valueXmlString.append("<exch_rate protect = \"1\">").append("<![CDATA[" + hexchRate + "]]>").append("</exch_rate>");
}
else
{
valueXmlString.append("<exch_rate protect = \"0\">").append("<![CDATA[" + hexchRate + "]]>").append("</exch_rate>");
}
valueXmlString.append("<exch_rate__rcv>").append("<![CDATA[" + exchRate + "]]>").append("</exch_rate__rcv>");
if (dueDate != null )
{
......
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