Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035350Openbravo ERPA. Platformpublic2017-02-22 10:552017-03-03 18:57
maite 
inigosanchez 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4.33.0PR16Q4.3 
caristu
Core
Production - QA Approved
2016-09-08
3.0PR16Q4
https://code.openbravo.com/erp/devel/pi/rev/b4a8ad7a445ff946888867836f3c3c80cb988f2a [^]
No
0035350: Callout problem when working with comma (,) as decimal separator
Callout calculations are wrong when Format.xml is configured with comma (,) as decimal separator
1. Edit config/Format.xml file to set comma as decimal separator for all references
2. Compile application using: ant smartbuild
3. Register new Sales Invoice record for "EspaƱa" org and any BP. Add any line
4. Access to "Exchange Rate" tab, create new record setting USD, set "Foreign Amount"= 5 and realize that "Rate" field has not been properly calculated

Problem is also reproducible in Financial Account window, Transactions tab:
0. Access Financial Account window, Payment Method tab and modify Transferencia to leave it as "Automatic Deposit"=NO
1. Access Payment In window, set "Alimentos y Supermercados, S.A" and any decimal amount
2. Run "Add details" process and pay pending invoice with already set amount, Select "Process payment" option
3. Access Transactions tab in financial account "cuenta de banco", create new record. select previously created payment in "payment" selector and realize that Deposit Amount is not correct
No tags attached.
blocks defect 0035334 closed inigosanchez Callout problem when working with comma (,) as decimal separator 
Issue History
2017-02-23 16:20inigosanchezTypedefect => backport
2017-02-23 16:20inigosanchezTarget Version => 3.0PR16Q4.3
2017-02-24 13:29juabaezIssue Monitored: juabaez
2017-02-27 10:49inigosanchezRegression levelPackaging and release => Production - QA Approved
2017-02-27 10:50hgbotCheckin
2017-02-27 10:50hgbotNote Added: 0094629
2017-02-27 10:50hgbotStatusscheduled => resolved
2017-02-27 10:50hgbotResolutionopen => fixed
2017-02-27 10:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR16Q4.3/rev/acc61deacf8fec263e4d273510fcffb9c0a39a29 [^]
2017-02-27 11:28inigosanchezReview Assigned To => caristu
2017-03-03 15:37caristuNote Added: 0094752
2017-03-03 15:37caristuStatusresolved => closed
2017-03-03 15:37caristuFixed in Version => 3.0PR16Q4.3
2017-03-03 18:57PracticsIssue Monitored: Practics

Notes
(0094629)
hgbot   
2017-02-27 10:50   
Repository: erp/backports/3.0PR16Q4.3
Changeset: acc61deacf8fec263e4d273510fcffb9c0a39a29
Author: Inigo Sanchez <inigo.sanchez <at> openbravo.com>
Date: Mon Feb 27 10:49:29 2017 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR16Q4.3/rev/acc61deacf8fec263e4d273510fcffb9c0a39a29 [^]

Fixed issue 35350:Callout problem when working with comma as decimal separator

The problem was raised when a default format were switched, it means, when
decimal and group separator were switched. In this situation, when
SimpleCalloutInformationProvider class was used to obtain the current element
value and this current element was a BigDecimal, the format was not managed
properly. This occurred because getCurrentElementValue method always retrieved
a String element instead of Object element, in tyhis case BigDecimal.

In this situation, managesUpdatedValuesForCallout method of FIC class compare
if element is a String or not. If a BigDecimal is retrieved as String element,
in this part of the code the format is not managed properly when decimal separator
is comma. The code manage the comma separator as group separator and removed it.

When the decimal separator is dot (.) the format is managed as expected although
this method retrieves a String object (e.g. "1.23"). When decimal separator is
comma (,) this BigDecimal (e.g. 1,24) is retrieved by getCurrentElementValue method
as String value and the format is missed.

This problem has been fixed by take into account type of current element inside
getCurrentElementValue method. Now this method retrieves an object value. In this
case, a BigDecimal is retrieved. Now the format is managed properly.

---
M src/org/openbravo/erpCommon/ad_callouts/SimpleCalloutInformationProvider.java
---
(0094752)
caristu   
2017-03-03 15:37   
Code reviewed + testing OK.