Thanks for posting this question in the Community. I'd like to join you here and offer help, GETTAccounting.
At the moment, there's no option to directly link or deduct payment from a customer's balance to an open bill. However, you can use a barter transaction or a clearing account to offset the amount.
A clearing account is something that you will use to move amount from one account to another in cases where you can't directly move funds. You can also use this if you want to write off a receivable against a payable or vice versa. Here's how:
- Go to the List menu and select Chart of Accounts.
- Press CTRL + N and choose Bank. You can use this bank as the payment account in closing the bill and invoice.
- Enter all other details of the account and click Save and close.

Once done, select this account in the Deposit To field when receiving the payment against the invoice. Then, use the same account when closing out the bill so they will just zero out.

Aside from that, you can also create a journal entry to write them off. Here's an article that talks about this process for more details: Set Up a Clearing Account.
However, I recommend reaching out to your accountant for additional advice on this matter. This is just to make sure that the transactions are recorded properly to maintain accurate bookkeeping.
Please don't hesitate to reply to me and let me know if you're to record both transactions as paid. I would also love to get back here and offer my help if you need anything else.