details:   https://code.openbravo.com/erp/devel/pi/rev/5f12b1476761
changeset: 20118:5f12b1476761
user:      Sandra Huguet <sandra.huguet <at> openbravo.com>
date:      Fri Apr 12 09:49:05 2013 +0200
summary:   Fixed bug 22853 Error in Create APExpenseProcess when price 
precision is 4

details:   https://code.openbravo.com/erp/devel/pi/rev/5c4354047500
changeset: 20119:5c4354047500
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Tue Apr 16 13:03:50 2013 +0530
summary:   Related to Issue 22853: Error in Create AP Expense process when 
price precision is 4

diffstat:

 src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r 3a62b04f9803 -r 5c4354047500 
src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java
--- a/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java      Tue Apr 
16 12:19:03 2013 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java      Tue Apr 
16 13:03:50 2013 +0530
@@ -336,12 +336,13 @@
           }
           // Catch database error message
           try {
+            int stdPrecision = Integer.parseInt(strStdPrecision);
             ExpenseAPInvoiceData.insertLine(conn, this, data[i].adClientId, 
data[i].adOrgId,
                 strcInvoiceId, "", String.valueOf(line), "", 
data[i].mProductId, "",
                 data[i].description, "", strmProductUomId, 
String.valueOf(qty), data[i].cUomId,
-                strPricestd, strPricelist, strcTaxID,
-                (new BigDecimal(strPricestd).multiply(qty)).toPlainString(), 
"", strPricestd,
-                strPricelimit, "", "", "", "Y", "0", "", "", 
strcInvoiceLineId, "N",
+                strPricestd, strPricelist, strcTaxID, ((new 
BigDecimal(strPricestd).setScale(
+                    stdPrecision, 
BigDecimal.ROUND_HALF_UP)).multiply(qty)).toPlainString(), "",
+                strPricestd, strPricelimit, "", "", "", "Y", "0", "", "", 
strcInvoiceLineId, "N",
                 vars.getUser(), vars.getUser(), isDeferred, planType, 
periodNumber,
                 startingPeriodId, data[i].cProjectId, data[i].cCostcenterId, 
data[i].aAssetId,
                 data[i].user1Id, data[i].user2Id);

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to