Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036693Openbravo ERP01. General setuppublic2017-08-22 13:582018-01-08 18:18
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q1 
dmiguelez
Core
No
0036693: In Currency window, Standard precision can be higher than the currency's real precision (commonly 2)
In Currency window, Standard precision can be higher than the currency's real precision (commonly 2).

The Standard Precision is used to round all the amounts (not prices) of the documents created in the backend. As the majority of currencies do not allow to pay an amount lower than 0.01, a warning could be shown when the standard precision is defined with a value higher than 2
As System Admin role:
   Go to EUR currency and check you can save the record with the following values and it is not correct:
      Standard Precision: 6
No tags attached.
related to feature request 0023532 new dmiguelez Openbravo ERP It would be fine if line amounts could have different precision than totals 
related to design defect 0036694 closed jorge-garcia Retail Modules In Currency window, POS precision can be higher than the currency's real precision (commonly 2) 
related to defect 0042929 closed AtulOpenbravo Openbravo ERP Wrong warning shown when trying to change the standard precision of a currency to a value higher than 2 
Issue History
2017-08-22 13:58ngarciaNew Issue
2017-08-22 13:58ngarciaAssigned To => Triage Finance
2017-08-22 13:58ngarciaModules => Core
2017-08-22 13:58ngarciaTriggers an Emergency Pack => No
2017-08-22 13:59ngarciaIssue Monitored: networkb
2017-08-22 14:00ngarciaTypedefect => design defect
2017-08-22 14:03ngarciaRelationship addedrelated to 0036694
2017-08-22 14:03ngarciaRelationship addedrelated to 0023532
2017-08-22 14:04ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=15671#r15671
2017-09-06 13:46ngarciaNote Added: 0098862
2017-10-05 16:15markmm82Assigned ToTriage Finance => markmm82
2017-10-05 16:17markmm82Statusnew => scheduled
2017-10-06 17:28markmm82Note Added: 0099812
2017-10-11 18:12hgbotCheckin
2017-10-11 18:12hgbotNote Added: 0099869
2017-10-11 18:12hgbotStatusscheduled => resolved
2017-10-11 18:12hgbotResolutionopen => fixed
2017-10-11 18:12hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/40e58d4f3e61f3097cdad501314fbb82b8421c4b [^]
2017-10-11 18:12hgbotCheckin
2017-10-11 18:12hgbotNote Added: 0099870
2017-10-11 18:13dmiguelezReview Assigned To => dmiguelez
2017-10-11 18:13dmiguelezNote Added: 0099871
2017-10-11 18:13dmiguelezStatusresolved => closed
2017-11-09 13:52hgbotCheckin
2017-11-09 13:52hgbotNote Added: 0100386
2017-11-13 09:35hgbotCheckin
2017-11-13 09:35hgbotNote Added: 0100472
2017-11-17 08:34hgbotCheckin
2017-11-17 08:34hgbotNote Added: 0100562
2017-11-20 17:08hgbotCheckin
2017-11-20 17:08hgbotNote Added: 0100628
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101326
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101327
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101395
2018-01-03 12:38hudsonbotCheckin
2018-01-03 12:38hudsonbotNote Added: 0101415
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101430
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101443
2018-01-08 18:18dmiguelezFixed in Version => 3.0PR18Q1
2020-01-17 12:54ngarciaRelationship addedrelated to 0042929

Notes
(0098862)
ngarcia   
2017-09-06 13:46   
Currency codes - ISO 4217:

https://www.iso.org/iso-4217-currency-codes.html [^] [^]
(0099812)
markmm82   
2017-10-06 17:28   
Test Plan:
  Notice the currency precision defined for:
    EUR => 2
    XOF => 0
    CLF => 4
    XBA => N.A. (Bond Markets Unit European Composite Unit (EURCO))
  In https://www.currency-iso.org/dam/downloads/lists/list_one.xml [^]

As System Admin role:
   Go to EUR currency and change Standard Precision to 6.
   Notice a warning message is shown:
     Warning
     The current standard precision: 6 is higher than currency precision defined on ISO 4217 specification: 2 for: EUR currency.

   Go to EUR currency and change Standard Precision to -3.
   Notice an error message is shown, and the standard precision is set as default 2:
     Error
     Standard precision must be greater than zero.

   Go to XOF currency and change Standard Precision to 2.
   Notice a warning message is shown:
     Warning
     The current standard precision: 2 is higher than currency precision defined on ISO 4217 specification: 0 for: XOF currency.

   Check that CLF currency doesn't exists in our current currency list in AD.
   We will going to create it:
     ISO Code = CLF
     Description = Unidad de Fomento - CHILE
     Standard Precision = 5
   Notice a warning message is shown:
     Warning
     The current standard precision: 5 is higher than currency precision defined on ISO 4217 specification: 4 for: CLF currency.

   Check that XBA currency doesn't exists in our current currency list in AD.
   We will going to create it:
     ISO Code = XBA
     Description = Bond Markets Unit European Composite Unit (EURCO)
     Standard Precision = 3
   Notice a warning message is shown:
     Warning
     The current standard precision: 3 is higher than currency precision defined on ISO 4217 specification: 2 for: XBA currency
   Check althoug the XBA currency doesn't has assigned any precision inside the ISO specification, it is using the default precision to validate the standard precion entered: 2.

   Besides the warning message when the precision entered is higher than specification, it is possible to save the record.
