Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035486
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementmajorhave not tried2017-03-10 15:372017-03-20 15:18
ReporteradrianromeroView Statuspublic 
Assigned Toaferraz 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q2
StatusclosedFix in branchFixed in SCM revision8281d757d8ba
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035486: [SER-QA 2587] Taxes at document level are rounded in a different way in WebPOS and Backend

DescriptionWith a tax rate calculated at document level of 20% and a total order of 357.99, The problem it is a difference in rounding between ERP and POS when calculating the total net.

POS rounds 298,325 to 298.33. Round half up?
ERP rounds 298.325 to 298.32. Round half down? Round half to even?

It has to be determined what is the right rounding calculation.
Steps To ReproduceIn description. See attached images.
TagsSER-QA
Attached Filespng file icon Captura de pantalla de 2017-03-10 15:39:14.png [^] (165,873 bytes) 2017-03-10 15:40


png file icon Captura de pantalla de 2017-03-10 15:38:58.png [^] (144,352 bytes) 2017-03-10 15:41

- Relationships Relation Graph ] Dependency Graph ]
related to design defect 0032265 closedaferraz [SER QA 1434] Taxes at document level are not properly calculated in some cases 

-  Notes
(0095055)
hgbot (developer)
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 (developer)
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
---
(0095334)
hudsonbot (developer)
2017-03-16 16:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/41ab6f71c85b [^]
Maturity status: Test
(0095335)
hudsonbot (developer)
2017-03-16 16:34

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/41ab6f71c85b [^]
Maturity status: Test
(0095430)
vmromanos (manager)
2017-03-20 15:18

Code review + testing OK

- Issue History
Date Modified Username Field Change
2017-03-10 15:37 adrianromero New Issue
2017-03-10 15:37 adrianromero Assigned To => Retail
2017-03-10 15:37 adrianromero Resolution time => 1490310000
2017-03-10 15:37 adrianromero Triggers an Emergency Pack => No
2017-03-10 15:40 adrianromero Tag Attached: SER-QA
2017-03-10 15:40 adrianromero File Added: Captura de pantalla de 2017-03-10 15:39:14.png
2017-03-10 15:41 adrianromero File Added: Captura de pantalla de 2017-03-10 15:38:58.png
2017-03-10 15:41 adrianromero Steps to Reproduce Updated View Revisions
2017-03-10 15:42 adrianromero Relationship added related to 0032265
2017-03-10 15:51 adrianromero Description Updated View Revisions
2017-03-13 10:17 aferraz Assigned To Retail => aferraz
2017-03-13 11:06 aferraz Project Retail Modules => Openbravo ERP
2017-03-13 11:06 aferraz Modules => Core
2017-03-13 11:06 aferraz Category Web POS => 09. Financial management
2017-03-13 16:12 vmromanos Status new => scheduled
2017-03-15 16:39 hgbot Checkin
2017-03-15 16:39 hgbot Note Added: 0095055
2017-03-15 16:39 hgbot Status scheduled => resolved
2017-03-15 16:39 hgbot Resolution open => fixed
2017-03-15 16:39 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8281d757d8ba02c6a948f36b6ec358948cfbdb1c [^]
2017-03-15 16:39 hgbot Checkin
2017-03-15 16:39 hgbot Note Added: 0095056
2017-03-16 16:34 hudsonbot Checkin
2017-03-16 16:34 hudsonbot Note Added: 0095334
2017-03-16 16:34 hudsonbot Checkin
2017-03-16 16:34 hudsonbot Note Added: 0095335
2017-03-20 15:18 vmromanos Review Assigned To => vmromanos
2017-03-20 15:18 vmromanos Note Added: 0095430
2017-03-20 15:18 vmromanos Status resolved => closed
2017-03-20 15:18 vmromanos Fixed in Version => 3.0PR17Q2


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker