Inventory valuation and compute the cost of goods sold