Projects:Support different numeric formats/Functional Documentation
Contents |
Overview
Currently Openbravo ERP doesn't support the comma (,) as decimal separator when entering data using the numeric keypad, although if you manually enter a number like 10,00 and save the record is stored correctly in the database. This capability -use the comma (,) as decimal separator and the dot (.) as group separator- is already configurable through some files.
Another capability not yet present is to see a number formatted after editing it -changing the focus to another field- e.g. If you enter a number like 1400,5 and save the record, it might change to 1.400,50 because is format that is defined for this field.
Purpose
The purpose of this project is to enhance the support of different number formats in Openbravo ERP by:
- Allowing the user use the numeric keypad using the dot (.) key and displaying what the user spects so see -e.g. A comma (,) when this character is defined as decimal separator-.
- Formatting the numbers according to the type of numeric field just after finish editing it (e.g. changing the focus to another field) instead of waiting after the save.
Scope
This project will support (focused in the Spanish locale):
- The use of the comma (,) as decimal separator and the dot (.) as group separator
- The use of the dot key (.) in the numeric keypad as a comma (,) when typing a number
- The use of 2 different number format, one when editing (short) and one when the user has finished editing (long). e.g. When editing the user can type 1500,1 (short) and will be formatted as 1.500,10 (long) when the editing is finished (focus on other field)
- Error message prompting when entering wrong values like 1.9 - assuming that the dot (.) is the group separator -
References
Design Considerations
Assumptions
- The changes applied must work in both supported databases: PostgreSQL and Oracle
Dependencies
Constraints
- The other number formatting capabilities in Openbravo ERP must remain unchanged
- The changes will be part of Openbravo ERP 2.50 core module, so no extra module is needed.
- The changes will be backported to 2.40 stable repository.
Glossary
Functional Requirements
User roles & profiles
Business process definition
User stories
- Use cases would be (assuming Spanish locale, '.' as group separator and ',' as decimal separator):
- John is a System Administrator
- Ana is a Purchase clerk
John configuring the Format.xml
<?xml version="1.0" encoding="UTF-8" ?> <Formats> <Number name="euroInform" decimal="," grouping="." formatOutput="#,##0.00" formatInternal="#0.00" /> <!-- Other formats --> </Formats>
Ana using the application
- Ana types in numeric field A value 1234,5 -> number displayed in A is 1234,5 -> moves focus to next field B -> number displayed in A is 1.234,50 -> moves focus back to A -> number displayed in A is 1234,5
- Ana types in numeric field A value 1.234,5 -> number displayed in A is 1.234,5 -> moves focus to next field B -> number displayed in A is 1.234,50 -> moves focus back to A -> number displayed in A is 1234,5
- Ana types in numeric field A value 1.23 -> number displayed in A is 1.23 -> moves focus to next field B -> message error (not a number) and focus back to A
- Ana types in numeric field A value 1,234,5 -> number displayed in A is 1,234,5 -> moves focus to next field B -> message error (not a number) and focus back to A
In summary:
- UI accepts numeric values if they match with simple template (only uses decimal separator) or with complete template (grouping and decimal separator) and rejects any value that can not be transformed into a number through these templates.
- UI applies complete template to numbers when the field does not get the focus, and applies simple template when the field is focused
- UI should also manage numeric keyboard so when user types decimal separator it returns proper symbol (',' or '.') depending on the decimal separator defined in the system.
Functional requirements based on business processes
User Interface Mockups
Technical Requirements
- No new configuration file will be needed. We'll use the existing Format.xml configuration file instead.
- A global configuration of decimal and thousands separator will be chosen. From the Format.xml we'll use qtyEdition format. This format will define this global symbols.
- The rounding (number of decimal places) is defined per format definition in the Format.xml file witht the formatOutput attribute.