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

Quote profit percentage is calculated wrong

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release Branch 11.04, Release Branch 12.04, Release Branch 13.07, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02, 16.11.01
    • Component/s: order
    • Labels:

      Description

      When reviewing the profit page of a quote the profit percentage is calculated wrong. In stead of dividing the profit by the quote amount giving the margin, the quote amount is divided by the average cost (when provided). Thus giving the quote (amount) to cost ratio.

        Activity

        Hide
        pfm.smits Pierre Smits added a comment -

        This patch fixes the issue.

        Show
        pfm.smits Pierre Smits added a comment - This patch fixes the issue.
        Hide
        diveshdut Divesh Dutta added a comment -

        HI Pierre Smits

        I think formula should be:

        percProfit = averageCost != 0 ? (profit / averageCost) * 100.00 : 0.00; and
        totalPercProfit = totalCost != 0 ? (totalProfit / totalCost) * 100.00: 0.00;

        I am saying this based on discussion given here: http://math.stackexchange.com/questions/105306/what-is-the-formula-to-calculate-profit-percentage

        http://formulas.tutorvista.com/math/profit-formula.html

        So formula given in your patch gives profit margin percentage and formula I am giving will give profit mark up percentage.

        Different people have different opinion on this formula. So we can conclude this and then push community to commit the right solution.

        Show
        diveshdut Divesh Dutta added a comment - HI Pierre Smits I think formula should be: percProfit = averageCost != 0 ? (profit / averageCost) * 100.00 : 0.00; and totalPercProfit = totalCost != 0 ? (totalProfit / totalCost) * 100.00: 0.00; I am saying this based on discussion given here: http://math.stackexchange.com/questions/105306/what-is-the-formula-to-calculate-profit-percentage http://formulas.tutorvista.com/math/profit-formula.html So formula given in your patch gives profit margin percentage and formula I am giving will give profit mark up percentage. Different people have different opinion on this formula. So we can conclude this and then push community to commit the right solution.
        Hide
        pfm.smits Pierre Smits added a comment - - edited

        Showing the markup of products represents a total different viewpoint. While it is a good function to determine potential sales price of a product (often only applied in retail), it loses value when determining/evaluating the earning potential of the whole of a quote.

        Show
        pfm.smits Pierre Smits added a comment - - edited Showing the markup of products represents a total different viewpoint. While it is a good function to determine potential sales price of a product (often only applied in retail), it loses value when determining/evaluating the earning potential of the whole of a quote.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        Thanks Pierre,

        Your patch is in
        trunk r1661853
        R14.12 r1661854
        R13.07 r1661855
        R12.04 r1661856

        Thanks for your interesting discussion Divesh. I agree with Pierre that we want the profit margin here

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Pierre, Your patch is in trunk r1661853 R14.12 r1661854 R13.07 r1661855 R12.04 r1661856 Thanks for your interesting discussion Divesh. I agree with Pierre that we want the profit margin here
        Hide
        pfm.smits Pierre Smits added a comment -

        Thanks, Jacques.

        Show
        pfm.smits Pierre Smits added a comment - Thanks, Jacques.

          People

          • Assignee:
            pfm.smits Pierre Smits
            Reporter:
            pfm.smits Pierre Smits
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development