In this scenario invoices were deleted but the payments were not.
Restore the deleted invoices and apply the payments, everything comes to balance.
Note if you delete a customer, the associated Work Orders and Invoices are also deleted. Go to the archived sections of Work Orders and Invoices to retrieve those items. Once the Invoices are restored, go to the Payments tab and apply the Payments to the newly restored Invoices.
Also see: