How to include "outstanding amount" in printed receipt

I would like to have the "outstanding amount" printed on the official receipt for customer payments. When I print a receipt, only the "original amount" and "paid amount" shows. I can see the "o/s amount" on SQL but it does not print.

How do I set it so that the "outstanding amount" is included in the printed receipt?

Please help. Thank you!

check if the O/S amount is using the correct data set.