Tricky GDP question

Ok, so GDP is the total market value of all goods and services produced in a country within a specific time period (usually a year), right? And it can be done using the expenditure and income approach.

OK, so what if a company makes expenditures in developing a product. Lets go with a mining example. If firms spend $400 dollars (one firm mines, other develops it, other modifies it, other firm uses it in jewelry or something) in developing the mineral from the ore to the store and if it isn’t bought by a customer in that year, it doesn’t count towards GDP calculation right.

But the problem I have with grasping it is that under the expenditures approach to calculating GDP, the 400 dollars would be included. But it shouldn’t be included by the customer doesn’t buy it that year. Please explain guys!

Thanks for your help.

Edit: Put another way, using the expenditures approach, a purchase made today for a 2009 Hummer, it wouldn’t count towards this year’s GDP right because the Hummer was made in 2009? Or should it be counted in this year’s GDP because the consumer spending was this year?

Another thing: If something is produced in 2012 and bought by a consumer in 2012, how do you prevent it from being double counted as consumer spending and business investment? Actually I have a feeling that this is a stupid question. But my last question with the hummer still stands!

Bump

Unsold units (inventory) are included in investment not consumption.

But what if it is bought next year (for example, 2009 hummer bought in 2012). The sales of the hummer would count in 2012’s GDP as part of consumer spending right?

2009: hummer produced but not sold, Investment goes up, GDP goes up

2012: nothing is produced, hummer gets sold, Consumption goes up but Investment goes down (lower inventory = disinvestment), GDP unaffected.

This is what came to my mind as well. But then a follow up question may then be, since Consumption is a function of previously produced inventories, which have contributed to GDP in previous periods, in what ways does Consumption by itself influence the GDP produced in a certain period?