CRM and Books Integration - Customer's Paid Balance

CRM and Books Integration - Customer's Paid Balance

Hello, I wonder if anyone can help.
I need to access payment info from Books and display it in CRM.

The info I need is the amount paid towards a 'Potential' (as it is referred to in Books) or Deal in CRM. Staff using the CRM basically need to know what a customer's remaining balance is (regardless of how many invoices have been issued). Sometimes customers are issued with 3 invoices (for the various stages in our process) but pay small amounts towards each. They call up wanting to know what is left to pay, overall.

I have various functions which will create invoices from within a Deal record using the figures entered into the form (custom fields). I would like to create a new button which can display the remaining balance. This requires me to know what the customer has already paid towards that particular deal. The invoices all have the Deal referenced as a Potential in Books, so there is a connection there.

Any ideas how I can approach this/what API Name I'm looking for etc?