[jira] [Created] (OFBIZ-4766) PriceRule applies action to wrong priceType

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (OFBIZ-4766) PriceRule applies action to wrong priceType

Nicolas Malin (Jira)
PriceRule applies action to wrong priceType
-------------------------------------------

                 Key: OFBIZ-4766
                 URL: https://issues.apache.org/jira/browse/OFBIZ-4766
             Project: OFBiz
          Issue Type: Bug
          Components: product
    Affects Versions: SVN trunk
            Reporter: Sebastian Leitner
         Attachments: PriceServices.java.patch

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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (OFBIZ-4766) PriceRule applies action to wrong priceType

Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebastian Leitner updated OFBIZ-4766:
-------------------------------------

    Attachment: PriceServices.java.patch
   

> PriceRule applies action to wrong priceType
> -------------------------------------------
>
>                 Key: OFBIZ-4766
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4766
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Sebastian Leitner
>              Labels: PRICE_POD, ProductPriceAction, ProductPriceRule
>         Attachments: PriceServices.java.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|

[jira] [Closed] (OFBIZ-4766) PriceRule applies action to wrong priceType

Nicolas Malin (Jira)
In reply to this post by Nicolas Malin (Jira)

     [ https://issues.apache.org/jira/browse/OFBIZ-4766?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-4766.
----------------------------------

       Resolution: Fixed
    Fix Version/s: SVN trunk
                   Release Branch 11.04
                   Release Branch 10.04
         Assignee: Jacques Le Roux

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
               

> PriceRule applies action to wrong priceType
> -------------------------------------------
>
>                 Key: OFBIZ-4766
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4766
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product
>    Affects Versions: SVN trunk
>            Reporter: Sebastian Leitner
>            Assignee: Jacques Le Roux
>              Labels: PRICE_POD, ProductPriceAction, ProductPriceRule
>             Fix For: Release Branch 10.04, Release Branch 11.04, SVN trunk
>
>         Attachments: PriceServices.java.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira