Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-7532

Form Display Field improvement to manage multiple number format

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Implemented
    • Trunk
    • None
    • ALL COMPONENTS
    • None
    • Patch

    Description

      On display field used in forms, there is a "type" "accounting-number" which is used to format number like property configuration : #,##0.0000;(#,##0.0000).

      This JIRA propose to extend this idea by using a "type" "number" and an additional attribute called "format-pattern". This field will be used by form renderer to get the good property. It use FlexibleString to manage variable in this field and so allow to have different format for the same column according to some conditions.

      example: <field name="amount"><display type="number" format-pattern="accounting"/></field>

      The "format-pattern" will be stored in arithmetic.properties.

      example:

      1. the default number format
        default.number.format = ##0.00
        accounting.number.format = #,##0.0000;(#,##0.0000)
        quantity.number.format = ##0.00
        integer-quantity.number.format = #0
        percentage.number.format = ##.##%
        export.number.format = #.00

      In ModelFormField.java, the system gets property using EntityUtilProperties.getPropertyValue to ba able to quickly add a new format.

      I think that it will require a discussion on Dev mailing-list to validate the choices.

      Attachments

        1. OFBIZ-7532.patch
          53 kB
          Nicolas Malin
        2. OFBIZ-7532.patch
          53 kB
          Nicolas Malin
        3. OFBIZ-7532.patch
          44 kB
          Nicolas Malin
        4. OFBIZ-7532.patch
          24 kB
          Nicolas Malin
        5. OFBIZ-7532.patch
          7 kB
          Charles STELTZLEN
        6. Sélection_238.png
          15 kB
          Nicolas Malin

        Issue Links

          Activity

            People

              nmalin Nicolas Malin
              charles steltzlen Charles STELTZLEN
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: