webERP Forum
Solved: Profit % Error - Printable Version

+- webERP Forum (
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Solved: Profit % Error (/showthread.php?tid=967)

Solved: Profit % Error - turpsy - 07-19-2013 07:46 PM


I earlier posted on the necessary corrections required for CotractCosting.php and Contracts.php with regards to profit % problem.

here is what i mean, say our total cost of contract is 10 and profit margin % is 30%. We all expect the contract price to be 13 but weberp says it's 14.28! This is because weberp calculated it like this (10/70%).

Please can anyone quickly fix this?

We also found out that the same problem exists for GLTagProfit_Loss.php where the Gross Profit % is wrong as well.

Can anyone fix this too?

RE: Profit % Error - MacPhotoBiker - 07-21-2013 04:38 AM

Hi turpsy,

IMHO you are using the wrong terminology. Profit margin (aka gross profit) is calculated as (Sales Price - Cost) / Sales Price, or in other words, if you want to calculate a sales prices given a certain target GP, the formula is:

Sales Price = Cost / (1 - Profit Margin). In your case, this means

Sales Price = 10 / (1 - 0.3)
Sales Price = 10 / 0.7
Sales Price = 14.29

What you are referring to is called "Markup", i. e. you simply want to add a certain percentage to your cost:

Sales Price = 10 x 1.3
Sales Price = 13

Neither approach is "wrong", they are just different, although that from my experience I'd say that the gross profit calculation is more common.

I hope that helps.

RE: Profit % Error - phil - 07-22-2013 08:19 AM

Margin is the % profit/cost
GP% is the % profit/sales value
We use GP % consistently

RE: Profit % Error - turpsy - 07-23-2013 10:13 PM

(07-22-2013 08:19 AM)phil Wrote:  Margin is the % profit/cost
GP% is the % profit/sales value
We use GP % consistently

Thanks guys. Please can you help with the code to just ensure we use a markup only. i.e. whatever % we choose we just need an increment on the costs equivalent to that amount. e.g if project costs is 10 and markup is 30%, then project price should be 13.

Hoping for a prompt response. Thanks

RE: Profit % Error - MacPhotoBiker - 07-24-2013 10:29 AM

If I were you, I really wouldn´t re-code webERP. Margin and Gross Profit are directly linked, you just need to modify the value. The formula to calculate the Gross Margin from a given Markup is this:

Gross Margin = Markup / (1 + Markup)

In your example:

Gross Margin = 0.3 / (1 + 0.3)
Gross Margin = 0.3 / 1.3
Gross Margin = 23.08 %

In other words, Markup 30 % = Gross Margin 23.08 %.

For some more detailed information, have a look here:

Close to the end of the article they explain the conversion between Markup and Gross Margin.

RE: Profit % Error - turpsy - 07-26-2013 06:25 PM

Thanks a lot. Sure, we'll do as as you proposed.

Thanks once again.

RE: Profit % Error - MacPhotoBiker - 07-28-2013 06:45 AM

Glad I could could help, I hope it all works out for you.

Btw, would you mind adding "Solved" in front of the subject in your first post?