Purchase invoice staying unpaid

I have a question, hope somebody could help to clarify it. I have seen that when I return an item after the invoice has been created, it stays as unpaid, no matter I have paid it.

for example I generated invoice for 10 items with grand total of $1200

then I made a return of 1 item -$120


then I made a payment for the remaining 9 items with total of $1080:
this payment covers a check for $1056 and a purchase discount that vendor gave me of $24, both matches the $1800.


why the purchase invoice stays unpaid?

thanks for any help,