Tracking product & invoice margins and costs

Tracking product & invoice margins and costs

We currently use Zoho Invoice and looking to understand how other people manage their product costs, margins, reporting etc.  How do you know how much a particular job/invoice has made you and the costs involved? 
We have over 100,000 SKUs so not sure how easily they can be brought in (and regularly updated in terms of price updates etc and additional variations).

How would you manage the above?