Two shopkeepers both say "I make 30%". The first buys at 100 and sells at 130. The second buys at 100 and sells at 143. Both are right — they are simply not talking about the same thing.
This confusion is not an accountant's detail. It decides what you believe you earn, therefore what discount you accept, and how big an order you allow yourself the following month.
First, the margin in dirhams
Before any percentage there is one number open to no interpretation: what is left. Selling price minus cost price.
An item bought at 80 dirhams and sold at 100 leaves 20 dirhams. That number is the only one that pays the rent, and it is the one to know per product before worrying about percentages.
Then, the two percentages
The same 20 dirhams give two different percentages depending on what goes under the division.
- Margin — 20 / 100 = 20%. You divide by the SELLING price. It is the share of every dirham taken that stays with you.
- Markup — 20 / 80 = 25%. You divide by the COST price. It is what you add on top of what you paid.
On this one item the two ways of saying it differ by five points. On a thin-margin product the gap is small; on a product you double it becomes enormous: bought at 50, sold at 100, that is a 50% margin and a 100% markup.

Why the confusion costs money
The classic trap is the discount. You sell at 100 an item bought at 80, and you give a good customer 10%. The price drops to 90 and your margin goes from 20 dirhams to 10: halved, for a 10% discount.
That is the rule worth keeping: a discount comes entirely out of the margin, never out of the cost. The thinner your margin, the larger the share a small discount takes.
A 10% discount on an item at 20% margin costs you half of what you were earning on it.
What is still to be subtracted
Gross margin is not profit. Between the two sits everything the product does not pay for itself: rent, electricity, transport, wages, breakage and unsold goods.
There is also what was sold but never collected. A good-margin item sold on credit and never paid has a margin of zero — which is why tracking customer receivables is part of the margin calculation rather than a separate subject.
Track margin per product, not only overall
A healthy overall margin can hide products sold at a loss. It happens on its own: the cost price rises, the selling price stays the one on the label, and nobody notices before the stocktake.
That is the calculation software does without being asked: it knows the recorded cost price and the price actually charged, so it knows the margin on every line of every receipt. Gestio shows margins alongside sales — see the features.

