Commit 6d9c75e1 authored by smanohar's avatar smanohar

In gltrace update while checking both dr_amt and cr_amt are 0 because of...

In gltrace update while checking both dr_amt and cr_amt are 0 because of floating point there may be non-zero digits beyond 3rd decimal place so the comparison fails some time and 0 dr_amt, cr_amt rows are inserted in gltrace, to avoid that converted to BigDecimal and compared after rounding to 3 decimals

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@213716 ce508802-f39f-4f6c-b175-0d175dae99d5
parent d9937aff
......@@ -8225,6 +8225,9 @@ public class FinCommon {
String tableName = "";
String refSerTemp = "";
String budgetTrack = "N"; // 11-Nov-2019 manoharan budget update call based on this flag
BigDecimal drAmtB = new BigDecimal(0); //19-dec-2019 manoharan
BigDecimal crAmtB = new BigDecimal(0); // 19-dec-2019 manoharan to avoid floting point issue of non-zero value
try {
System.out.println("Inside Try Catch..." + glTrace.toString());
// genericUtility = new GenericUtility();
......@@ -8301,10 +8304,18 @@ public class FinCommon {
crAmt = Double.parseDouble(glTrace.get("cr_amt").toString());
System.out.println("CR amount>>>>" + crAmt + "DR AMOUNT>>>>>>" + drAmt);
System.out.println("eXCH RATE>>>>" + exchRate);
if (drAmt == 0 && crAmt == 0) {
// 19-dec-2019 manoharan to avoid floating point issue
//if (drAmt == 0 && crAmt == 0) {
// return "";
//}
drAmtB = BigDecimal.valueOf(drAmt);
crAmtB = BigDecimal.valueOf(crAmt);
drAmtB = rounded(drAmtB, 3);
crAmtB = rounded(crAmtB, 3);
if (drAmtB.compareTo(BigDecimal.valueOf(0.000)) == 0 && crAmtB.compareTo(BigDecimal.valueOf(0.000)) == 0) {
return "";
}
// end 19-dec-2019 manoharan to avoid floating point issue
if (exchRate == 0) {
errString = itmDBAccessEJB.getErrorString("", "VTEXRAT1", "", "", conn);
......
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