Your situation is not completely clear. Was sales invoice #119 a mistake? Or was the entry of advance payment a mistake?
If the mistake was the sales invoice, you are correct. You will not be able to delete it until you find and delete (or properly allocate) the payment against it. But you cannot directly delete an automatic allocation from
Customer credits, which you have probably discovered. But if you click the
Customer credits balance (or dash if it is now zero) in the
Summary, you will see a list of the transactions. You should be able to see where the allocation occurred. Then go to that transaction to make the correction.
Depending on what happened, the automatic credit allocation statement may show an opening balance. You need to figure out where that came from, probably a bank account receipt, but possibly a journal entry. So you would need to correct that entry.
Once the customer credit allocation is cleared up, you should be able to delete the sales invoice.
If the advance payment entry was the mistake, you need to go back to your bank account receipts and figure out which one was improperly allocated to that particular customer. Then allocate it to the proper customer. A customer statement with all transactions may help in that process.
I hope some of this helps.