Calculate the cost of goods sold for a merchandiser using the periodic inventory system from the following details. Purchases$510,000 Beginning Merchandise Inventory180,000 Purchase Returns and Allowances50,000 Purchase Discounts14,000 Freight In15,000 Ending Merchandise Inventory180,000