It is the statement number entered against as payment that links the invoice to the statement so you need to work back as follows:
1. Has a payment been recorded for this statement number from agent to landlord? If so, then go to Tenant Manager, Payments, Letting Agent to Landlord tab and delete the payment.
2. Next, go to Tenant Manager, Payments, Tenant to Letting Agent tab. Delete the payment recorded for this tenant against the wrong statement. Re-enter the payment, this time adding/selecting the correct statement number.
3. Finally (if point 1. was 'yes'), go to Tenant Manager, Payments, Letting Agent to Landlord tab and re-enter the payment made to the landlord from the letting agent for the balance (rent less fees) on this statement.
Hope this helps!