Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036590Openbravo ERPA. Platformpublic2017-08-03 13:282017-09-21 16:49
JONHM 
markmm82 
normalmajoralways
closedfixed 
5
pi 
3.0PR17Q4 
aferraz
Core
No
0036590: Callouts retrieve wrong quantity when Format.xml file is set with too many decimals
When adding a product line in physical inventory (which is associated with SL_Inventory_Product callout), the quantity obtained from the product is not real, there are too many zeroes added to the real quantity.
It seems to be related to the configuration of the Format.xml file and its 'qtyRelation' and 'qtyEdition' fields when set with 5 decimals
- First of all, replace the Format.xml file by the attached one. Then, recompile the application.

1) Open "Physical Inventory" window and create a new one with default values.
2) Switch to lines tab and create a new one for product 'Vino Blanco 0,75L'.
--> Notice that the stock for that product is 31300 and the quantity retrieved from the callout is 3130000

(The quantity in database for that product is set as 31300.00)
No tags attached.
duplicate of defect 0036345 closed markmm82 Wrong quantity in inventory lines if "," is used as decimal separator and "." as grouping separator 
related to defect 0036392 closed collazoandy4 Avoid casting to Object when adding numeric results from a SimpleCallout 
related to defect 0036302 closed platform Display logic in fields is not working in callouts using SimpleCallout 
related to design defect 0036067 closed markmm82 old callouts should be refactored to implement SimpleCallout 
depends on backport 00366673.0PR17Q3 closed markmm82 Callouts retrieve wrong quantity when Format.xml file is set with too many decimals 
depends on backport 00366683.0PR17Q2.3 closed markmm82 Callouts retrieve wrong quantity when Format.xml file is set with too many decimals 
depends on backport 00366693.0PR17Q1.4 closed markmm82 Callouts retrieve wrong quantity when Format.xml file is set with too many decimals 
xml Format.xml (3,271) 2017-08-03 13:28
https://issues.openbravo.com/file_download.php?file_id=10960&type=bug
? callout.mp4 (1,375,339) 2017-08-03 13:28
https://issues.openbravo.com/file_download.php?file_id=10961&type=bug
diff 36590.diff (5,090) 2017-08-10 12:45
https://issues.openbravo.com/file_download.php?file_id=10977&type=bug
diff backport-17Q3.diff (2,783) 2017-08-18 12:55
https://issues.openbravo.com/file_download.php?file_id=10987&type=bug
Issue History
2017-08-03 13:28JONHMNew Issue
2017-08-03 13:28JONHMAssigned To => platform
2017-08-03 13:28JONHMFile Added: Format.xml
2017-08-03 13:28JONHMModules => Core
2017-08-03 13:28JONHMResolution time => 1503525600
2017-08-03 13:28JONHMTriggers an Emergency Pack => No
2017-08-03 13:28JONHMFile Added: callout.mp4
2017-08-09 14:09inigosanchezRelationship addedrelated to 0036392
2017-08-09 14:13inigosanchezNote Added: 0098453
2017-08-09 14:37inigosanchezAssigned Toplatform => Triage Finance
2017-08-09 14:57aferrazAssigned ToTriage Finance => AtulOpenbravo
2017-08-09 17:59AtulOpenbravoStatusnew => scheduled
2017-08-10 12:45aferrazNote Added: 0098475
2017-08-10 12:45aferrazFile Added: 36590.diff
2017-08-10 12:46aferrazAssigned ToAtulOpenbravo => platform
2017-08-10 12:47aferrazNote Edited: 0098475bug_revision_view_page.php?bugnote_id=0098475#r15643
2017-08-11 14:25inigosanchezNote Edited: 0098475bug_revision_view_page.php?bugnote_id=0098475#r15646
2017-08-18 12:54inigosanchezNote Added: 0098542
2017-08-18 12:55inigosanchezFile Added: backport-17Q3.diff
2017-08-18 12:57inigosanchezRelationship addedrelated to 0036302
2017-08-18 12:57inigosanchezRelationship addedrelated to 0036067
2017-08-18 12:58inigosanchezAssigned Toplatform => Triage Finance
2017-08-18 12:59aferrazAssigned ToTriage Finance => inigosanchez
2017-08-18 12:59aferrazStatusscheduled => feedback
2017-08-18 13:00aferrazStatusfeedback => scheduled
2017-08-18 14:54hgbotCheckin
2017-08-18 14:54hgbotNote Added: 0098548
2017-08-18 15:03aferrazNote Added: 0098549
2017-08-22 14:43aferrazReview Assigned To => aferraz
2017-08-22 14:43aferrazNote Added: 0098581
2017-08-22 14:43aferrazStatusscheduled => closed
2017-08-22 14:43aferrazResolutionopen => fixed
2017-08-22 14:43aferrazFixed in Version => 3.0PR17Q4
2017-08-22 14:48aferrazRelationship addedduplicate of 0036345
2017-08-23 08:38caristuAssigned Toinigosanchez => Triage Finance
2017-08-23 10:53aferrazAssigned ToTriage Finance => aferraz
2017-08-23 10:53aferrazAssigned Toaferraz => markmm82
2017-09-21 16:49hudsonbotCheckin
2017-09-21 16:49hudsonbotNote Added: 0099315

Notes
(0098453)
inigosanchez   
2017-08-09 14:13   
As mentioned in related issue 0036392, it is needed to replace the castings to Object in the mentioned callout by sending the corresponding numeric value when it applies.
(0098475)
aferraz   
2017-08-10 12:45   
(edited on: 2017-08-11 14:25)
Issue is reproducible in 17Q1.1, 17Q2.1 and 17Q3 but not in PI.
Applied attached fix in 17Q1.1 (send quantities as BigDecimal instead of cast quantity String to Object) and it still fails.

(0098542)
inigosanchez   
2017-08-18 12:54   
The usage of "EXECUTE" callout command is no longer supported (since the refactor of the SimpleCallouts 3.0PR16Q4) and it is not needed because the display logics are recalculated on the FIC response.

The refactor 0036067 of several SimpleCallouts fixes the problem in 3.0PR17Q4 but it isn't backported to 17Q1.4, 17Q2.2 and 17Q3. The attached diff fixes the problem in 17Q3 and should be reviewed it (backport-17Q3.diff).

As you can see in the diff, other callouts should be reviewed apart of the reported one (Simple callouts with execute command):
-SL_Inventory_Locator
-SL_Inventory_Product <- Reported
-SL_Movement_Product
-SL_InOutLine_Product
(0098548)
hgbot   
2017-08-18 14:54   
Repository: erp/devel/pi
Changeset: b29fcb712528e7603e952d036bf826c4031a9a3a
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Aug 18 14:53:29 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/b29fcb712528e7603e952d036bf826c4031a9a3a [^]

Related to issue 36590: Send quantities as BigDecimal

---
M src/org/openbravo/erpCommon/ad_callouts/SL_InOutLine_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Inventory_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Movement_Product.java
---
(0098549)
aferraz   
2017-08-18 15:03   
Reverted 0036067 fix for SL_Inventory_Product.java in PI and issue is still not reproducible.
Applied 0036067 fix for SL_Inventory_Product.java in 17Q3 and issue is still reproducible.
(0098581)
aferraz   
2017-08-22 14:43   
Fixed in issue 0036345.
(0099315)
hudsonbot   
2017-09-21 16:49   
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/9750b78d3e5c [^]
Maturity status: Test