Notes |
|
(0095055)
|
hgbot
|
2017-03-15 16:39
|
|
Repository: erp/devel/pi
Changeset: 8281d757d8ba02c6a948f36b6ec358948cfbdb1c
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Mar 15 14:36:31 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/8281d757d8ba02c6a948f36b6ec358948cfbdb1c [^]
Fixes issue 35486: Net Amount not properly rounded in ERP with PostgreSQL
Problem was in following calculation: Net Amount = Gross Amount * (Gross Amount / (Gross Amount + Tax Amount)).
In case Gross Amount = 357.99 and Tax Amount = 71.598, Net Amount = 357.99 * (357.99 / (357.99 + 71.598)) = 298.325.
It was correct in Oracle as it retrieves 298.325 but it was failing in PostgreSQL as it retrieves 298.3249999999999999988067:
SELECT 357.99 * (357.99 / (357.99 + 71.598)) FROM dual;
If we do multiplication before division, we avoid this problem and both PostgreSQL and Oracle retrieves the correct result (298.325):
SELECT (357.99 * 357.99) / (357.99 + 71.598) FROM dual;
---
M src-db/database/model/functions/C_GET_NET_AMOUNT_FROM_GROSS.xml
M src-db/database/model/functions/C_GET_NET_PRICE_FROM_GROSS.xml
---
|
|
|
(0095056)
|
hgbot
|
2017-03-15 16:39
|
|
Repository: erp/devel/pi
Changeset: bb77b1e335cbcf1c3d208b706f830fb41cfec3d2
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Mar 15 14:54:07 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bb77b1e335cbcf1c3d208b706f830fb41cfec3d2 [^]
Related to issue 35486: Add some automated tests
---
M src-test/src/org/openbravo/test/taxes/TaxesTest.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData161.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData162.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData163.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData164.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData165.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData166.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData167.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData168.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData169.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData170.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData171.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData172.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData173.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData174.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData175.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData176.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData177.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData178.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData179.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData180.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData181.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData182.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData183.java
A src-test/src/org/openbravo/test/taxes/data/TaxesTestData184.java
---
|
|
|
|
|
|
|
|
|
|
|