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

Rounding error in prorating returned adjustments

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Release Branch 09.04, Release 09.04, Release Branch 10.04
    • None
    • None

    Description

      The error is in applications/order/src/org/ofbiz/order/order/OrderReturnServices.java the getAdjustmentAmount method is prorating using this code:

      newAmount = returnTotal.divide(originalTotal, decimals, rounding).multiply(amount).setScale(decimals, rounding);

      it should be:

      newAmount = returnTotal.multiply(amount).divide(originalTotal, decimals, rounding);

      else by dividing first what should be for example 1/3 of the adjustment ends up being 0.33

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jleroux Jacques Le Roux
            jwickers Wickersheimer Jeremy
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment