On the Sales Order Subform, I have included 2 new field. Cost B and Profit Percentage.
If for Item Bicycle I have added a Cost B to be 75 (LCY) then the profit percentage would be P% = Selling Price - Cost Price / Cost Price * 100
However, this only works if quantity = 1.
How do I factor in the scenario where Quantity > 1.
Here is the code I have written;
Rec_Items: Record Item;
rec."Profit Percentage" := ((rec.Amount - (Rec.Quantity * "Cost B")) / (rec.Quantity * "Cost B") ) * 100