You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Divesh Dutta (JIRA)" <ji...@apache.org> on 2015/02/21 13:17:12 UTC

[jira] [Commented] (OFBIZ-5858) Quote profit percentage is calculated wrong

    [ https://issues.apache.org/jira/browse/OFBIZ-5858?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14330173#comment-14330173 ] 

Divesh Dutta commented on OFBIZ-5858:
-------------------------------------

HI [~pfm.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. 

> Quote profit percentage is calculated wrong
> -------------------------------------------
>
>                 Key: OFBIZ-5858
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5858
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: Release Branch 11.04, Release Branch 12.04, Release Branch 13.07, Trunk
>            Reporter: Pierre Smits
>              Labels: quote
>         Attachments: OFBIZ-5858-ORDER-QuoteProfitPerc.patch
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)