Best way to achieve calculation

Got it down to basics :
outstanding purchase : for hire item £400
outstanding invoice for Agent £950
payment from smith for £1350 (950 collected on behalf of agent.)
The payment for hire item balances out leaving £950 in our account that belongs to the agent but is owed to us for work.
How do I give that £950 that belongs to the agent, to the agent, to pay off what the agent owes? in quickfile

A post was merged into an existing topic: How to allocate to correct ledger