Hi 4Gd,
Welcome back to the QuickBooks Community and thanks for letting me know what's going on. I'm glad to hear that your customer was able to pay you after all of this time, but I can see how that complicates the situation since you've already written off the old invoice as bad debt. I'll steer you in the right direction for this.
With this kind of scenario, having an accountant's advice is key to knowing what steps to take. It may be as simple as recording it as a sales receipt or a bank deposit since you no longer have an invoice to apply it to. However, an accountant will know which option better suits your needs.
To connect with an accountant, you can use the My Accountant tab in QuickBooks Online. It has the option to invite your accountant on as a user to work with you directly in your books or you can use the Find a pro to help button if you don't already have an accountant.
I hope this helps. Have a great day!