Answer:
June 5, 202x, 280 units purchased on account
Dr Merchandise inventory 7,840
Cr Accounts payable 7,840
280 units x $28 per unit = $7,840
June 9, 202x, 30 defective units are returned
Dr Accounts payable 840
Cr Merchandise inventory 840
30 units returned, so accounts payable decreases by 30 x $28 = $840
June 16, 250 units sold on account
Dr Accounts receivable 12,750
Cr Sales revenue 12,750
Dr Cost of goods sold 7,000
Cr merchandise inventory 7,000
250 units sold at $51 = $12,750
COGS = 250 units x $28 = $7,000