Fetch Customer Total unpaid amount from previous invoices

How can I fetch total unpaid amount by a customer from all previous invoices and place it into the new sales invoice receipt?

Is there a fieldname for total unpaid, similar to doc.total_advance… In other words, i want to show the amount due not the one paid in advance.

thank you

1 Like

I’m also looking for this. Would love to have a heads up to alert me if they’re not paying

There is a customer ledger summary you might want to check.