How to get customer's total paid amount into sales invoice

Hello
I need to get total paid amount for customer into custom field in sales invoice
how to reach out that?