Cost of Goods Sold & Cost of Goods Produced

We manufacture goods, however, I don't keep stock of raw materials and create Bills of Material, as they are quickly turned into finished products.  For our accounting purposes, we post goods produced as follows:

Inventory # debit

Cost of Goods Produced # credit

We post the same goods Sold as:

Inventory # credit

Cost of Goods Sold # debit

This way, we can compare our manufacturing costs to our Cost of Goods Produced, and our sales revenue to our Cost of Goods Sold. 

My question is, can I set up the accounts to automatically post this way, i.e. when ordering products through Purchase Order, it will post to COGP, but when the item sells in Order Entry, it will post to COGS?