opening stock + purchase - closing stock = cost of sales.