Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033900Openbravo ERPA. Platformpublic2016-09-05 17:232016-09-23 08:14
ngarcia 
caristu 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
alostale
Core
No
0033900: Wrong decimal default value if decimal and grouping separators are modified in Format.xml file
Wrong decimal default value if decimal and grouping separators are modified in Format.xml file.

The problem is in the createFromClassicString function of NumberUIDefinition java class
1. Modify in Format.xml the decimal and grouping separators:

http://wiki.openbravo.com/wiki/Projects/Allow_comma_separator/Technical_Documentation#Java_level [^]

2. Check through database the default value for Fin_Payment.Finacc_Txn_Convert_Rate column is 1.0

select defaultvalue
from ad_column
where ad_column_id = '4028C9BC2DA5C491012DA6832A1003A8'

3. As system admin role:
Deactivate the following callouts (in order the column value not to be modified):

SE_Payment_FinAccount
SE_Payment_MultiCurrency

4. As group admin role:
Create a new Payment Out
Check the Exchange Rate column has the value of 10 (you should show it in grid mode as it is not displayed)
No tags attached.
related to defect 0027698 acknowledged Triage Platform Base Wrong calculations on numeric field depending on the formula when using a comma as decimal separator 
related to defect 0028765 acknowledged Triage Platform Base It is not possible to use formula inputs if ',' is used as decimal separator 
Issue History
2016-09-05 17:23ngarciaNew Issue
2016-09-05 17:23ngarciaAssigned To => platform
2016-09-05 17:23ngarciaModules => Core
2016-09-05 17:23ngarciaResolution time => 1474840800
2016-09-05 17:23ngarciaTriggers an Emergency Pack => No
2016-09-05 17:24ngarciaIssue Monitored: networkb
2016-09-05 17:25ngarciaDescription Updatedbug_revision_view_page.php?rev_id=13054#r13054
2016-09-06 12:01caristuStatusnew => scheduled
2016-09-06 12:01caristuAssigned Toplatform => caristu
2016-09-07 09:24hgbotCheckin
2016-09-07 09:24hgbotNote Added: 0089796
2016-09-07 09:24hgbotStatusscheduled => resolved
2016-09-07 09:24hgbotResolutionopen => fixed
2016-09-07 09:24hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/89eaadd3bedae46e49b2a0acadcdde5563919769 [^]
2016-09-07 09:25caristuReview Assigned To => alostale
2016-09-07 09:25caristuIssue Monitored: alostale
2016-09-07 14:20hudsonbotCheckin
2016-09-07 14:20hudsonbotNote Added: 0089805
2016-09-09 09:28hgbotCheckin
2016-09-09 09:28hgbotNote Added: 0089863
2016-09-09 10:00alostaleNote Added: 0089864
2016-09-09 10:00alostaleStatusresolved => new
2016-09-09 10:00alostaleResolutionfixed => open
2016-09-09 14:40hudsonbotCheckin
2016-09-09 14:40hudsonbotNote Added: 0089870
2016-09-09 15:19hgbotCheckin
2016-09-09 15:19hgbotNote Added: 0089871
2016-09-09 15:21hgbotCheckin
2016-09-09 15:21hgbotNote Added: 0089872
2016-09-09 15:22caristuStatusnew => scheduled
2016-09-09 15:22caristuStatusscheduled => resolved
2016-09-09 15:22caristuResolutionopen => fixed
2016-09-09 20:14hudsonbotCheckin
2016-09-09 20:14hudsonbotNote Added: 0089879
2016-09-09 20:14hudsonbotCheckin
2016-09-09 20:14hudsonbotNote Added: 0089880
2016-09-23 08:14alostaleNote Added: 0090178
2016-09-23 08:14alostaleStatusresolved => closed
2016-09-23 08:14alostaleFixed in Version => 3.0PR16Q4
2016-12-14 17:13alostaleRelationship addedrelated to 0027698
2016-12-15 09:22caristuRelationship addedrelated to 0028765

Notes
(0089796)
hgbot   
2016-09-07 09:24   
Repository: erp/devel/pi
Changeset: 89eaadd3bedae46e49b2a0acadcdde5563919769
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Sep 07 09:23:12 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/89eaadd3bedae46e49b2a0acadcdde5563919769 [^]

fixes issue 33900: Wrong decimal default value having ',' as decimal separator

When using a decimal value as default for a numeric column, this very same value is a String passed to the createFromClassicString of NumberUIDefinition which is used by the FIC to retrieve the column value. The default values are part of the code, so in case of decimal values, they must me defined as a valid Java decimal number. But the createFromClassicString expects a value formatted according to the Format.xml file.

For this reason, now the decimal default values are formatted properly. Although this value will be converted again in the createFromClassicString, this is the cleanest solution because for the rest of the flows within the FIC, the createFromClassicString method receives a value formatted according to the to the Format.xml file.

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
(0089805)
hudsonbot   
2016-09-07 14:20   
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/f6f6845fdec4 [^]
Maturity status: Test
(0089863)
hgbot   
2016-09-09 09:28   
Repository: erp/devel/pi
Changeset: 012a4636f8b199ac41ef9866484c9abcc8fe5f5c
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Fri Sep 09 09:27:47 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/012a4636f8b199ac41ef9866484c9abcc8fe5f5c [^]

related to bug 33900: added contextual information in case of exception

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java
---
(0089864)
alostale   
2016-09-09 10:00   
reopening

Tested cases:

1. As defined in steps to reproduce: default set as a literal -> OK
2. Decimal default obtained from an SQL -> FAILS

Steps to reproduce case 2:

1. Edit FIN_Payment.Finacc_Txn_Convert_Rate default value to: @SQL=select 1.5 from dual
2. Create a Payment Out. Exepected value in conversion rate is 1.5
  - Having dot as decimal separator -> OK
  - Having comma as decimal separator got 15 as value -> ERROR


https://docs.google.com/spreadsheets/d/18l2biKWeG6iGDIPqO6VuYQ_TtP_6YxyQU4KSrPvQlJ8/edit#gid=0 [^]
(0089870)
hudsonbot   
2016-09-09 14:40   
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/a0e1673dab60 [^]
Maturity status: Test
(0089871)
hgbot   
2016-09-09 15:19   
Repository: erp/devel/pi
Changeset: 093cf42d6fa6ee0229ecc70884b565ba6f430d68
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Sep 09 15:18:08 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/093cf42d6fa6ee0229ecc70884b565ba6f430d68 [^]

related to issue 33900: apply the format when default value is a SQL expression

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
(0089872)
hgbot   
2016-09-09 15:21   
Repository: erp/devel/pi
Changeset: 7d535f62209815695ca9a9db96423cb871a85060
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Fri Sep 09 15:21:17 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7d535f62209815695ca9a9db96423cb871a85060 [^]

related to issue 33900: fix typo in comment

---
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
(0089879)
hudsonbot   
2016-09-09 20:14   
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/b21f9cb9c127 [^]
Maturity status: Test
(0089880)
hudsonbot   
2016-09-09 20:14   
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/b21f9cb9c127 [^]
Maturity status: Test
(0090178)
alostale   
2016-09-23 08:14   
code reviewed

Tested cases:

1. As defined in steps to reproduce: default set as a literal -> OK
2. Decimal default obtained from an SQL -> OK