How do I get a customers outstanding balance from accounts receivable in my print format?

I want this total value here to be accessed in the print format (Jinja)
image