You should have some sort of Gain on Sale of Asset Acct or something similar that shows the full amount of the sale. From that Acct you can transfer the Payment to the Long Term Liability Accounts to $0 out the loans.
There may be more involved though, so check with your Tax Accountant. They may want/need to create a Journal Entry to show these payments, Closing Costs and multiple other Fees all related to making sure you only pay Income on the Income, not the Gross payment.