Techniques for Estimating The Cost of Goods Sold and the Ending Inventory