Explain in detail how a manufacturing company calculates Cost of Goods Manufactured and Cost of Goods Sold. Discuss in detail the importance of these two calculations.