I need help obtaining the cost of shipments, productions, and sales from a SQL search?

I am trying obtain the costs assosiated to each production, shipment and sale.

-For production i am using the production table.

-For shipment i am using the stock_shipment_out

-For sales i am using the account_invoice table

Looking forward for a helpfull reply!

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.