At present it's not possible to produce an accurate profit report by customer and product on Sage 50 because the actual cost of a particular item is not brought into the SOP_ITEM or INVOICE_ITEM tables when allocating / despatching items.
Although the actual cost can be seen in the STOCK_TRAN table, because the sales price can be modified at despatch or even at invoicing then the sales price in that table cannot be relied upon.
If the cost was brought into the sales side via the SOP_ITEM / INVOICE_ITEM tables then this would allow a report to be produce that would show the true profit.
Just looking at the ideas board today and have come across at least two suggestions on this ((+) Customer profit report using actual cost price - Sage 50 Accounts UKI Ideas - Sage 50 Accounts - Sage City Community and (+) Profit analysis button on sales orders (and report) need to use the product cost at the time of entering the order - Sage 50 Accounts UKI Ideas - Sage 50 Accounts - Sage City Community) hence this suggestion to deal with them both.
This Tool from Adept correctly uses the Cost Price fro mthe actual Stock Transaction that was used https://www.adepttools.co.uk/adept-sage-50-reports/