The formulas are pretty easy. But I'm still baffled by the logic.
Let's simplify the description to a single 'product' and one of the many components used to make that product.
At the beginning you have no product and no components.
You purchase a batch of 100 pieces of 'Component A'
Your current inventory of these two items is now:
Product 1: 0
Component A: 100
You use one Component A in manufacturing one Product 1.
Your current inventory of these two items is now:
Product 1: 1
Component A: 99
You manufacture four more of Product 1, using one Component A in each.
Your current inventory of these two items is now:
Product 1: 5
Component A: 95
You sell two of your Product 1.
Your current inventory of these two items is now:
Product 1: 3
Component A: 95
and so forth.
Inventory of a product increases whenever one or more of the product is manufactured, and decreases when one or more of the product is sold.
Inventory of a component decreases whenever one or more of that component is used in the manufacture of a product, and increases when you buy more of the component. Selling a product has no effect on the inventory of the component.
----
To calculate current inventory, you will need two (or three) additional tables:
A Transaction table on which to record the manufacture and sales of the products.
A second Transaction table on which to record the purchase of components.
A 'parts list' table containing the number of each component used in the manufacture of each product.
The basic calculation to be carried out to arrive at a current inventory number for each product is:
Inventory = Total made - Total sold
All of the required information is on the Product Tx table, and the result for each product is the result of two SUMIF statements:

Product, the inventory table contains a single formula, entered in B2, and filled from there to C6:
B2: =SUMIFS(Product Tx::$D,Product Tx::$B,"="&$A2&B$1,Product Tx::$C,"Mfg")−SUMIFS(Product Tx::$D,Product Tx::$B,"="&$A2&B$1,Product Tx::$C,"Sell")
Separated into its two sections:
SUMIFS(Product Tx::$D,Product Tx::$B,"="&$A2&B$1,Product Tx::$C,"Mfg")−
SUMIFS(Product Tx::$D,Product Tx::$B,"="&$A2&B$1,Product Tx::$C,"Sell")
This part: "="&$A2&B$1
sets one of the conditions for both counts: the 'product name' in column B of Product Tx must be identical to the text string formed by the content of A2 followed immediately by the content of B1(both cells are on Product, the table containing the formula).
For the three components listed in the question, essentially the same formula would work: Count the number of this component purchased, subtract the number of products manufactured (not the number sold). Simple because one of each of these components is used in each product.
The more general solution, allowing for components that are now used in some versions of the products (and for some versions to require more than one of a specific component) isn't a great deal more complicated, but does require much more calculation. Here's a peek at one formula that could be used—one that doesn't actually work, as it is missing repeated occurrences of a missing part.
There's enough churning of the waters going on to slow Numbers significantly. The attack might provide a start for a script, though—probably a better approach if only for its ability to avoid the continuous calculation required to update the spreadsheet after every change to its content.
Partially developed formula—not intended to be used as is.
SUMIFS(Component Transactions::$D,Component Transactions::$B,$A2,Component Transactions::C,”=Buy")−SUM(SUMIFS(Product Transactions::$D,Product Transactions::$B,"P1a",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P1a",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P1b",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P1b",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P2a",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P2a",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P2b",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P2b",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P3a",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P3a",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P3b",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P3b",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)),SUMIFS( Product Transactions::$D,Product Transactions::$B,"P4a",Product Transactions::$C,"Mfg")×INDEX(Parts list::$A:$H,MATCH("P4a",Parts list::$A,0),MATCH($A2,Parts list::$1:$1,0)
Partially developed formula—requires further work before being put to use.
First step in simplifying is to shorten the table names—makes no change to the effectiveness (or lack of same) of the formula, but does make it a bit shorter. That's why you'll see "Product Tx" in the image above instead of "Product Transactions"
Not sure when I'll get time to get back to this.
G'Night,
Barry