For the production you have a functional field named cost this computes the costs of the production, dependening on the activated modules you should sum queries from different tables but at least you need to sum the cots of the inputs.
For shipments, the cost is stored on the cost_price of the related moves. And for sales, you should look at the related moves of each line to compute its cost.