I believe u will need to use standard cost system to achieve this.
When using std cost, you dont need to care about this inventory cost when buying or selling, and u will end up with adjust difference to cogs at a regular schedule, such as quarterly.
Frank