Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||||||
ID | ||||||||||||
0048662 | ||||||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||||||
defect | [Openbravo ERP] A. Platform | minor | always | 2022-02-23 16:49 | 2022-02-23 16:49 | |||||||
Reporter | vmromanos | View Status | public | |||||||||
Assigned To | Triage Platform Base | |||||||||||
Priority | normal | Resolution | open | Fixed in Version | ||||||||
Status | new | Fix in branch | Fixed in SCM revision | |||||||||
Projection | none | ETA | none | Target Version | ||||||||
OS | Any | Database | Any | Java version | ||||||||
OS Version | Database version | Ant version | ||||||||||
Product Version | SCM revision | |||||||||||
Review Assigned To | ||||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0048662: FilterExpression class receives number with thousand separator | |||||||||||
Description | A class that implements the org.openbravo.client.application.FilterExpression java interface receives as parameter a "context", which is a json object with some properties. In case of a property that represents a number, the property is sent as a String and it includes the thousand separator. Example: "inpexpectedQty":"2,000" (the number represents two thousand) Usually you want to parse this number into a BigDecimal using the BigDecimal(String) constructor. The problem is that this thousand separator is not allowed for the BigDecimal constructor and it fails. Note that in the case of callouts we have the similar need of parsing a number, but in that case there is an API to properly do it [CalloutInfo.getBigDecimalParameter()]. In the case of FilterExpression we don't have such an API. | |||||||||||
Steps To Reproduce | Login in Backend to the AWO-QA client Create a Purchase Order for - US West Coast - Be Soft Drinker, Inc. - US West Coast warehouse Enter a line for 2000 units of Ale beer Book the order. Now press Receive button and Done. Go to the Task tab just below Order Line, select the task and set Confirmed Quantity = 1. Press Confirm button. Notice that the Delta Response mandatory field is empty, because the DeltaResponseDefaultExpression (https://gitlab.com/openbravo/product/pmods/org.openbravo.warehouse.advancedwarehouseoperations/-/blob/master/src/org/openbravo/warehouse/advancedwarehouseoperations/filterexpression/DeltaResponseDefaultExpression.java#L67 [^]) has thrown an exception trying to parse the number. java.lang.NumberFormatException: Character , is neither a decimal digit number, decimal point, nor "e" notation exponential mark. at java.math.BigDecimal.<init>(BigDecimal.java:518) ~[?:?] at java.math.BigDecimal.<init>(BigDecimal.java:401) ~[?:?] at java.math.BigDecimal.<init>(BigDecimal.java:834) ~[?:?] at org.openbravo.warehouse.advancedwarehouseoperations.filterexpression.DeltaResponseDefaultExpression.isExpectedQtyEqualOrLowerThanConfirmedQty(DeltaResponseDefaultExpression.java:67) ~[classes/:?] | |||||||||||
Proposed Solution | Several possibilities I see: - To send numbers as numbers in the JSON (not as String). That would represent an API change. - To keep on sending numbers as Strings, but making sure we don't have thousand separator, and that the decimal separator is a fixed parameter (dot) - To have an API in java to easily parse a number in FilterExpression (and any other related class), like we have in callouts, which is able to remove the thousand separator and to set the decimal separator to a dot. | |||||||||||
Tags | No tags attached. | |||||||||||
Attached Files | ||||||||||||
Relationships [ Relation Graph ] [ Dependency Graph ] | |
Issue History | |||
Date Modified | Username | Field | Change |
2022-02-23 16:49 | vmromanos | New Issue | |
2022-02-23 16:49 | vmromanos | Assigned To | => Triage Platform Base |
2022-02-23 16:49 | vmromanos | Modules | => Core |
2022-02-23 16:49 | vmromanos | Triggers an Emergency Pack | => No |
Copyright © 2000 - 2009 MantisBT Group |