I disagree
it depends on the discount, if the discount is a sales discount you should edit the total price of each item. Sales discounts are not booked separately
If it is an early payment discount, that is a credit memo using an income account to book the amount, usually other income.
For Merchandise purchased during the year, cost means the invoice price minus appropriate discount plus transportation or other charges incurred in acquiring the goods. You must reduce the cost of inventory by a trade (or quantity) discount.