How to register discount with vendor payments?

How to register discount with vendor payments?

Hello,

How can one register discount from vendor for early bill payment?

Example:  

Vendor issues Bill with 30 days credit for a total of $1,000  If paid within 10 days of Bill date, one can deduct a $10.00 discount for early payment.

When one registers a payment directly from bill, one would enter $990 as payment amount, but bill would still be Open for $10.  How can one register the difference ($10 discount) so that Bill changes to Paid status??

Other ERPs (Odoo f.e.) automatically detect there is a difference between payment amount and vendor bill total, and asks how the difference should be registered in order for bill to change to Paid status.  This other ERP gives you the option to register the difference as discounts vs accounts payables or withholding taxes vs account payables.


Thank You