Commit ac189189 authored by smanohar's avatar smanohar

Exchange rate difference in case of bill discounting corrected

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213094 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5061e471
......@@ -4286,7 +4286,9 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
{
bdFluctuationCf = "N";
}
if ((billDisc.equals("Y")) && (bdFluctuationCf.equals("Y")))
// 04-dec-2019 manoharan always calculate exchange rate difference based on bill discounting
//if ((billDisc.equals("Y")) && (bdFluctuationCf.equals("Y")))
if (("Y".equals(billDisc) && hCurrCode.trim().equals(currCode.trim())))
{
valueXmlString.append("<exch_rate>").append("<![CDATA[" + discExchRate + "]]>").append("</exch_rate>"); // change by ritesh on 25/05/13 as per discussion with pravin
//diffAmtExch = (rcpAmt * exchRate - rcpAmt * discExchRate)-((Double.parseDouble(lcBillDescAmt) * exchRate) - (Double.parseDouble(lcBillDescAmt) * discExchRate));
......@@ -4442,6 +4444,7 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
if (rs.next())
{
exchRate = rs.getDouble(1);
discExchRate = rs.getDouble(1);
}
rs.close();
rs = null;
......@@ -4459,11 +4462,22 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
bdFluctuationCf = finCommon.getFinparams("999999", "BD_FLUCTUATION_CF" ,conn);
if (("").equals(bdFluctuationCf) || bdFluctuationCf == null)
{
bdFluctuationCf = "Y";
bdFluctuationCf = "N";
}
if (("Y".equals(billDisc)) && ("Y".equals(bdFluctuationCf)))
// 04-dec-2019 manoharan same logic as ref_no
currCode = genericUtility.getColumnValue("curr_code", dom);
exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom));
hCurrCode = genericUtility.getColumnValue("curr_code", dom1);
lcBillDescAmt = genericUtility.getColumnValue("bill_disc_amt", dom);
if ( hCurrCode.trim().equals(currCode.trim()) )
{
diffAmtExch = rcpAmt * exchRate - rcpAmt * exchRate;
hexchRate = doublevalue(genericUtility.getColumnValue("exch_rate", dom1));
}
//if (("Y".equals(billDisc)) && ("Y".equals(bdFluctuationCf)))
if (("Y".equals(billDisc) && hCurrCode.trim().equals(currCode.trim())))
{
//diffAmtExch = rcpAmt * exchRate - rcpAmt * exchRate;
diffAmtExch = (rcpAmt * exchRate - rcpAmt * discExchRate)+((Double.parseDouble(lcBillDescAmt)-rcpAmt)*(exchRate-discExchRate));
valueXmlString.append("<diff_amt__exch>").append("<![CDATA[" + diffAmtExch + "]]>").append("</diff_amt__exch>");
}
else
......@@ -4471,8 +4485,6 @@ public class ReceiptAdv extends ValidatorEJB implements ReceiptAdvLocal, Receipt
siteCode = genericUtility.getColumnValue("site_code", dom1);
currCode = genericUtility.getColumnValue("curr_code", dom);
exchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate__rcv", dom));
hexchRate = Double.parseDouble(genericUtility.getColumnValue("exch_rate", dom)); //finCommon.getDailyExchRateSellBuy(currCode,"",siteCode, genericUtility.getColumnValue("tran_date", dom1), "S", conn);
// System.out.println("rcp_amt change calculating diff_amt__exch rcpAmt [" + rcpAmt + "] exchRate[" + exchRate + "] hexchRate ["+ hexchRate+ "]" );
diffAmtExch = (rcpAmt * exchRate) - (rcpAmt * hexchRate);
//valueXmlString.append("<diff_amt__exch>").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