OFBiz
  1. OFBiz
  2. OFBIZ-4766

PriceRule applies action to wrong priceType

    Details

      Description

      If you create a PriceRule and add an action of type "PRICE_POD" (Percent of default price) I read this as:
      "take the default price and give an amount of x% to that"

      These rules are applied within the service "calculateProductPrice" (specifically in PriceServices.calcPriceResultFromRules). It calculates the amount of discount using the default price (as specified by the action of the rule). But then it adds this discount to the listPrice instead of the defaultPrice.

      An example:
      listPrice = 100,
      defaultPrice = 10,
      rule says you give 10% of defaultPrice,
      modifyAmount = -1 (this is the correct discount amount)
      result would be 100-1 = 99.

      I consider this to be a bug, not some sort of easter-egg feature
      I will attach a patch for this.

      1. PriceServices.java.patch
        0.9 kB
        Sebastian Leitner

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        1m 5s 1 Sebastian Leitner 28/Mar/12 17:11
        Patch Available Patch Available Closed Closed
        3d 18h 26m 1 Jacques Le Roux 01/Apr/12 11:37
        Jacques Le Roux made changes -
        Status Patch Available [ 10002 ] Closed [ 6 ]
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Fix Version/s Release Branch 10.04 [ 12314832 ]
        Fix Version/s Release Branch 11.04 [ 12316420 ]
        Fix Version/s SVN trunk [ 12311928 ]
        Resolution Fixed [ 1 ]
        Hide
        Jacques Le Roux added a comment -

        Thanks Sebastian

        Your patch is in
        trunk r1308063
        R11.04 r1308065
        R11.04 r1308066

        Actually I applied the change by hand because your patch contains tabs. Please use 4 spaces instead of tabs in your patches

        Show
        Jacques Le Roux added a comment - Thanks Sebastian Your patch is in trunk r1308063 R11.04 r1308065 R11.04 r1308066 Actually I applied the change by hand because your patch contains tabs. Please use 4 spaces instead of tabs in your patches
        Sebastian Leitner made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Sebastian Leitner made changes -
        Field Original Value New Value
        Attachment PriceServices.java.patch [ 12520280 ]
        Sebastian Leitner created issue -

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Sebastian Leitner
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development