GDP and Inventory investment?

I’ve been revising macroeconomics lately, and one thing that is probably quite elementary puzzled me, regarding the accounting of Inventory investment. Hence if a firm producing a capital good decides to hold on to it and not sell it as soon as it is produced, but keep it in inventory, this iinventory investment is included in I in the income-expenditure identity Y=C+I+G+NX.

However, if it decides to sell this on to another firm producing goods of a lower order, and this firm decides not to use the capital good to produce consumer goods, but instead keeps them in inventory, is this counted as investment? I am curious because under the “value added” approach to GDP accounting it wouldn’t count in costs for the second firm in circumstances where there was no inventory investment, and the capital goods were simply processed and sold as consumer goods within the accounting period. In the expenditure approach one would implicitly avoid “double counting” the value of the capital good by only adding the consumer good sales revenues for the 2 firms. (Hence trivially TR1+(TR2-F1)=(TR1-F1)+TR2=C1+C2, where F1 is the market value of the capital goods produced by firm 1)

So would capital goods sold to firms that then decide to hold these capital goods be counted as investment? I think it should, but I wanted to make sure.