Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0008242Openbravo ERPA. Platformpublic2009-03-17 19:042009-05-28 19:01
shuehner 
shuehner 
normalmajorhave not tried
closedfixed 
5
2.40 
2.40MP4 
Core
No
0008242: Calculations done by XmlEngine (i.e. sum) are done using double. which leads to calculation errors.
XmlEngine can do some calculations when rendering i.e. a report. Example total sum of some values shown in the rows.

This calculations are done using double which leads to errors. Depending on the output-formatting these errors are sometimes 'hidden' as the rounded value is by accident the correct value.
- Use the Payment Aging Balance report as example [1].
- Enter data to be shown in the report to either only show ten lines of Value '0.1' in some column or to include ten extra lines of value '0.1'. One way of entering data for this is to follow the description in the page ag [2]
- edit the config/Format.xml to change autoInform formatting to the following '#,##0.####################'
- See that the total value shown in the report is incorrect.


[1] Financial Management || Receivables & Payables || Analysis Tools || Payment Aging Balance || Payment Aging Balance
[2] http://wiki.openbravo.com/wiki/Talk:Demo_Script/Op01_Pending_receivables_by_date_ranges [^]
Change XmlEngine internal representation from double -> BigDecimal
No tags attached.
blocks defect 0008177 closed shuehner Calculations done by XmlEngine (i.e. sum) are done using double. which leads to calculation errors. 
Issue History
2009-03-23 19:30shuehnerTypedefect => backport
2009-03-23 19:30shuehnerfix_in_branch => 2.40
2009-03-24 12:38hgbotCheckin
2009-03-24 12:38hgbotNote Added: 0014893
2009-03-24 12:38hgbotStatusscheduled => resolved
2009-03-24 12:38hgbotResolutionopen => fixed
2009-03-24 12:38hgbotFixed in SCM revision => http://code.openbravo.com/erp/stable/2.40/rev/f508619622ad1705bfa651d8cc729b77661e9366 [^]
2009-05-10 19:37psarobeFixed in Version => 2.40MP4
2009-05-28 19:01psarobeStatusresolved => closed

Notes
(0014893)
hgbot   
2009-03-24 12:38   
Repository: erp/stable/2.40
Changeset: f508619622ad1705bfa651d8cc729b77661e9366
Author: Stefan Hühner <stefan.huehner <at> openbravo.com>
Date: Tue Mar 24 12:38:24 2009 +0100
URL: http://code.openbravo.com/erp/stable/2.40/rev/f508619622ad1705bfa651d8cc729b77661e9366 [^]

Fixed 8242: change xmlEngine calculations from using double -> BigDecimal

---
M src-core/src/org/openbravo/xmlEngine/FunctionAddValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionDivideValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionEqualValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionGtValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionLtValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionMaxValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionMedValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionMinValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionModuleValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionMultiplyValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionSubtractValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionSumValue.java
M src-core/src/org/openbravo/xmlEngine/FunctionTemplate.java
---