webERP Forum

Full Version: Solved: Profit % Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

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

E.g
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?
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.
Margin is the % profit/cost
GP% is the % profit/sales value
We use GP % consistently
(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

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:
http://en.wikipedia.org/wiki/Gross_margin

Close to the end of the article they explain the conversion between Markup and Gross Margin.
Thanks a lot. Sure, we'll do as as you proposed.

Thanks once again.
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?