Compute margins

You do not need to store the value for such usage. It should be managed with a similar design of sale_credit_limit.
And you will not base such constraint on the always changing cost price but instead put a lower limit on the sale price.

Not before having New invoicing method when selling both goods and services - #6 by ced

But this is not the targets of the sale group that’s why for me it has nothing to do with sales.