OFBiz
  1. OFBiz
  2. OFBIZ-4699

Error in getProductInventoryAvailable with french formated number

    Details

    • Type: Bug Bug
    • Status: Patch Available
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: SVN trunk
    • Fix Version/s: None
    • Component/s: product
    • Labels:
      None

      Description

      The calculation of the available quantities by location does not take into account the local formatting of the numbers.

      How to see the problem:

      • Be in French local
      • Create for the same product several inventory items with ATP and QOH > 999.
      • Go to the product inventory view
      • The values are not correct for locations

      The patch corrects this problem by using the standard methods of the minilanguage

        Activity

        Hide
        Adrian Crum added a comment -
        Show
        Adrian Crum added a comment - http://jsp.java.net/spec/jsp-2_1-fr-spec-el.pdf Section 1.18.3.
        Hide
        Olivier Heintz added a comment -

        Adrian,

        Just to be sure to understand :
        UEL calculation is done with BigDecimal methods when field type are BigDecimal ?

        Show
        Olivier Heintz added a comment - Adrian, Just to be sure to understand : UEL calculation is done with BigDecimal methods when field type are BigDecimal ?
        Hide
        Adrian Crum added a comment -

        I think both of you should read the commit log message from revision 741423.

        Show
        Adrian Crum added a comment - I think both of you should read the commit log message from revision 741423.
        Hide
        Gaudin Pierre added a comment -

        Thanks for all your comments

        Adrian, what do you think about Nicolas's comments ? I think he's right

        Pierre

        Show
        Gaudin Pierre added a comment - Thanks for all your comments Adrian, what do you think about Nicolas's comments ? I think he's right Pierre
        Hide
        Nicolas Malin added a comment -

        I check the patch and I think that there is a misunderstanding.

        parameters.quantityOnHandTotal is a BigDecimal and inventoryItem.quantityOnHandTotal is also a BigDecimal. The problem that solve pierre is to call directly operation with BigDecimal instead of use a flexible string that convert BigDecimal to String and String to BigDecimal for return value.

        For me, pierre solve with a good solution.

        On other point, I am little surprised by replace calculate by uel. Simple method is a high level language, use mainly by the functional, uel need to know conversion problem. It's a regression for me to use uel inseated of mini-lang, uel is pretty good but not on functional context (this is my opinion )

        On mini-lang xsd or wiki I don't found information on obsoleted calculate code, where I can found most information on the reason ?

        Nicolas

        Show
        Nicolas Malin added a comment - I check the patch and I think that there is a misunderstanding. parameters.quantityOnHandTotal is a BigDecimal and inventoryItem.quantityOnHandTotal is also a BigDecimal. The problem that solve pierre is to call directly operation with BigDecimal instead of use a flexible string that convert BigDecimal to String and String to BigDecimal for return value. For me, pierre solve with a good solution. On other point, I am little surprised by replace calculate by uel. Simple method is a high level language, use mainly by the functional, uel need to know conversion problem. It's a regression for me to use uel inseated of mini-lang, uel is pretty good but not on functional context (this is my opinion ) On mini-lang xsd or wiki I don't found information on obsoleted calculate code, where I can found most information on the reason ? Nicolas
        Show
        Jacques Le Roux added a comment - This may help https://cwiki.apache.org/confluence/display/OFBTECH/Unified+Expression+Language+%28JSR-245%29+in+OFBiz
        Hide
        Adrian Crum added a comment -

        It is obsolete because it has been replaced with UEL expressions. Convert the two parameter Strings to BigDecimals before the expression and you're good to go. But don't bring back obsolete code.

        Show
        Adrian Crum added a comment - It is obsolete because it has been replaced with UEL expressions. Convert the two parameter Strings to BigDecimals before the expression and you're good to go. But don't bring back obsolete code.
        Hide
        Gaudin Pierre added a comment -

        Sorry but i can't read any explanation in your previous message why <calculate> is obsolete.

        Surely i'm wrong but why ???

        Show
        Gaudin Pierre added a comment - Sorry but i can't read any explanation in your previous message why <calculate> is obsolete. Surely i'm wrong but why ???
        Hide
        Adrian Crum added a comment -

        The criticism of the patch was in my first comment - it is a regression. No, it will not be applied because it takes the project backwards.

        Show
        Adrian Crum added a comment - The criticism of the patch was in my first comment - it is a regression. No, it will not be applied because it takes the project backwards.
        Hide
        Gaudin Pierre added a comment -

        This is a criticism of the minilanguage but not of the patch.

        Can I hope that this patch will be integrate?

        Show
        Gaudin Pierre added a comment - This is a criticism of the minilanguage but not of the patch. Can I hope that this patch will be integrate?
        Hide
        Adrian Crum added a comment -

        The reason should be obvious from your patch - two UEL expressions can replace 12 lines of <calculate> code.

        Show
        Adrian Crum added a comment - The reason should be obvious from your patch - two UEL expressions can replace 12 lines of <calculate> code.
        Hide
        Gaudin Pierre added a comment -

        Thank you Adrian for the review of this patch.

        Can you explain why it is better to include UEL rather than to use standard tag of the minilanguage?

        Show
        Gaudin Pierre added a comment - Thank you Adrian for the review of this patch. Can you explain why it is better to include UEL rather than to use standard tag of the minilanguage?
        Hide
        Adrian Crum added a comment - - edited

        The attached patch is a regression - it replaces a UEL expression with the obsolete <calculate> element. It would be better to do the String-to-BigDecimal conversions before using the UEL expression.

        Show
        Adrian Crum added a comment - - edited The attached patch is a regression - it replaces a UEL expression with the obsolete <calculate> element. It would be better to do the String-to-BigDecimal conversions before using the UEL expression.

          People

          • Assignee:
            Unassigned
            Reporter:
            Gaudin Pierre
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development