(0099869)
hgbot   
2017-10-11 18:12   
Repository: erp/devel/pi
Changeset: 40e58d4f3e61f3097cdad501314fbb82b8421c4b
Author: Mark <markmm82 <at> gmail.com>
Date: Fri Oct 06 10:25:41 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/40e58d4f3e61f3097cdad501314fbb82b8421c4b [^]

Fixes issue 36693:Std precision can be higher than the currency's real precision

In Currency window, Standard precision can be higher than the currency's real
precision (commonly 2). The Standard Precision is used to round all the amounts
(not prices) of the documents created in the backend.

Was created a new callout used to validate the currency standard precision. If
the new precision is higher than specified currency precision in ISO 4217 Currency
codes, then a warning is showed to user.

Also, if the new precision is negative then an error message is shown and it is
set as the default standard precision: 2.

---
M src-db/database/sourcedata/AD_CALLOUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
A src/org/openbravo/erpCommon/ad_callouts/ISO_4217.xml
A src/org/openbravo/erpCommon/ad_callouts/SL_Currency_StdPrecision.java
---
(0099870)
hgbot   
2017-10-11 18:12   
Repository: erp/devel/pi
Changeset: 2d768f24220e00d1fe01b2fc05fc0fa8dbf6ef30
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Wed Oct 11 11:12:21 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/2d768f24220e00d1fe01b2fc05fc0fa8dbf6ef30 [^]

Related to Issue 36693. Code Review Changes:

* Improved error message when standard precission is a negative number
* Improved some Java Doc
* Removed some unnecessary Java Doc
* Reordering tags in definition of constants to compile with standards
* Rearranged Code to improve redability
* Added log.error when file has not been found

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Currency_StdPrecision.java
---
(0099871)
dmiguelez   
2017-10-11 18:13   
Code Review + Testing Ok
(0100386)
hgbot   
2017-11-09 13:52   
Repository: erp/devel/pi
Changeset: 1aeebc4d61e03697fc62adb9f74fe04e0a435b80
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Nov 09 13:52:00 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/1aeebc4d61e03697fc62adb9f74fe04e0a435b80 [^]

Related to Issue 36693.

Added Licensing info for new XML file.

---
M legal/Licensing.txt
---
(0100472)
hgbot   
2017-11-13 09:35   
Repository: erp/devel/pi
Changeset: ec4d8877501f88708797aa7896a37b2c9d673443
Author: Mark <markmm82 <at> gmail.com>
Date: Fri Oct 13 10:33:11 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/ec4d8877501f88708797aa7896a37b2c9d673443 [^]

Related to issue 36693: Code review improvements.

Removed AD_MODEL_OBJECT_MAPPING as not required for SimpleCallout.
Renamed getPrecissionForCurrencyFromList method to getPrecisionForCurrencyFromList
Renamed isSameCurrencyAsParameterAndIsPrecissionDefined to isSameCurrencyAsParameterAndIsPrecisionDefined
To fix in both cases typo in "Precision" word.

---
M src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Currency_StdPrecision.java
---
(0100562)
hgbot   
2017-11-17 08:34   
Repository: erp/devel/pi
Changeset: 6488f29c70a0831c3e9e3052b2b86a778f78e154
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Wed Nov 15 13:37:59 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/6488f29c70a0831c3e9e3052b2b86a778f78e154 [^]

Related to issue 36694. Related to issue 36693

The code related to the ISO currency precision included in the callout has
been moved to a new class called ISOCurrencyPrecision. Now, the
method getCurrencyPrecisionInISO4217Spec is public.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Currency_StdPrecision.java
A src/org/openbravo/erpCommon/utility/ISOCurrencyPrecision.java
---
(0100628)
hgbot   
2017-11-20 17:08   
Repository: erp/devel/pi
Changeset: 72ca71e6b78a340ee3126792286f5bf970d7c673
Author: Jorge Garcia <jorge.garcia <at> openbravo.com>
Date: Mon Nov 20 12:01:56 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/72ca71e6b78a340ee3126792286f5bf970d7c673 [^]

Related to issue 36694. Related to issue 36693

 * Fix problem with log messages in the new API
 * Added copyright to ISOCurrencyPrecision
 * Added class Javadoc to ISOCurrencyPrecision
 * Use getResourceAsStream to read the xml file with the standard
   currency precisions.

---
M src/org/openbravo/erpCommon/utility/ISOCurrencyPrecision.java
---
(0101326)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101327)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101395)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101415)
hudsonbot   
2018-01-03 12:38   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101430)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0101443)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test